Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2018 16:45:44 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r328685 - stable/11/sys/dev/nvme
Message-ID:  <201802011645.w11Gji3O026287@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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