Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>, sagi@grimberg.me, kbusch@kernel.org
Cc: linux-nvme@lists.infradead.org, Peng Liu <liupeng17@lenovo.com>
Subject: Re: [PATCH] nvme: do not try to reconfigure APST when the controller is not live
Date: Sat, 1 May 2021 13:36:11 +0200	[thread overview]
Message-ID: <79605e56-4e35-4112-11ba-4b6ca9baffef@suse.de> (raw)
In-Reply-To: <20210409094905.1920747-1-hch@lst.de>

On 4/9/21 11:49 AM, Christoph Hellwig wrote:
> 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: 510a405d945b("nvme: fix memory leak for power latency tolerance")
> Reported-by: Peng Liu <liupeng17@lenovo.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/nvme/host/core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 63a1e6cc27acab..f3c7b1cb2c7c8c 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -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);
>   	}
>   }
>   
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +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
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

      parent reply	other threads:[~2021-05-01 11:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09  9:49 [PATCH] nvme: do not try to reconfigure APST when the controller is not live Christoph Hellwig
2021-04-19  7:09 ` Christoph Hellwig
2021-04-19 15:16 ` Keith Busch
2021-05-01 11:36 ` Hannes Reinecke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=79605e56-4e35-4112-11ba-4b6ca9baffef@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=liupeng17@lenovo.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox