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
This commit is contained in:
Navdeep Parhar 2018-05-01 14:59:38 +00:00
parent 837db84723
commit faf6d96b45
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333139

View file

@ -1317,17 +1317,17 @@ 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)) {
rc = bus_generic_detach(dev);
if (rc) {