Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp395721pxj; Thu, 20 May 2021 11:49:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjwu7QvRNWL4lMaHanDll8Pugqe8rhmMUSDkCoStUIDnDisdzPJPkjlgLCPBLcRt0DagGg X-Received: by 2002:a6b:d20e:: with SMTP id q14mr7222940iob.200.1621536583066; Thu, 20 May 2021 11:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621536583; cv=none; d=google.com; s=arc-20160816; b=VKOqq1R/IWe5SL1CYrfeTWE5rq+7CZmO24/UW/KjG16QaF3WGVQmAolGz+qxR9fNrO zGDNa1RlRCjjtTCr60iu9hCX8Lq2+jaZ8czbc70iuZU8agDE/RqFXf0akgaGEue214+5 3tLS+V4ix6j3bPjCw9HL23GX4jMor8vB7NU3EzOCyjLdFz2PkZPOhqs4SRNWxaHexing IQJQDOVWUm05mVAVvddqLvMWqjJrPg3LZkCFIju+Kh0ecI8RDWDJYgfQVWTdbB7yTse9 /Bxkc1A+p+2qFh5eZKOQC8aGWzHpV6b2El628CCEcGgOiPUpnB9F1xkY35QxQMaCeDUp 4CCQ== 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=rHltQ7s5/go3wOTukmAbsRV8OYHB+00NetYwYnelI44=; b=rieRjo0YCghoCatvr210D3ekJOvEh8XkG/VCrDq4V/yAofS2EbyIrYOyPK7JLtGbOa BtJ1vr+1OuEakaZpnt3sA1AF8f/LU3BIZyHddTVQtIU5wk5eddkzhYEN/nEfz/6USy8+ /CLWJ02o5uaKCGf09cMV+opYBbfBH1uhSwr5K0diBy4sgnzJI88SDK2UqAKkSs6b7dgf kewF41e+WHtBuL4i07yjjCV2FRqWltr7oc3AUDXnhfRGAcAWTBPjCaswsAzTarXkotLp qopszCXEqut11ADRPrajyUAdL2CRHmDN2mo6F7nrrpx25Ve5SLMHHuNFtJAVsLFee0vv Lb0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xY1iGY19; 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 g16si3097599jat.43.2021.05.20.11.49.30; Thu, 20 May 2021 11:49:43 -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=xY1iGY19; 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 S235371AbhETKXS (ORCPT + 99 others); Thu, 20 May 2021 06:23:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:46918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235666AbhETKMF (ORCPT ); Thu, 20 May 2021 06:12:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2FC4061968; Thu, 20 May 2021 09:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503820; bh=VNZ3q1Zq2Nzpq7XAb3m6tF+7MrbVohaHpgAvyGeSozQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xY1iGY19XKOoAvW+0hsJzRgfMX/xyGuxin28r1fniRfgGtiXweGG2nJry3Amrv8Rn dLwzUylK4fLWsqjLPXT6M9BbFYU8vxoWHtjHFRs4eMXIeAHGRq4EBnRXzvPyskb6Nc S4X80ekUHAij0qttkcGAW/NmD4eUSPhM97qfrvQQ= 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 4.19 393/425] nvme: do not try to reconfigure APST when the controller is not live Date: Thu, 20 May 2021 11:22:42 +0200 Message-Id: <20210520092144.325728366@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 @@ -2091,7 +2091,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); } }