diff options
| author | Yang Wang <kevinyang.wang@amd.com> | 2026-01-27 11:07:07 +0800 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-01-27 18:11:27 -0500 |
| commit | 7a3fbdfd19ec5992c0fc2d0bd83888644f5f2f38 (patch) | |
| tree | 91c5a96b543b9d89ce71b479d0b6662e93a9d60c /include/uapi/linux/const.h | |
| parent | 37e6349e9328feb600568144411c18e3c35e3077 (diff) | |
drm/amd/pm: fix race in power state check before mutex lock
The power state check in amdgpu_dpm_set_powergating_by_smu() is done
before acquiring the pm mutex, leading to a race condition where:
1. Thread A checks state and thinks no change is needed
2. Thread B acquires mutex and modifies the state
3. Thread A returns without updating state, causing inconsistency
Fix this by moving the mutex lock before the power state check,
ensuring atomicity of the state check and modification.
Fixes: 6ee27ee27ba8 ("drm/amd/pm: avoid duplicate powergate/ungate setting")
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/uapi/linux/const.h')
0 files changed, 0 insertions, 0 deletions
