linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: fix APST error for power latency tolerance
@ 2021-03-23  7:31 pngliu
  2021-03-23 16:23 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: pngliu @ 2021-03-23  7:31 UTC (permalink / raw)
  To: kbusch; +Cc: linux-nvme, Peng Liu

From: Peng Liu <liupeng17@lenovo.com>

Clear apsta so that nvme_configure_apst() does not execute
nvme_set_features(), which will fail because admin_q is either not set up
yet or no longer available at the time of nvme_uninit_ctrl() being called,
and this leads to the error message "nvme nvme0: failed to set APST feature
(-19)".

Fixes: 510a405d945b("nvme: fix memory leak for power latency tolerance")

Signed-off-by: Peng Liu <liupeng17@lenovo.com>
---
 drivers/nvme/host/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e68a8c4ac5a6..413a33c67655 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4475,7 +4475,11 @@ void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
 {
 	nvme_hwmon_exit(ctrl);
 	nvme_fault_inject_fini(&ctrl->fault_inject);
+
+	/* clear APSTA since admin_q is unavailable for feature setting */
+	ctrl->apsta = 0;
 	dev_pm_qos_hide_latency_tolerance(ctrl->device);
+
 	cdev_device_del(&ctrl->cdev, ctrl->device);
 	nvme_put_ctrl(ctrl);
 }
-- 
2.25.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-09  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23  7:31 [PATCH] nvme: fix APST error for power latency tolerance pngliu
2021-03-23 16:23 ` Christoph Hellwig
2021-03-24  2:38   ` Peng Liu
2021-03-24  7:58     ` Christoph Hellwig
2021-04-09  7:19       ` Christoph Hellwig
2021-04-09  8:12         ` Peng Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).