aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-03-27 00:09:18 -0400
committerChristian König <christian.koenig@amd.com>2014-04-03 06:35:41 -0400
commit1d8eec8ba4a38fcee9d30e4fb5b3d67a9bff9db3 (patch)
tree158b103ad2f7e5e5026eb4a4619545963450cea1 /drivers/gpu/drm/radeon
parent06a139f7a0885fa2c84962300edd181821ddc2c9 (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>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-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 e8b0284e34bb..d0eba48dd74e 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -405,11 +405,15 @@ static int radeon_pmops_runtime_suspend(struct device *dev)
405 struct drm_device *drm_dev = pci_get_drvdata(pdev); 405 struct drm_device *drm_dev = pci_get_drvdata(pdev);
406 int ret; 406 int ret;
407 407
408 if (radeon_runtime_pm == 0) 408 if (radeon_runtime_pm == 0) {
409 return -EINVAL; 409 pm_runtime_forbid(dev);
410 return -EBUSY;
411 }
410 412
411 if (radeon_runtime_pm == -1 && !radeon_is_px()) 413 if (radeon_runtime_pm == -1 && !radeon_is_px()) {
412 return -EINVAL; 414 pm_runtime_forbid(dev);
415 return -EBUSY;
416 }
413 417
414 drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; 418 drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
415 drm_kms_helper_poll_disable(drm_dev); 419 drm_kms_helper_poll_disable(drm_dev);
@@ -458,12 +462,15 @@ static int radeon_pmops_runtime_idle(struct device *dev)
458 struct drm_device *drm_dev = pci_get_drvdata(pdev); 462 struct drm_device *drm_dev = pci_get_drvdata(pdev);
459 struct drm_crtc *crtc; 463 struct drm_crtc *crtc;
460 464
461 if (radeon_runtime_pm == 0) 465 if (radeon_runtime_pm == 0) {
466 pm_runtime_forbid(dev);
462 return -EBUSY; 467 return -EBUSY;
468 }
463 469
464 /* are we PX enabled? */ 470 /* are we PX enabled? */
465 if (radeon_runtime_pm == -1 && !radeon_is_px()) { 471 if (radeon_runtime_pm == -1 && !radeon_is_px()) {
466 DRM_DEBUG_DRIVER("failing to power off - not px\n"); 472 DRM_DEBUG_DRIVER("failing to power off - not px\n");
473 pm_runtime_forbid(dev);
467 return -EBUSY; 474 return -EBUSY;
468 } 475 }
469 476