aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-03-26 22:31:08 -0400
committerDave Airlie <airlied@redhat.com>2014-03-27 22:27:25 -0400
commitc53c6beddc0ebb6feb5d64488c2c0cd23dd7f43d (patch)
treecf467d9de5d6cbc67d3966588595d232dc8c0252
parentadbbdbac04f093c0abf946b1e93e4e5291808491 (diff)
drm/radeon: fix runtime suspend breaking secondary GPUs
Same fix as for nouveau, when we fail with EINVAL, subsequent gets fail hard, causing the device not to open. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 84a1bbb75f91..f633c2782170 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -403,11 +403,15 @@ static int radeon_pmops_runtime_suspend(struct device *dev)
403 struct drm_device *drm_dev = pci_get_drvdata(pdev); 403 struct drm_device *drm_dev = pci_get_drvdata(pdev);
404 int ret; 404 int ret;
405 405
406 if (radeon_runtime_pm == 0) 406 if (radeon_runtime_pm == 0) {
407 return -EINVAL; 407 pm_runtime_forbid(dev);
408 return -EBUSY;
409 }
408 410
409 if (radeon_runtime_pm == -1 && !radeon_is_px()) 411 if (radeon_runtime_pm == -1 && !radeon_is_px()) {
410 return -EINVAL; 412 pm_runtime_forbid(dev);
413 return -EBUSY;
414 }
411 415
412 drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; 416 drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
413 drm_kms_helper_poll_disable(drm_dev); 417 drm_kms_helper_poll_disable(drm_dev);
@@ -456,12 +460,15 @@ static int radeon_pmops_runtime_idle(struct device *dev)
456 struct drm_device *drm_dev = pci_get_drvdata(pdev); 460 struct drm_device *drm_dev = pci_get_drvdata(pdev);
457 struct drm_crtc *crtc; 461 struct drm_crtc *crtc;
458 462
459 if (radeon_runtime_pm == 0) 463 if (radeon_runtime_pm == 0) {
464 pm_runtime_forbid(dev);
460 return -EBUSY; 465 return -EBUSY;
466 }
461 467
462 /* are we PX enabled? */ 468 /* are we PX enabled? */
463 if (radeon_runtime_pm == -1 && !radeon_is_px()) { 469 if (radeon_runtime_pm == -1 && !radeon_is_px()) {
464 DRM_DEBUG_DRIVER("failing to power off - not px\n"); 470 DRM_DEBUG_DRIVER("failing to power off - not px\n");
471 pm_runtime_forbid(dev);
465 return -EBUSY; 472 return -EBUSY;
466 } 473 }
467 474