Skip to contentSkip to conversation

nvme-pci: use simple suspend when a HMB is enabled

PATCH In review Christoph Hellwig 3 participants 5 messages Jun 9, 2020 – Jun 10, 2020 NVMe

lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw

PATCH 1/1 nvme-pci: use simple suspend when a HMB is enabled

While the NVMe specification allows the device to access the host memory buffer in host DRAM from all power states, hosts will fail access to DRAM during S3 and similar power states.

---
 drivers/nvme/host/pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/host/pci.c +6 -0
index d690d5593a8095..e2bacd369a88a0 100644
@@ -2950,9 +2950,15 @@ static int nvme_suspend(struct device *dev)
 	 * the PCI bus layer to put it into D3 in order to take the PCIe link
 	 * down, so as to allow the platform to achieve its minimum low-power
 	 * state (which may not be possible if the link is up).
+	 *
+	 * If a host memory buffer is enabled, shut down the device as the NVMe
+	 * specification allows the device to access the host memory buffer in
+	 * host DRAM from all power states, but hosts will fail access to DRAM
+	 * during S3.
 	 */
 	if (pm_suspend_via_firmware() || !ctrl->npss ||
 	    !pcie_aspm_enabled(pdev) ||
+	    ndev->nr_host_mem_descs ||
 	    (ndev->ctrl.quirks & NVME_QUIRK_SIMPLE_SUSPEND))
 		return nvme_disable_prepare_reset(ndev, true);
 
Signature · 7 lines
2.26.2


_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
maintainer
#1 lore raw
Quoted 5 lines · Christoph Hellwig

While the NVMe specification allows the device to access the host memory buffer in host DRAM from all power states, hosts will fail access to DRAM during S3 and similar power states.

Looks good. Stable ought to pick this up too.

Quoted 14 lines
 drivers/nvme/host/pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/host/pci.c +2 -0
index d690d5593a8095..e2bacd369a88a0 100644
@@ -2950,9 +2950,15 @@ static int nvme_suspend(struct device *dev)
 	 * the PCI bus layer to put it into D3 in order to take the PCIe link
 	 * down, so as to allow the platform to achieve its minimum low-power
 	 * state (which may not be possible if the link is up).
+	 *
+	 * If a host memory buffer is enabled, shut down the device as the NVMe

drivers/nvme/host/pci.c static int nvme_suspend(struct device *dev) · line 2964

Quoted 10 lines
drivers/nvme/host/pci.c +4 -0
+	 * specification allows the device to access the host memory buffer in
+	 * host DRAM from all power states, but hosts will fail access to DRAM
+	 * during S3.
 	 */
 	if (pm_suspend_via_firmware() || !ctrl->npss ||
 	    !pcie_aspm_enabled(pdev) ||
+	    ndev->nr_host_mem_descs ||
 	    (ndev->ctrl.quirks & NVME_QUIRK_SIMPLE_SUSPEND))
 		return nvme_disable_prepare_reset(ndev, true);
 

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer Reviewed-by
#2 lore raw
Quoted 8 lines · Keith Busch
Quoted 5 lines · Christoph Hellwig

While the NVMe specification allows the device to access the host memory buffer in host DRAM from all power states, hosts will fail access to DRAM during S3 and similar power states.

Looks good. Stable ought to pick this up too.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

author maintainer
#4 lore raw
In reply to Keith Busch
Quoted 8 lines · Keith Busch
Quoted 5 lines · Christoph Hellwig

While the NVMe specification allows the device to access the host memory buffer in host DRAM from all power states, hosts will fail access to DRAM during S3 and similar power states.

Looks good. Stable ought to pick this up too.

I've added a:

Fixes d916b1be94b6 ("nvme-pci: use host managed power state for suspend")

and added it to nvme-5.8.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme