Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp663721pxj; Tue, 18 May 2021 11:18:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyycWeKIA3fXMnp2xfgf50iEt5Bhe1bTIyS+wQ8R0j+2an3ILR56XZD85et6LjdkISCV6DT X-Received: by 2002:aa7:cfcd:: with SMTP id r13mr8675372edy.177.1621361897443; Tue, 18 May 2021 11:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621361897; cv=none; d=google.com; s=arc-20160816; b=wsfMvvt+370F2Ee8ReYUXkFDFUFuByKFZLX+1Ib7wyulbQhjXtcj/iMXISkLIXkl2S AvNckbXIE+LD+IBxm6WAtfxmEjDarswzYZexHNAjCnHu/aY0cx2hQ7pAlshASe07Dg6w 8k6RpkYTGWvkWg9IdSr4ktW5UHvEiqv5FtJuEnfA0jM/yB6edV+4xoDHr5VXiaWiT6iZ y7yPnz3bPu+NsRQhZbMS3cgk1dUaxAWDcxWW0N7sHxrpMBgLWfH/S8JgI4DcGsN2QFe8 f8GxbkDKOC3w2Z6Jy5ZXxVFajT+Ps2uewBHeNx7Z6jXeYzwu/QZGXFMpwv7BJoD3zcGA Edbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E244vd4coUm36ujsol7mTteLWeKbSmK7om5jDCTRZlI=; b=MU4JwFNpe+ZtFKaiwBxtrrPWXwBszeYGhSAJzdqBKOem3KRGgajA/SCZZ79aSa6coX uWn8qQV6DKs8+mpaXCKJiZArIA7DY+xsshMh/C70l3OvlNo2fbiSiZ7PU0z7K6V1xdtq /lP4c9WaXrGZD/EL2RXG4ob8iIjGb2z6IfqqFg2POKR6n78mg3+V4RlZpUPTw2iFHU8K AzsI4mz+oa0+vQzH4cIdC334vuGOxDYAr9a9Joqn4doP8tV2ia6fW0LARZwv/X9MCDMk bqeqssIHfuetm487RWd3QL2Ff497iq7MQSubT0Pq5EqIxAg6ywTSWOr+aCXAXZroHwra ZnTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=El1Inhv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si567834ejf.428.2021.05.18.11.17.54; Tue, 18 May 2021 11:18:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=El1Inhv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345856AbhEQQO3 (ORCPT + 99 others); Mon, 17 May 2021 12:14:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345110AbhEQPuP (ORCPT ); Mon, 17 May 2021 11:50:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 19D8D61D43; Mon, 17 May 2021 14:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262743; bh=grHjv2NKDKo3mLYiaU5UpHcXyJDgSHwMjgiwlv45/Jw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=El1Inhv0Diq/YuPIoTIy561TMjaVRugf2NaSNlCA6w08ZIwPn4srKfzNX+eqDtkeL zXdV/EfIjdDUspRdWlFj0iisuQrwjSVSmK0GqEJF1Qw3lyM3qhQ4o9HY66XDt95hi1 1ZOP9GfO/3yMqeXw/zcYcp1D4NFoQ8EPS8964gpU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Liu , Christoph Hellwig , Keith Busch Subject: [PATCH 5.10 288/289] nvme: do not try to reconfigure APST when the controller is not live Date: Mon, 17 May 2021 16:03:33 +0200 Message-Id: <20210517140314.845106593@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig commit 53fe2a30bc168db9700e00206d991ff934973cf1 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: 510a405d945b("nvme: fix memory leak for power latency tolerance") Reported-by: Peng Liu Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2622,7 +2622,8 @@ static void nvme_set_latency_tolerance(s 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); } }