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=1796387054; b=e0OGyvGzw7lAfu4OugRfNQj1sIUT6VAJNCbaOEHXTUdE2ZCWhqwJr+0O/KpRvoK3JnWC WtajSNziGuu2w3f9Y9UiIRyUWMgmQr+8O7XXo7wIdDWpw2Jz6Sf5AdiQdQcf5EVIDDAg4 BvTWatTxNAQRDkchjRo/uX3jC0PlZ+V3uCHGbJ2lq9c6sqnPWJroXivmsemKn/LvYINuz Z1A4yA7S7ixgjV46QJtvWGzXnaRqYiYxaUcYXwaJErbCcBrjQX5QbjwGfJiSK+RZBDjnI T+vDyCcBGP7diCdF2DdPQUpSjG730+5GMyrWv6vaO2nThsY79mYBGoXVwAyyWF5uTMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387054; 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=+/r0Orp+pkH1BzEwNQ278oYRJ76NiD+GrpfnA+yolsY=; b=igMPHj2PHlRvwfjemkS3QOIsQ8mktSlSULgub76AbvkKJRAWddzoMsiOmyfqUfjxpUgh iwhLWsC5U6ywXhrmJ0o/MmyTgw9feDeiF48fdID+cLuDdzOQ3tubOMBTXtzieVIP5gWDF JxuaEc91mUgpKX3VTxMY/9Y67kuhpR33wAOeXxkyAmiLL2FljHv7naeCSwQi9BAcbA3Vu 7pZtRPJaMXRzh9LiBbryXI6NsZThV4WFINNk79S2WlOrxHLDELTLeZLMhLgLrWbx5x8Wr fm8L4y84PPcX8CYhFam6VvM9Gs5i5ZN3gkBR4xX+9O28NO1Y0DSzeQQk4xExZmDnglQ== 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=aHcUkopZ; 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 24EBA606A322; Fri, 4 Dec 2026 12:24:14 +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=aHcUkopZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90D171F000C2; Fri, 4 Dec 2026 12:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387054; bh=+/r0Orp+pkH1BzEwNQ278oYRJ76NiD+GrpfnA+yolsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aHcUkopZyDvoMUsfU40GtddW+2xqrsSaxzEZU5X6Zf9LmRWrIhC4GiBBJoexb9Qgc zNMOFjb2ynuJXbKB6SqqkWAu7PEzM4IrGBZeccyLoVvkOYsy26oG3/ZTSF0LhV/xka Kc2YKHinZeSskIRDjmI+5HnJueRJQtcG5E52Z/Tw= 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.1 0115/1059] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Date: Fri, 4 Dec 2026 18:54:06 +0900 Message-ID: <20261204100647.195872454@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-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 6c10140b15ccc..1e998adc7e295 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 @@ -1575,7 +1575,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