Commit 53fe2a30 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

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.

Fixes: 510a405d("nvme: fix memory leak for power latency tolerance")
Reported-by: default avatarPeng Liu <liupeng17@lenovo.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
parent 74c22990
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2321,6 +2321,7 @@ static void nvme_set_latency_tolerance(struct device *dev, s32 val)

	if (ctrl->ps_max_latency_us != latency) {
		ctrl->ps_max_latency_us = latency;
		if (ctrl->state == NVME_CTRL_LIVE)
			nvme_configure_apst(ctrl);
	}
}