Module Name:    src
Committed By:   jdolecek
Date:           Tue May 19 08:21:30 UTC 2020

Modified Files:
        src/sys/dev/ic: wdc.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.299 -r1.300 src/sys/dev/ic/wdc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.299 src/sys/dev/ic/wdc.c:1.300
--- src/sys/dev/ic/wdc.c:1.299	Mon Apr 13 10:49:34 2020
+++ src/sys/dev/ic/wdc.c	Tue May 19 08:21:29 2020
@@ -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 @@ wdcintr(void *arg)
 	}
 
 	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 @@ wdctimeout(void *arg)
 
 	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);
 

Reply via email to