From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384548; b=PDAHBDi9fFE+KHpj3E7YMXBnTwx2pNUbQVgwE5Cj1DBFYSzAx7EJFhyXQxXal/eTR5U7 /IvWjBH3QirchJyBTlWgE7ypG3IjcKGwqOG0DQDbyts8W7J6qySC6Ko8TMiCouCF1lr3l 3SAWMBzSjx0xYwX3nqPsuzgp9T3jvCQ91/GpfqxnxSc67YMQOQtXb/H2uAa+Cx3cAsiBF 7Bbk59IXSZDPFZT8FpVDOgo/DIoik3MJN23bueq2YE6HM/S+u3GyCueNrqMTK74fPLZ3i uyyePPq4K8BkzhgRU+tvxFZW+IGT6R5MAd23G/XBcSTNgcdw/Ze0DPDeNgJ3YLw/kkQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384548; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=5wa27Bzao/WhSsH1Ffh1pf8QoN1EqQh/xBXU3U+Zkas=; b=Zy4NT+x5L07Q0C+bhQbZAyd2i8eo4YXmeniYHEowh1N9PGKGfxivoC6ObGH23/C8ED8v AV9qFAPpnxRGvEXUTLR2Lfkyz9qNtXyPIXQwtkGQN1yoyrSYCN1DLHLF9VP21PaGIQ1oQ BpxynFaYoh+2kb/WY+vE0esKfkDOphV/8U1fFq7fjyYX8uderkcT1yzuRHb/R5EDncUu3 UbTZlhjpASi27hEeaHDWEJHpZ+fDfDOWEERXkGlJZkqYkyqMGrVNfIuQ//4smrT+zsKyn TqEvt4nAl8Gev2A9BWP9T1uCflMOwFdYyhZ3KQU2YAQji0mum25EAh6f/4St6K9txgA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uuZK3XEB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06309606A322; Fri, 4 Dec 2026 11:42:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uuZK3XEB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 763DE1F000CE; Fri, 4 Dec 2026 11:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384547; bh=5wa27Bzao/WhSsH1Ffh1pf8QoN1EqQh/xBXU3U+Zkas=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uuZK3XEBn7FMzPYmeZEFeXoZ7fGo5OV6oy479ryVP5Qopn6FXQXKbQzCMUNd6TQUQ 2vWvIZi7S0z8npvdLh3m3sEvdVOK+95lqx/2/HEpR1xc4cntuCFOX2LY2ao/UxjEmA /noHM4CLViWuvH/jEJZQY7Lq/TUzrPdoyScZ4FfE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nathan Blomquist , Alex Deucher , Mario Limonciello , Sasha Levin Subject: [PATCH 6.6 0155/1167] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Date: Fri, 4 Dec 2026 18:53:02 +0900 Message-ID: <20261204100706.121835385@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mario Limonciello [ Upstream commit a26ec190925733dd205507493e936e59dbcd2b19 ] On Navi1x/Sienna Cichlid with runtime PM, when the audio function is enabled, BACO entry and exit are delegated to PMFW by sending SMU_MSG_ArmD3 instead of going through smu_v11_0_baco_set_state(). Unlike the v13/v14/v15 helpers, smu_v11_0_baco_set_armd3_sequence() does not update smu_baco->state, so the driver keeps reporting SMU_BACO_STATE_EXIT while the ASIC is armed for / sitting in BACO. At runtime resume amdgpu_device_baco_exit() checks amdgpu_device_supports_baco(), which ends up in smu_v11_0_get_bamaco_support(). Since the state never reads ENTER, the "already in BACO" shortcut is skipped and the live BACO feature bit is consulted instead. PMFW clears that bit once ArmD3(BACO) is armed, so the check reports "supported but not enabled", the exit fails with -ENOTSUPP and the ULPS ArmD3 message is never sent. The runtime resume caller ignores the error, and a later secondary bus reset leaves the device unreachable. This shows up on a Navi 23 being handed from amdgpu to vfio-pci: baco_enter: in_runpm=1 audio_enabled=1 armd3=1 baco_state=1 ret=0 bamaco: state=1 ... feat supported=1 enabled=0 in_runpm=1 baco_exit: supports=0 ... runtime resume: baco_exit ret=-524 Update smu_baco->state in the helper, mirroring the v13 implementation, so the capability check short-circuits while in BACO. Reported-by: Nathan Blomquist Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/6076 Tested-by: Nathan Blomquist Fixes: 13d75eadfa1a ("drm/amd/pm: correct the runpm handling for BACO supported ASIC") Acked-by: Alex Deucher Link: https://patch.msgid.link/20261103141457.2558235-1-mario.limonciello@amd.com Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher (cherry picked from commit d515b2694eab5b35533c7fb7af5bddff53ff60d3) Signed-off-by: Sasha Levin --- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c index 1b726489d86a0..827bf487b9539 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c @@ -1549,7 +1549,25 @@ int smu_v11_0_set_azalia_d3_pme(struct smu_context *smu) int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu, enum smu_baco_seq baco_seq) { - return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL); + struct smu_baco_context *smu_baco = &smu->smu_baco; + int ret; + + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL); + if (ret) + return ret; + + /* + * PMFW owns the BACO transition once armed, so keep the driver's view + * in sync. Otherwise smu_v11_0_get_bamaco_support() falls back to the + * live BACO feature bit, which PMFW clears when armed, and the runtime + * resume wrongly concludes BACO is unsupported and skips the exit. + */ + if (baco_seq == BACO_SEQ_BAMACO || baco_seq == BACO_SEQ_BACO) + smu_baco->state = SMU_BACO_STATE_ENTER; + else + smu_baco->state = SMU_BACO_STATE_EXIT; + + return 0; } bool smu_v11_0_baco_is_support(struct smu_context *smu) -- 2.53.0