Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic in wdctimeout() ignore timeout if not actually wa...



details:   https://anonhg.NetBSD.org/src/rev/45c486953ad9
branches:  trunk
changeset: 933035:45c486953ad9
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue May 19 08:21:29 2020 +0000

description:
in wdctimeout() ignore timeout if not actually waiting for IRQ, to avoid
processing xfer which is not quite setup

in wdcintr() actually write the error message on invocation when
not waiting for IRQ even without ATADEBUG option, as usually that
is a driver bug; might revisit this if this ends up too noisy for
PCI-IDE which seems to ignore WDCTL_IDS and hence trigger irq even
for polled commands

diffstat:

 sys/dev/ic/wdc.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 9a19b35fc06d -r 45c486953ad9 sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Tue May 19 08:08:51 2020 +0000
+++ b/sys/dev/ic/wdc.c  Tue May 19 08:21:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc.c,v 1.299 2020/04/13 10:49:34 jdolecek Exp $ */
+/*     $NetBSD: wdc.c,v 1.300 2020/05/19 08:21:29 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.299 2020/04/13 10:49:34 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.300 2020/05/19 08:21:29 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -888,7 +888,7 @@
        }
 
        if ((chp->ch_flags & ATACH_IRQ_WAIT) == 0) {
-               ATADEBUG_PRINT(("wdcintr: irq not expected\n"), DEBUG_INTR);
+               __wdcerror(chp, "irq not expected");
                goto ignore;
        }
 
@@ -1346,6 +1346,11 @@
 
        callout_ack(&chp->c_timo_callout);
 
+       if ((chp->ch_flags & ATACH_IRQ_WAIT) == 0) {
+               __wdcerror(chp, "timeout not expected without pending irq");
+               goto out;
+       }
+
        xfer = ata_queue_get_active_xfer(chp);
        KASSERT(xfer != NULL);
 



Home | Main Index | Thread Index | Old Index