Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2018 14:59:38 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333139 - head/sys/dev/cxgbe
Message-ID:  <201805011459.w41ExcaF064925@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Tue May  1 14:59:38 2018
New Revision: 333139
URL: https://svnweb.freebsd.org/changeset/base/333139

Log:
  cxgbe(4): Destroy the cdev before disabling interrupts in driver detach.
  
  Filter work requests are submitted in the nexus cdev's ioctl which then
  blocks waiting for a reply.  If driver detach runs in this state and
  disables interrupts the ioctl will never complete and detach will hang
  in destroy_cdev.
  
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Tue May  1 13:57:08 2018	(r333138)
+++ head/sys/dev/cxgbe/t4_main.c	Tue May  1 14:59:38 2018	(r333139)
@@ -1317,15 +1317,15 @@ t4_detach_common(device_t dev)
 
 	sc = device_get_softc(dev);
 
+	if (sc->cdev) {
+		destroy_dev(sc->cdev);
+		sc->cdev = NULL;
+	}
+
 	sc->flags &= ~CHK_MBOX_ACCESS;
 	if (sc->flags & FULL_INIT_DONE) {
 		if (!(sc->flags & IS_VF))
 			t4_intr_disable(sc);
-	}
-
-	if (sc->cdev) {
-		destroy_dev(sc->cdev);
-		sc->cdev = NULL;
 	}
 
 	if (device_is_attached(dev)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805011459.w41ExcaF064925>