Module Name:    src
Committed By:   msaitoh
Date:           Mon Sep  7 03:57:28 UTC 2020

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Don't schedule admin work while shutdown like the recovery mode timer.

 The admin workqueue also runs while !IFF_UP like the recovery mode timer.
Apply the same change of ixgbe.c 1.254 to ixgbe_schedule_admin_tasklet()
to prevent panic. Found by ozaki-r@.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/sys/dev/pci/ixgbe/ixgbe.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/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.254 src/sys/dev/pci/ixgbe/ixgbe.c:1.255
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.254	Tue Sep  1 04:19:16 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Sep  7 03:57:27 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.254 2020/09/01 04:19:16 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.255 2020/09/07 03:57:27 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -1538,9 +1538,11 @@ static void
 ixgbe_schedule_admin_tasklet(struct adapter *adapter)
 {
 
-	if (atomic_cas_uint(&adapter->admin_pending, 0, 1) == 0)
-		workqueue_enqueue(adapter->admin_wq,
-		    &adapter->admin_wc, NULL);
+	if (__predict_false(adapter->osdep.detaching == false)) {
+		if (atomic_cas_uint(&adapter->admin_pending, 0, 1) == 0)
+			workqueue_enqueue(adapter->admin_wq,
+			    &adapter->admin_wc, NULL);
+	}
 }
 
 /************************************************************************

Reply via email to