Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci ignore interrupt when not expecting one, particu...



details:   https://anonhg.NetBSD.org/src/rev/5b29cb5363b2
branches:  trunk
changeset: 935396:5b29cb5363b2
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Jul 01 15:10:01 2020 +0000

description:
ignore interrupt when not expecting one, particularly don't invoke
the irqack in this case

seems cmdide doesn't honour WDCTL_IDS when executing polled commands,
and there is a race where the irqack call interferes with polled
command and causes a lockup

reported by Martin Husemann

diffstat:

 sys/dev/pci/cmdide.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 68c7c2588439 -r 5b29cb5363b2 sys/dev/pci/cmdide.c
--- a/sys/dev/pci/cmdide.c      Wed Jul 01 13:49:26 2020 +0000
+++ b/sys/dev/pci/cmdide.c      Wed Jul 01 15:10:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmdide.c,v 1.43 2017/10/22 13:13:55 jdolecek Exp $     */
+/*     $NetBSD: cmdide.c,v 1.44 2020/07/01 15:10:01 jdolecek Exp $     */
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.43 2017/10/22 13:13:55 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.44 2020/07/01 15:10:01 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -238,9 +238,15 @@
        for (i = 0; i < sc->sc_wdcdev.sc_atac.atac_nchannels; i++) {
                cp = &sc->pciide_channels[i];
                wdc_cp = &cp->ata_channel;
+
                /* If a compat channel skip. */
                if (cp->compat)
                        continue;
+
+               /* if this channel not waiting for intr, skip */
+               if ((wdc_cp->ch_flags & ATACH_IRQ_WAIT) == 0)
+                       continue;
+
                if ((i == 0 && (priirq & CMD_CONF_DRV0_INTR)) ||
                    (i == 1 && (secirq & CMD_ARTTIM23_IRQ))) {
                        crv = wdcintr(wdc_cp);



Home | Main Index | Thread Index | Old Index