Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+12 -5
+12 -5
drivers/gpu/drm/radeon/radeon_drv.c
··· 403 403 struct drm_device *drm_dev = pci_get_drvdata(pdev); 404 404 int ret; 405 405 406 - if (radeon_runtime_pm == 0) 407 - return -EINVAL; 406 + if (radeon_runtime_pm == 0) { 407 + pm_runtime_forbid(dev); 408 + return -EBUSY; 409 + } 408 410 409 - if (radeon_runtime_pm == -1 && !radeon_is_px()) 410 - return -EINVAL; 411 + if (radeon_runtime_pm == -1 && !radeon_is_px()) { 412 + pm_runtime_forbid(dev); 413 + return -EBUSY; 414 + } 411 415 412 416 drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; 413 417 drm_kms_helper_poll_disable(drm_dev); ··· 460 456 struct drm_device *drm_dev = pci_get_drvdata(pdev); 461 457 struct drm_crtc *crtc; 462 458 463 - if (radeon_runtime_pm == 0) 459 + if (radeon_runtime_pm == 0) { 460 + pm_runtime_forbid(dev); 464 461 return -EBUSY; 462 + } 465 463 466 464 /* are we PX enabled? */ 467 465 if (radeon_runtime_pm == -1 && !radeon_is_px()) { 468 466 DRM_DEBUG_DRIVER("failing to power off - not px\n"); 467 + pm_runtime_forbid(dev); 469 468 return -EBUSY; 470 469 } 471 470