Skip to content

Commit b97120b

Browse files
Christoph Hellwigaxboe
authored andcommitted
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. Fixes: d916b1b ("nvme-pci: use host managed power state for suspend") Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Keith Busch <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent c9c12e5 commit b97120b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,9 +2950,15 @@ static int nvme_suspend(struct device *dev)
29502950
* the PCI bus layer to put it into D3 in order to take the PCIe link
29512951
* down, so as to allow the platform to achieve its minimum low-power
29522952
* state (which may not be possible if the link is up).
2953+
*
2954+
* If a host memory buffer is enabled, shut down the device as the NVMe
2955+
* specification allows the device to access the host memory buffer in
2956+
* host DRAM from all power states, but hosts will fail access to DRAM
2957+
* during S3.
29532958
*/
29542959
if (pm_suspend_via_firmware() || !ctrl->npss ||
29552960
!pcie_aspm_enabled(pdev) ||
2961+
ndev->nr_host_mem_descs ||
29562962
(ndev->ctrl.quirks & NVME_QUIRK_SIMPLE_SUSPEND))
29572963
return nvme_disable_prepare_reset(ndev, true);
29582964

0 commit comments

Comments
 (0)