drm/radeon: Fix usage of pci_save_state() and pci_restore_state()

Calling those functions with the drmn device as argument causes a panic,
because it's not a direct child of pci$N. They must be called with the
vgapci device instead.

This fix is not enough to make suspend/resume work reliably.

Approved by:	re (blanket)
This commit is contained in:
Jean-Sébastien Pédron 2013-09-14 17:24:41 +00:00
parent f4bb978a66
commit 02969dd063
4 changed files with 8 additions and 8 deletions

View File

@ -2647,7 +2647,7 @@ int r100_asic_reset(struct radeon_device *rdev)
WREG32(RADEON_CP_RB_WPTR, 0);
WREG32(RADEON_CP_RB_CNTL, tmp);
/* save PCI state */
pci_save_state(rdev->dev);
pci_save_state(device_get_parent(rdev->dev));
/* disable bus mastering */
r100_bm_disable(rdev);
WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_SE(1) |
@ -2669,7 +2669,7 @@ int r100_asic_reset(struct radeon_device *rdev)
status = RREG32(R_000E40_RBBM_STATUS);
dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
/* restore PCI & busmastering */
pci_restore_state(rdev->dev);
pci_restore_state(device_get_parent(rdev->dev));
r100_enable_bm(rdev);
/* Check if GPU is idle */
if (G_000E40_SE_BUSY(status) || G_000E40_RE_BUSY(status) ||

View File

@ -401,7 +401,7 @@ int r300_asic_reset(struct radeon_device *rdev)
WREG32(RADEON_CP_RB_WPTR, 0);
WREG32(RADEON_CP_RB_CNTL, tmp);
/* save PCI state */
pci_save_state(rdev->dev);
pci_save_state(device_get_parent(rdev->dev));
/* disable bus mastering */
r100_bm_disable(rdev);
WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_VAP(1) |
@ -425,7 +425,7 @@ int r300_asic_reset(struct radeon_device *rdev)
status = RREG32(R_000E40_RBBM_STATUS);
dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
/* restore PCI & busmastering */
pci_restore_state(rdev->dev);
pci_restore_state(device_get_parent(rdev->dev));
r100_enable_bm(rdev);
/* Check if GPU is idle */
if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) {

View File

@ -1316,7 +1316,7 @@ int radeon_suspend_kms(struct drm_device *dev)
radeon_agp_suspend(rdev);
pci_save_state(dev->device);
pci_save_state(device_get_parent(rdev->dev));
#ifdef DUMBBELL_WIP
if (state.event == PM_EVENT_SUSPEND) {
/* Shut down the device */
@ -1356,7 +1356,7 @@ int radeon_resume_kms(struct drm_device *dev)
console_lock();
#endif /* DUMBBELL_WIP */
pci_set_powerstate(dev->device, PCI_POWERSTATE_D0);
pci_restore_state(dev->device);
pci_restore_state(device_get_parent(rdev->dev));
#ifdef DUMBBELL_WIP
if (pci_enable_device(dev->pdev)) {
console_unlock();

View File

@ -373,7 +373,7 @@ int rs600_asic_reset(struct radeon_device *rdev)
WREG32(RADEON_CP_RB_RPTR_WR, 0);
WREG32(RADEON_CP_RB_WPTR, 0);
WREG32(RADEON_CP_RB_CNTL, tmp);
pci_save_state(rdev->dev);
pci_save_state(device_get_parent(rdev->dev));
/* disable bus mastering */
pci_disable_busmaster(rdev->dev);
DRM_MDELAY(1);
@ -403,7 +403,7 @@ int rs600_asic_reset(struct radeon_device *rdev)
status = RREG32(R_000E40_RBBM_STATUS);
dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
/* restore PCI & busmastering */
pci_restore_state(rdev->dev);
pci_restore_state(device_get_parent(rdev->dev));
/* Check if GPU is idle */
if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) {
dev_err(rdev->dev, "failed to reset GPU\n");