Author: np
Date: Wed Oct 17 00:57:28 2018
New Revision: 339397
URL: https://svnweb.freebsd.org/changeset/base/339397

Log:
  MFC r333139:
  
  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.

Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_main.c   Wed Oct 17 00:45:01 2018        
(r339396)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Wed Oct 17 00:57:28 2018        
(r339397)
@@ -1308,15 +1308,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)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to