radeon_suspend_kms: don't mess with pci state that's managed by the bus

The pci bus driver handles the power state, it also manages
configuration state saving and restoring for its child devices.  Thus a
PCI device driver does not have to worry about those things.  In fact, I
observe a hard system hang when trying to suspend a system with active
radeonkms driver where both the bus driver and radeonkms driver try to
do the same thing.  I suspect that it could be because of an access to a
PCI configuration register after the device is placed into D3 state.

Reviewed by:	dumbbell, jhb
MFC after:	13 days
Differential Revision:	https://reviews.freebsd.org/D3561
This commit is contained in:
Andriy Gapon 2015-09-11 15:51:20 +00:00
parent 572846e089
commit 8f875df090
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287673

View File

@ -1342,14 +1342,10 @@ int radeon_suspend_kms(struct drm_device *dev)
radeon_agp_suspend(rdev);
pci_save_state(device_get_parent(dev->dev));
#ifdef FREEBSD_WIP
if (state.event == PM_EVENT_SUSPEND) {
/* Shut down the device */
pci_disable_device(dev->pdev);
#endif /* FREEBSD_WIP */
pci_set_powerstate(dev->dev, PCI_POWERSTATE_D3);
#ifdef FREEBSD_WIP
}
console_lock();
#endif /* FREEBSD_WIP */
@ -1380,10 +1376,6 @@ int radeon_resume_kms(struct drm_device *dev)
#ifdef FREEBSD_WIP
console_lock();
#endif /* FREEBSD_WIP */
pci_set_powerstate(device_get_parent(dev->dev), PCI_POWERSTATE_D0);
pci_restore_state(device_get_parent(dev->dev));
#ifdef FREEBSD_WIP
if (pci_enable_device(dev->pdev)) {
console_unlock();
return -1;