Skip to content

Commit 4c1a0fc

Browse files
Thomas Zimmermannalexdeucher
authored andcommitted
drm/radeon: Do not hold console lock during resume
The function radeon_resume_kms() acquires the console lock. It is inconsistent, as it depends on the notify_client argument. That lock then covers a number of suspend operations that are unrelated to the console. Remove the calls to console_lock() and console_unlock() from the radeon function. The console lock is only required by DRM's fbdev emulation, which acquires it as necessary. Also fixes a possible circular dependency between the console lock and the client-list mutex, where the mutex is supposed to be taken first. Signed-off-by: Thomas Zimmermann <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit fff8e05)
1 parent 5dd0b96 commit 4c1a0fc

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

drivers/gpu/drm/radeon/radeon_device.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
* Jerome Glisse
2727
*/
2828

29-
#include <linux/console.h>
3029
#include <linux/efi.h>
3130
#include <linux/pci.h>
3231
#include <linux/pm_runtime.h>
@@ -1659,17 +1658,11 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool notify_clients)
16591658
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
16601659
return 0;
16611660

1662-
if (notify_clients) {
1663-
console_lock();
1664-
}
16651661
if (resume) {
16661662
pci_set_power_state(pdev, PCI_D0);
16671663
pci_restore_state(pdev);
1668-
if (pci_enable_device(pdev)) {
1669-
if (notify_clients)
1670-
console_unlock();
1664+
if (pci_enable_device(pdev))
16711665
return -1;
1672-
}
16731666
}
16741667
/* resume AGP if in use */
16751668
radeon_agp_resume(rdev);
@@ -1745,10 +1738,8 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool notify_clients)
17451738
if ((rdev->pm.pm_method == PM_METHOD_DPM) && rdev->pm.dpm_enabled)
17461739
radeon_pm_compute_clocks(rdev);
17471740

1748-
if (notify_clients) {
1749-
drm_client_dev_resume(dev, true);
1750-
console_unlock();
1751-
}
1741+
if (notify_clients)
1742+
drm_client_dev_resume(dev, false);
17521743

17531744
return 0;
17541745
}

0 commit comments

Comments
 (0)