drm/amdgpu: only set PTL SYSFS disable bit when PTL is disabled

Only set the bit when PTL is actually being disabled (state=0)

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>
This commit is contained in:
Perry Yuan 2026-03-03 16:42:45 +08:00 committed by Alex Deucher
parent d2b8d178e9
commit 3311f0db4d

View File

@ -2392,7 +2392,7 @@ static int gfx_v9_4_3_perf_monitor_ptl_init(struct amdgpu_device *adev, bool ena
fmt2 = ptl->fmt2;
}
/* initialize PTL with default formats: GFX_FTYPE_I8 & GFX_FTYPE_BF16 */
/* initialize PTL with default formats: GFX_FTYPE_VECTOR & GFX_FTYPE_F8 */
r = amdgpu_ptl_perf_monitor_ctrl(adev, PSP_PTL_PERF_MON_SET, &ptl_state,
&fmt1, &fmt2);
if (r)
@ -2401,6 +2401,13 @@ 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) {
dev_dbg(adev->dev,
"PTL disabled (amdgpu.ptl=%d)\
To enable, set amdgpu.ptl=1 via module param or kernel cmdline\n",
amdgpu_ptl);
set_bit(AMDGPU_PTL_DISABLE_SYSFS, ptl->disable_bitmap);
}
return 0;
}