提交 335cb651 编写于 作者: C Christoph Hellwig 提交者: Zheng Zengkai

nvme: do not try to reconfigure APST when the controller is not live

stable inclusion
from stable-5.10.38
commit cd709c8e06b6356c820297f583070884c60186c9
bugzilla: 51875
CVE: NA

--------------------------------

commit 53fe2a30 upstream.

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.

Fixes: 510a405d("nvme: fix memory leak for power latency tolerance")
Reported-by: NPeng Liu <liupeng17@lenovo.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NKeith Busch <kbusch@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 56ada626
...@@ -2622,6 +2622,7 @@ static void nvme_set_latency_tolerance(struct device *dev, s32 val) ...@@ -2622,6 +2622,7 @@ static void nvme_set_latency_tolerance(struct device *dev, s32 val)
if (ctrl->ps_max_latency_us != latency) { if (ctrl->ps_max_latency_us != latency) {
ctrl->ps_max_latency_us = latency; ctrl->ps_max_latency_us = latency;
if (ctrl->state == NVME_CTRL_LIVE)
nvme_configure_apst(ctrl); nvme_configure_apst(ctrl);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册