Fix runtime pm ref leaks

Submitted by Lukas Wunner on May 24, 2016, 4:03 p.m.

Details

Reviewer None
Submitted May 24, 2016, 4:03 p.m.
Last Updated May 24, 2016, 4:14 p.m.
Revision

Cover Letter(s)

Revision 1
      In preparation for runtime pm on muxed dual GPU laptops,
I've fixed all runtime pm ref leaks I could find in nouveau,
radeon and amdgpu.

To ease reviewing, I've pushed this series to GitHub:
https://github.com/l1k/linux/commits/drm_runpm_fixes_v1

@Alex Deucher: I do not have an AMD GPU so couldn't test this
beyond verifying that it compiles. Please double-check the patches
and test them internally at AMD. By the way, I've noticed that
nouveau takes a runtime pm ref in ->preclose and releases it in
->postclose. This is missing in radeon and amdgpu. Please check
if it is needed.

Thanks,

Lukas

Lukas Wunner (9):
  drm/nouveau: Don't leak runtime pm ref on driver unload
  drm/nouveau: Forbid runtime pm on driver unload
  drm/radeon: Don't leak runtime pm ref on driver unload
  drm/radeon: Don't leak runtime pm ref on driver load
  drm/radeon: Forbid runtime pm on driver unload
  drm/amdgpu: Don't leak runtime pm ref on driver unload
  drm/amdgpu: Don't leak runtime pm ref on driver load
  drm/amdgpu: Forbid runtime pm on driver unload
  drm: Turn off crtc before tearing down its data structure

 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 12 +++++++++---
 drivers/gpu/drm/drm_crtc.c              | 13 ++++++++++++-
 drivers/gpu/drm/nouveau/nouveau_drm.c   |  6 +++++-
 drivers/gpu/drm/radeon/radeon_device.c  |  4 ++++
 drivers/gpu/drm/radeon/radeon_kms.c     |  5 ++++-
 5 files changed, 34 insertions(+), 6 deletions(-)
    

Revisions