diff options
| author | Perry Yuan <perry.yuan@amd.com> | 2026-03-10 10:39:08 +0800 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-05-11 15:55:57 -0400 |
| commit | 682142124e3848ec03904bf6bf7063e1cac197c4 (patch) | |
| tree | af7fe21de64c7d952e4a872159a431a5d9aa8aae /drivers/gpu/drm/amd/amdgpu | |
| parent | 599c994c28a8d94875d0a5fa8779fbff390db7d8 (diff) | |
| download | lwn-682142124e3848ec03904bf6bf7063e1cac197c4.tar.gz lwn-682142124e3848ec03904bf6bf7063e1cac197c4.zip | |
drm/amdgpu: fix ptl state isssue after GPU reset or suspend
Fix this by skipping the sysfs disable mapping when the GPU is
currently undergoing a reset or suspend flow.
Additionally, add debug logging in psp_ptl_invoke() to better
trace PTL state and format queries/updates cmd.
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index aec284c6b6d7..d525443e31f6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1289,12 +1289,16 @@ static int psp_ptl_invoke(struct psp_context *psp, u32 req_code, *ptl_state = cmd->resp.uresp.perf_hw_info.ptl_state; *fmt1 = cmd->resp.uresp.perf_hw_info.pref_format1; *fmt2 = cmd->resp.uresp.perf_hw_info.pref_format2; + dev_dbg(psp->adev->dev, "PTL query: state=%d, fmt1=%d, fmt2=%d\n", + *ptl_state, *fmt1, *fmt2); break; case PSP_PTL_PERF_MON_SET: /* Update cached state only on success */ ptl->enabled = *ptl_state; ptl->fmt1 = *fmt1; ptl->fmt2 = *fmt2; + dev_dbg(psp->adev->dev, "PTL set: state=%d, fmt1=%d, fmt2=%d\n", + *ptl_state, *fmt1, *fmt2); break; } diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c index f895c3ef56bc..9f76e1af8a55 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c @@ -2401,7 +2401,7 @@ static int gfx_v9_4_3_perf_monitor_ptl_init(struct amdgpu_device *adev, bool ena ptl->hw_supported = true; atomic_set(&ptl->disable_ref, 0); - if (!enable) { + if (!enable && !amdgpu_in_reset(adev) && !adev->in_suspend) { dev_dbg(adev->dev, "PTL disabled (amdgpu.ptl=%d)\ To enable, set amdgpu.ptl=1 via module param or kernel cmdline\n", |
