diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 149ecf73df38..f536c4d480d4 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "trace.h" #include "nvme.h" @@ -3148,6 +3149,12 @@ static int nvme_suspend(struct device *dev) ndev->last_ps = U32_MAX; + printk("Greetings from nvme_suspend!"); + if (ndev->hmb) { + ret = nvme_set_host_mem(ndev, 0); + if (ret < 0) + goto fail; + } /* * The platform does not remove power for a kernel managed suspend so * use host managed nvme power settings for lowest idle power if @@ -3178,11 +3185,6 @@ static int nvme_suspend(struct device *dev) * but the specification allows the controller to access memory in a * non-operational power state. */ - if (ndev->hmb) { - ret = nvme_set_host_mem(ndev, 0); - if (ret < 0) - goto unfreeze; - } ret = nvme_get_power_state(ctrl, &ndev->last_ps); if (ret < 0) @@ -3212,6 +3214,7 @@ static int nvme_suspend(struct device *dev) } unfreeze: nvme_unfreeze(ctrl); +fail: return ret; }