Author: mav
Date: Thu Feb  1 16:45:44 2018
New Revision: 328685
URL: https://svnweb.freebsd.org/changeset/base/328685

Log:
  MFC r322872 (by imp):
  Enable bus mastering on the device before resetting the device. The
  card has to do PCIe transactions to complete the reset process, but
  can't do them, per the PCIe spec, unless bus mastering is enabled.

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

Modified: stable/11/sys/dev/nvme/nvme.c
==============================================================================
--- stable/11/sys/dev/nvme/nvme.c       Thu Feb  1 16:45:08 2018        
(r328684)
+++ stable/11/sys/dev/nvme/nvme.c       Thu Feb  1 16:45:44 2018        
(r328685)
@@ -247,6 +247,12 @@ nvme_attach(device_t dev)
        }
 
        /*
+        * Enable busmastering so the completion status messages can
+        * be busmastered back to the host.
+        */
+       pci_enable_busmaster(dev);
+
+       /*
         * Reset controller twice to ensure we do a transition from cc.en==1
         *  to cc.en==0.  This is because we don't really know what status
         *  the controller was left in when boot handed off to OS.
@@ -262,8 +268,6 @@ nvme_attach(device_t dev)
                nvme_ctrlr_destruct(ctrlr, dev);
                return (status);
        }
-
-       pci_enable_busmaster(dev);
 
        ctrlr->config_hook.ich_func = nvme_ctrlr_start_config_hook;
        ctrlr->config_hook.ich_arg = ctrlr;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to