svn commit: r351403 - head/sys/dev/nvme

Warner Losh imp at FreeBSD.org
Thu Aug 22 20:09:33 UTC 2019


Author: imp
Date: Thu Aug 22 20:09:32 2019
New Revision: 351403
URL: https://svnweb.freebsd.org/changeset/base/351403

Log:
  Move releasing of resources to later
  
  Turn off bus master after we detach the device (to match the prior
  order).  Release MSI after we're done detaching and have turned off
  all the interrupts. Otherwise this may cause problems as other threads
  race nvme_detach. This more closely matches the old order.
  
  Reviewed by: mav@

Modified:
  head/sys/dev/nvme/nvme_pci.c

Modified: head/sys/dev/nvme/nvme_pci.c
==============================================================================
--- head/sys/dev/nvme/nvme_pci.c	Thu Aug 22 19:49:51 2019	(r351402)
+++ head/sys/dev/nvme/nvme_pci.c	Thu Aug 22 20:09:32 2019	(r351403)
@@ -215,11 +215,13 @@ static int
 nvme_pci_detach(device_t dev)
 {
 	struct nvme_controller*ctrlr = DEVICE2SOFTC(dev);
+	int rv;
 
+	rv = nvme_detach(dev);
 	if (ctrlr->msix_enabled)
 		pci_release_msi(dev);
 	pci_disable_busmaster(dev);
-	return (nvme_detach(dev));
+	return (rv);
 }
 
 static int


More information about the svn-src-all mailing list