Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp254274pxj; Tue, 18 May 2021 02:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVd/0yvb+ugRlRGsfB0wxMSEj56OVIIlSXSarj8St5J0hlwI5kLMH/9aBT70mkW+GJL3m3 X-Received: by 2002:a17:906:840c:: with SMTP id n12mr5045628ejx.431.1621330473647; Tue, 18 May 2021 02:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621330473; cv=none; d=google.com; s=arc-20160816; b=kN1PKO5Znm5RXIocnJfMWaZEa5xZsPLloIHSjxUfdl1OGuktltKy+VasQOQs8RuXUe 94/NJuLxTYW1CPQJVRvNHsRIunbD9fjYDxUajngot7cuUvoxMHyHCNEHA19xWR6iuy3S 4uBT0wNoHM1iiL/3XXnz1Xvt1B2KO3YCut+Y9A3WYtnxUrlbVC1BnM+fUNH0mX8/tpBV 5WJCqy03OKFswKUEJdzXjI6kkHlSRXnH8I5dP+3PviCt5F0Co2rdgteOP+Kfk5tl2DH8 PyvlrKTBLTmczRVzDsKlfAbexErt/Cnvj5NzDOZ9wGPbZjZZJb1JNloQi4WmWu9uoqtZ cOVg== 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=dAbe8ftlhk58PZiNhDHB/eAF4w8WFDeFpe8GEqZJObY=; b=ytLx7cgx8CZ/d1T8rhN+nut28oXmAT0+HTmuKElbLLqHwqWZHgsnEbhENtWPRpafh2 8BSazAoxMsAFWTa/aSbWs8a80lEVwN3ye+WWqKr4asHbfXX1Ysnr9DE0ADYuo4wvsAXW f3ScDSmd79DlWf4jpYfpFZVyAVH3QUikr06/U76zWVfs6jshSU9buX87LqGfND5U5ayr IzjBhOa/MpaCsao/mnZZ4QihdEMkZA6etoDbQMZR9yQMhMZ0g/SIk7QpsJqUie/FDiJl cCfXVKSBeVLbjOZzGaqWC9Uvxw9pNy7T6Y6O3RVHTOZNlACPbSutnEps4uMBbxknJPAL aofQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YS6S1rZa; 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 r1si16847102ejd.259.2021.05.18.02.34.10; Tue, 18 May 2021 02:34:33 -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=YS6S1rZa; 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 S242730AbhEQPHp (ORCPT + 99 others); Mon, 17 May 2021 11:07:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:58762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240859AbhEQO6B (ORCPT ); Mon, 17 May 2021 10:58:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 421E6619A0; Mon, 17 May 2021 14:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261556; bh=N3woAMONE4VOqQ8ZSmbSPENeOZAcJxBURObNk+KvJtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YS6S1rZaoCw5dHHeKncPV8y2H8KMTTV5lXzIk2s73BpXq6Oe/xs1SfCYHljsg75PD UDK0yzcrI638swAKwe55xOs2BM4PAD23zHqWh0CJGHQ35Kh5h5sM4505IOj80wfMd9 WYrFZM215rurUCq+HjsNgQ/l3VTpBymZtFwCbFyM= 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.12 362/363] nvme: do not try to reconfigure APST when the controller is not live Date: Mon, 17 May 2021 16:03:48 +0200 Message-Id: <20210517140314.834601078@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 @@ -2681,7 +2681,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); } }