Commit 1d8eec8b authored by Dave Airlie's avatar Dave Airlie Committed by Christian König

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: default avatarDave Airlie <airlied@redhat.com>
parent 06a139f7
...@@ -405,11 +405,15 @@ static int radeon_pmops_runtime_suspend(struct device *dev) ...@@ -405,11 +405,15 @@ static int radeon_pmops_runtime_suspend(struct device *dev)
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
int ret; int ret;
if (radeon_runtime_pm == 0) if (radeon_runtime_pm == 0) {
return -EINVAL; pm_runtime_forbid(dev);
return -EBUSY;
}
if (radeon_runtime_pm == -1 && !radeon_is_px()) if (radeon_runtime_pm == -1 && !radeon_is_px()) {
return -EINVAL; pm_runtime_forbid(dev);
return -EBUSY;
}
drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
drm_kms_helper_poll_disable(drm_dev); drm_kms_helper_poll_disable(drm_dev);
...@@ -458,12 +462,15 @@ static int radeon_pmops_runtime_idle(struct device *dev) ...@@ -458,12 +462,15 @@ static int radeon_pmops_runtime_idle(struct device *dev)
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
if (radeon_runtime_pm == 0) if (radeon_runtime_pm == 0) {
pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
}
/* are we PX enabled? */ /* are we PX enabled? */
if (radeon_runtime_pm == -1 && !radeon_is_px()) { if (radeon_runtime_pm == -1 && !radeon_is_px()) {
DRM_DEBUG_DRIVER("failing to power off - not px\n"); DRM_DEBUG_DRIVER("failing to power off - not px\n");
pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment