* Please backport commit 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader after PSPv11 reset") to v6.16.y
@ 2025-09-14 11:18 Salvatore Bonaccorso
2025-09-14 11:43 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Salvatore Bonaccorso @ 2025-09-14 11:18 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, Sasha Levin, Lijo Lazar, Alex Deucher,
Marcel Jira, Niklas Cathor, 1114806bugs
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
Hi
In Debian we got the report in https://bugs.debian.org/1114806 that
suspend to RAM fails (amdgpu driver hang) and Niklas Cathor was both
able to bisect the issue down to 8345a71fc54b ("drm/amdgpu: Add more
checks to PSP mailbox") (which was backported to 6.12.2 as well).
There is an upstream report as well at
https://gitlab.freedesktop.org/drm/amd/-/issues/4531 matching the
issue and fixed by 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader
after PSPv11 reset").
Unfortunately the commit does not apply cleanly to 6.16.y as well as
there were the changes around 9888f73679b7 ("drm/amdgpu: Add a
noverbose flag to psp_wait_for").
Attached patch backports the commit due to this context changes,
assuming it is not desirable to pick as well 9888f73679b7.
Does that looks good? If yes, can you please consider picking it up or
the next 6.16.y stable series as well?
Regards,
Salvatore
[-- Attachment #2: 0001-drm-amdgpu-Wait-for-bootloader-after-PSPv11-reset.patch --]
[-- Type: text/x-diff, Size: 2826 bytes --]
From 6e2bbc123bf09d2f98008722c61d3907f54a0611 Mon Sep 17 00:00:00 2001
From: Lijo Lazar <lijo.lazar@amd.com>
Date: Fri, 18 Jul 2025 18:50:58 +0530
Subject: [PATCH] drm/amdgpu: Wait for bootloader after PSPv11 reset
Commit 440cec4ca1c242d72e309a801995584a55af25c6 upstream.
Some PSPv11 SOCs take a longer time for PSP based mode-1 reset. Instead
of checking for C2PMSG_33 status, add the callback wait_for_bootloader.
Wait for bootloader to be back to steady state is already part of the
generic mode-1 reset flow. Increase the retry count for bootloader wait
and also fix the mask to prevent fake pass.
Fixes: 8345a71fc54b ("drm/amdgpu: Add more checks to PSP mailbox")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4531
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 32f73741d6ee41fd5db8791c1163931e313d0fdc)
[Salvatore Bonaccorso: Backport for v6.16: Context changes for code
before 9888f73679b7 ("drm/amdgpu: Add a noverbose flag to psp_wait_for")]
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
---
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 1a4a26e6ffd2..4cd37fe96c6e 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -149,13 +149,13 @@ static int psp_v11_0_wait_for_bootloader(struct psp_context *psp)
int ret;
int retry_loop;
- for (retry_loop = 0; retry_loop < 10; retry_loop++) {
+ for (retry_loop = 0; retry_loop < 20; retry_loop++) {
/* Wait for bootloader to signify that is
ready having bit 31 of C2PMSG_35 set to 1 */
ret = psp_wait_for(psp,
SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_35),
0x80000000,
- 0x80000000,
+ 0x8000FFFF,
false);
if (ret == 0)
@@ -399,18 +399,6 @@ static int psp_v11_0_mode1_reset(struct psp_context *psp)
msleep(500);
- offset = SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_33);
-
- ret = psp_wait_for(psp, offset, MBOX_TOS_RESP_FLAG, MBOX_TOS_RESP_MASK,
- false);
-
- if (ret) {
- DRM_INFO("psp mode 1 reset failed!\n");
- return -EINVAL;
- }
-
- DRM_INFO("psp mode1 reset succeed \n");
-
return 0;
}
@@ -666,7 +654,8 @@ static const struct psp_funcs psp_v11_0_funcs = {
.ring_get_wptr = psp_v11_0_ring_get_wptr,
.ring_set_wptr = psp_v11_0_ring_set_wptr,
.load_usbc_pd_fw = psp_v11_0_load_usbc_pd_fw,
- .read_usbc_pd_fw = psp_v11_0_read_usbc_pd_fw
+ .read_usbc_pd_fw = psp_v11_0_read_usbc_pd_fw,
+ .wait_for_bootloader = psp_v11_0_wait_for_bootloader
};
void psp_v11_0_set_psp_funcs(struct psp_context *psp)
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: Please backport commit 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader after PSPv11 reset") to v6.16.y
2025-09-14 11:18 Please backport commit 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader after PSPv11 reset") to v6.16.y Salvatore Bonaccorso
@ 2025-09-14 11:43 ` Greg Kroah-Hartman
2025-09-14 12:00 ` Salvatore Bonaccorso
2025-09-14 14:48 ` Niklas Cathor
0 siblings, 2 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2025-09-14 11:43 UTC (permalink / raw)
To: Salvatore Bonaccorso
Cc: stable, Sasha Levin, Lijo Lazar, Alex Deucher, Marcel Jira,
Niklas Cathor, 1114806bugs
On Sun, Sep 14, 2025 at 01:18:11PM +0200, Salvatore Bonaccorso wrote:
> Hi
>
> In Debian we got the report in https://bugs.debian.org/1114806 that
> suspend to RAM fails (amdgpu driver hang) and Niklas Cathor was both
> able to bisect the issue down to 8345a71fc54b ("drm/amdgpu: Add more
> checks to PSP mailbox") (which was backported to 6.12.2 as well).
>
> There is an upstream report as well at
> https://gitlab.freedesktop.org/drm/amd/-/issues/4531 matching the
> issue and fixed by 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader
> after PSPv11 reset").
>
> Unfortunately the commit does not apply cleanly to 6.16.y as well as
> there were the changes around 9888f73679b7 ("drm/amdgpu: Add a
> noverbose flag to psp_wait_for").
>
> Attached patch backports the commit due to this context changes,
> assuming it is not desirable to pick as well 9888f73679b7.
>
> Does that looks good? If yes, can you please consider picking it up or
> the next 6.16.y stable series as well?
I have a revert of the offending commit in the 6.16.y queue right now,
as this was pointed out as causing a problem:
https://lore.kernel.org/all/20250904220457.473940-1-alexander.deucher@amd.com/
so that should resolve this issue, right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Please backport commit 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader after PSPv11 reset") to v6.16.y
2025-09-14 11:43 ` Greg Kroah-Hartman
@ 2025-09-14 12:00 ` Salvatore Bonaccorso
2025-09-14 14:48 ` Niklas Cathor
1 sibling, 0 replies; 4+ messages in thread
From: Salvatore Bonaccorso @ 2025-09-14 12:00 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, Sasha Levin, Lijo Lazar, Alex Deucher, Marcel Jira,
Niklas Cathor, 1114806
Hi Greg,
[note fixing up my typo for the Debian bug, sorry about that]
On Sun, Sep 14, 2025 at 01:43:38PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Sep 14, 2025 at 01:18:11PM +0200, Salvatore Bonaccorso wrote:
> > Hi
> >
> > In Debian we got the report in https://bugs.debian.org/1114806 that
> > suspend to RAM fails (amdgpu driver hang) and Niklas Cathor was both
> > able to bisect the issue down to 8345a71fc54b ("drm/amdgpu: Add more
> > checks to PSP mailbox") (which was backported to 6.12.2 as well).
> >
> > There is an upstream report as well at
> > https://gitlab.freedesktop.org/drm/amd/-/issues/4531 matching the
> > issue and fixed by 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader
> > after PSPv11 reset").
> >
> > Unfortunately the commit does not apply cleanly to 6.16.y as well as
> > there were the changes around 9888f73679b7 ("drm/amdgpu: Add a
> > noverbose flag to psp_wait_for").
> >
> > Attached patch backports the commit due to this context changes,
> > assuming it is not desirable to pick as well 9888f73679b7.
> >
> > Does that looks good? If yes, can you please consider picking it up or
> > the next 6.16.y stable series as well?
>
> I have a revert of the offending commit in the 6.16.y queue right now,
> as this was pointed out as causing a problem:
> https://lore.kernel.org/all/20250904220457.473940-1-alexander.deucher@amd.com/
> so that should resolve this issue, right?
Ah good, yes that should be equally fine (I missed the pending
revert). Thanks a lot!
Regards,
Salvatore
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Please backport commit 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader after PSPv11 reset") to v6.16.y
2025-09-14 11:43 ` Greg Kroah-Hartman
2025-09-14 12:00 ` Salvatore Bonaccorso
@ 2025-09-14 14:48 ` Niklas Cathor
1 sibling, 0 replies; 4+ messages in thread
From: Niklas Cathor @ 2025-09-14 14:48 UTC (permalink / raw)
To: Greg Kroah-Hartman, Salvatore Bonaccorso
Cc: stable, Sasha Levin, Lijo Lazar, Alex Deucher, Marcel Jira,
1114806bugs
Hi Greg,
On 9/14/25 1:43 PM, Greg Kroah-Hartman wrote:
> On Sun, Sep 14, 2025 at 01:18:11PM +0200, Salvatore Bonaccorso wrote:
>> Hi
>>
>> In Debian we got the report in https://bugs.debian.org/1114806 that
>> suspend to RAM fails (amdgpu driver hang) and Niklas Cathor was both
>> able to bisect the issue down to 8345a71fc54b ("drm/amdgpu: Add more
>> checks to PSP mailbox") (which was backported to 6.12.2 as well).
>>
>> There is an upstream report as well at
>> https://gitlab.freedesktop.org/drm/amd/-/issues/4531 matching the
>> issue and fixed by 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader
>> after PSPv11 reset").
>>
>> Unfortunately the commit does not apply cleanly to 6.16.y as well as
>> there were the changes around 9888f73679b7 ("drm/amdgpu: Add a
>> noverbose flag to psp_wait_for").
>>
>> Attached patch backports the commit due to this context changes,
>> assuming it is not desirable to pick as well 9888f73679b7.
>>
>> Does that looks good? If yes, can you please consider picking it up or
>> the next 6.16.y stable series as well?
> I have a revert of the offending commit in the 6.16.y queue right now,
> as this was pointed out as causing a problem:
> https://lore.kernel.org/all/20250904220457.473940-1-alexander.deucher@amd.com/
> so that should resolve this issue, right?
Yes, I can confirm that applying that revert to 6.16.y solves the issue
on my machine as well.
cheers,
Niklas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-14 14:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-14 11:18 Please backport commit 440cec4ca1c2 ("drm/amdgpu: Wait for bootloader after PSPv11 reset") to v6.16.y Salvatore Bonaccorso
2025-09-14 11:43 ` Greg Kroah-Hartman
2025-09-14 12:00 ` Salvatore Bonaccorso
2025-09-14 14:48 ` Niklas Cathor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox