Lukas Wunner 19de659cb7 drm/radeon: Don't leak runtime pm ref on driver unload
radeon_driver_load_kms() calls pm_runtime_put_autosuspend() if
radeon_is_px(dev), but radeon_driver_unload_kms() calls
pm_runtime_get_sync() unconditionally. We therefore leak a runtime pm
ref whenever radeon is unloaded on a non-PX machine or if runpm=0. The
GPU will subsequently never runtime suspend after loading radeon again.

Fix by taking the runtime pm ref under the same condition that it was
released on driver load.

Fixes: 10ebc0bc0934 ("drm/radeon: add runtime PM support (v2)")
Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/aaf71106c042126817aeca8b8e54ed468ab61ef7.1465392124.git.lukas@wunner.de
2016-06-24 08:49:27 +02:00
..
2016-03-16 18:08:06 -04:00
2015-05-26 15:09:03 +02:00
2016-03-16 18:08:06 -04:00
2015-10-21 11:35:11 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-05-09 13:49:56 +10:00
2015-12-02 12:45:54 -05:00
2016-05-16 10:25:13 -04:00
2013-09-11 11:44:38 -04:00
2013-09-11 11:44:38 -04:00
2015-12-02 12:45:54 -05:00
2016-03-16 18:08:06 -04:00
2015-05-26 10:31:21 -04:00
2014-03-06 16:46:56 -05:00
2015-10-21 11:35:11 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2015-11-30 14:44:34 -05:00
2016-03-16 18:08:06 -04:00
2016-05-18 19:16:24 +02:00
2016-05-09 13:49:56 +10:00
2015-12-02 12:45:54 -05:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-05-09 13:49:56 +10:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00
2016-03-16 18:08:06 -04:00