Skip to content

Commit 440cec4

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Wait for bootloader after PSPv11 reset
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: 8345a71 ("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 32f7374)
1 parent 8b556dd commit 440cec4

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

drivers/gpu/drm/amd/amdgpu/psp_v11_0.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ static int psp_v11_0_wait_for_bootloader(struct psp_context *psp)
149149
int ret;
150150
int retry_loop;
151151

152-
for (retry_loop = 0; retry_loop < 10; retry_loop++) {
152+
for (retry_loop = 0; retry_loop < 20; retry_loop++) {
153153
/* Wait for bootloader to signify that is
154154
ready having bit 31 of C2PMSG_35 set to 1 */
155155
ret = psp_wait_for(
156156
psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_35),
157-
0x80000000, 0x80000000, PSP_WAITREG_NOVERBOSE);
157+
0x80000000, 0x8000FFFF, PSP_WAITREG_NOVERBOSE);
158158

159159
if (ret == 0)
160160
return 0;
@@ -397,18 +397,6 @@ static int psp_v11_0_mode1_reset(struct psp_context *psp)
397397

398398
msleep(500);
399399

400-
offset = SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_33);
401-
402-
ret = psp_wait_for(psp, offset, MBOX_TOS_RESP_FLAG, MBOX_TOS_RESP_MASK,
403-
0);
404-
405-
if (ret) {
406-
DRM_INFO("psp mode 1 reset failed!\n");
407-
return -EINVAL;
408-
}
409-
410-
DRM_INFO("psp mode1 reset succeed \n");
411-
412400
return 0;
413401
}
414402

@@ -665,7 +653,8 @@ static const struct psp_funcs psp_v11_0_funcs = {
665653
.ring_get_wptr = psp_v11_0_ring_get_wptr,
666654
.ring_set_wptr = psp_v11_0_ring_set_wptr,
667655
.load_usbc_pd_fw = psp_v11_0_load_usbc_pd_fw,
668-
.read_usbc_pd_fw = psp_v11_0_read_usbc_pd_fw
656+
.read_usbc_pd_fw = psp_v11_0_read_usbc_pd_fw,
657+
.wait_for_bootloader = psp_v11_0_wait_for_bootloader
669658
};
670659

671660
void psp_v11_0_set_psp_funcs(struct psp_context *psp)

0 commit comments

Comments
 (0)