nvme: do not try to reconfigure APST when the controller is not live
Christoph Hellwig
maintainerPATCH 1/1 nvme: do not try to reconfigure APST when the controller is not live
Do not call nvme_configure_apst when the controller is not live, given that nvme_configure_apst will fail due the lack of an admin queue when the controller is being torn down and nvme_set_latency_tolerance is called from dev_pm_qos_hide_latency_tolerance.
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
@@ -2740,7 +2740,8 @@ static void nvme_set_latency_tolerance(struct device *dev, s32 val)if (ctrl->ps_max_latency_us != latency) { ctrl->ps_max_latency_us = latency; -nvme_configure_apst (ctrl); +if (ctrl->state ==NVME_CTRL_LIVE ) +nvme_configure_apst (ctrl); } }
Signature · 7 lines
2.30.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerping?
Quoted 34 lines · Christoph Hellwig
Do not call
nvme_configure_apstwhen the controller is not live, given thatnvme_configure_apstwill fail due the lack of an admin queue when the controller is being torn down andnvme_set_latency_toleranceis called fromdev_pm_qos_hide_latency_tolerance.Fixes 510a405d945b("nvme: fix memory leak for power latency tolerance")Reported-by Peng Liu <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/nvme/host/core.c +2
-1@@ -2740,7 +2740,8 @@ static void nvme_set_latency_tolerance(struct device *dev, s32 val)if (ctrl->ps_max_latency_us != latency) { ctrl->ps_max_latency_us = latency; -nvme_configure_apst (ctrl); +if (ctrl->state ==NVME_CTRL_LIVE ) +nvme_configure_apst (ctrl); } }Signature · 7 lines
2.30.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
---end quoted text---
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 8 lines · Christoph Hellwig
Do not call
nvme_configure_apstwhen the controller is not live, given thatnvme_configure_apstwill fail due the lack of an admin queue when the controller is being torn down andnvme_set_latency_toleranceis called fromdev_pm_qos_hide_latency_tolerance.Fixes 510a405d945b("nvme: fix memory leak for power latency tolerance")Reported-by Peng Liu <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>
Looks good.
Quoted 21 lines
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/nvme/host/core.c +2
-1@@ -2740,7 +2740,8 @@ static void nvme_set_latency_tolerance(struct device *dev, s32 val)if (ctrl->ps_max_latency_us != latency) { ctrl->ps_max_latency_us = latency; -nvme_configure_apst (ctrl); +if (ctrl->state ==NVME_CTRL_LIVE ) +nvme_configure_apst (ctrl); } }Signature · 1 line
2.30.1
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 18 lines · Christoph Hellwig
Do not call
nvme_configure_apstwhen the controller is not live, given thatnvme_configure_apstwill fail due the lack of an admin queue when the controller is being torn down andnvme_set_latency_toleranceis called fromdev_pm_qos_hide_latency_tolerance.Fixes 510a405d945b("nvme: fix memory leak for power latency tolerance")Reported-by Peng Liu <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/nvme/host/core.c +0
-0
drivers/nvme/host/core.c static void nvme_set_latency_tolerance(struct device *dev, s32 val) · line 2747
Quoted 9 lines
drivers/nvme/host/core.c +2
-1@@ -2740,7 +2740,8 @@ static void nvme_set_latency_tolerance(struct device *dev, s32 val)if (ctrl->ps_max_latency_us != latency) { ctrl->ps_max_latency_us = latency; -nvme_configure_apst (ctrl); +if (ctrl->state ==NVME_CTRL_LIVE ) +nvme_configure_apst (ctrl); } }
Cheers,
Hannes
Signature · 9 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme