diff options
| author | Jiaming Fan <fan.jiaming@hotmail.com> | 2026-11-10 15:14:59 +0000 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-11-18 01:45:20 -0500 |
| commit | 53fc1be11892a8e695937fdbc24db2699d23dabf (patch) | |
| tree | d059a2916cfacd9bb19647342674bb19605469be /tools/perf/scripts/python | |
| parent | 24916f2c98f86c90db617d0e828d930d7a35577e (diff) | |
drm/amdgpu: only unregister the ATPX handler if we registered it
amdgpu_register_atpx_handler() registers the ATPX handler with
vga_switcheroo only when ATPX is detected, and ignores the result:
vga_switcheroo has a single handler slot and refuses a second handler
with -EINVAL. amdgpu_unregister_atpx_handler() calls
vga_switcheroo_unregister_handler() in either case, and that clears the
slot no matter who set it.
So unloading amdgpu removes a handler registered by another driver, such
as apple-gmux. No AMD GPU is needed for this; loading and unloading
amdgpu is enough. Afterwards vga_switcheroo can no longer switch outputs,
and a client that uses the vga_switcheroo runtime PM domain, such as
nouveau on a non-Optimus machine with a v1 DSM, can dereference the now
NULL handler during runtime suspend.
Record whether the registration succeeded and unregister only in that
case.
Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiaming Fan <fan.jiaming@hotmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit fbb6ebeff9d5327e8d06a83a3f7daa88422c9127)
Cc: stable@vger.kernel.org
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
