Commit 655efd3d authored by Jerome Glisse's avatar Jerome Glisse Committed by Dave Airlie

drm/radeon/kms: don't call suspend path before cleaning up GPU

In suspend path we unmap the GART table while in cleaning up
path we will unbind buffer and thus try to write to unmapped
GART leading to oops. In order to avoid this we don't call the
suspend path in cleanup path. Cleanup path is clever enough
to desactive GPU like the suspend path is doing, thus this was
redondant.

Tested on: RV370, R420, RV515, RV570, RV610, RV770 (all PCIE)
Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 94cf6434
...@@ -3375,7 +3375,6 @@ int r100_suspend(struct radeon_device *rdev) ...@@ -3375,7 +3375,6 @@ int r100_suspend(struct radeon_device *rdev)
void r100_fini(struct radeon_device *rdev) void r100_fini(struct radeon_device *rdev)
{ {
r100_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
...@@ -3487,13 +3486,12 @@ int r100_init(struct radeon_device *rdev) ...@@ -3487,13 +3486,12 @@ int r100_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
r100_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
radeon_irq_kms_fini(rdev);
if (rdev->flags & RADEON_IS_PCI) if (rdev->flags & RADEON_IS_PCI)
r100_pci_gart_fini(rdev); r100_pci_gart_fini(rdev);
radeon_irq_kms_fini(rdev);
rdev->accel_working = false; rdev->accel_working = false;
} }
return 0; return 0;
......
...@@ -1327,7 +1327,6 @@ int r300_suspend(struct radeon_device *rdev) ...@@ -1327,7 +1327,6 @@ int r300_suspend(struct radeon_device *rdev)
void r300_fini(struct radeon_device *rdev) void r300_fini(struct radeon_device *rdev)
{ {
r300_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
...@@ -1418,15 +1417,15 @@ int r300_init(struct radeon_device *rdev) ...@@ -1418,15 +1417,15 @@ int r300_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
r300_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
radeon_irq_kms_fini(rdev);
if (rdev->flags & RADEON_IS_PCIE) if (rdev->flags & RADEON_IS_PCIE)
rv370_pcie_gart_fini(rdev); rv370_pcie_gart_fini(rdev);
if (rdev->flags & RADEON_IS_PCI) if (rdev->flags & RADEON_IS_PCI)
r100_pci_gart_fini(rdev); r100_pci_gart_fini(rdev);
radeon_irq_kms_fini(rdev); radeon_agp_fini(rdev);
rdev->accel_working = false; rdev->accel_working = false;
} }
return 0; return 0;
......
...@@ -389,16 +389,15 @@ int r420_init(struct radeon_device *rdev) ...@@ -389,16 +389,15 @@ int r420_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
r420_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
radeon_irq_kms_fini(rdev);
if (rdev->flags & RADEON_IS_PCIE) if (rdev->flags & RADEON_IS_PCIE)
rv370_pcie_gart_fini(rdev); rv370_pcie_gart_fini(rdev);
if (rdev->flags & RADEON_IS_PCI) if (rdev->flags & RADEON_IS_PCI)
r100_pci_gart_fini(rdev); r100_pci_gart_fini(rdev);
radeon_agp_fini(rdev); radeon_agp_fini(rdev);
radeon_irq_kms_fini(rdev);
rdev->accel_working = false; rdev->accel_working = false;
} }
return 0; return 0;
......
...@@ -294,13 +294,12 @@ int r520_init(struct radeon_device *rdev) ...@@ -294,13 +294,12 @@ int r520_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
rv515_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
radeon_irq_kms_fini(rdev);
rv370_pcie_gart_fini(rdev); rv370_pcie_gart_fini(rdev);
radeon_agp_fini(rdev); radeon_agp_fini(rdev);
radeon_irq_kms_fini(rdev);
rdev->accel_working = false; rdev->accel_working = false;
} }
return 0; return 0;
......
...@@ -1654,6 +1654,12 @@ void r600_ring_init(struct radeon_device *rdev, unsigned ring_size) ...@@ -1654,6 +1654,12 @@ void r600_ring_init(struct radeon_device *rdev, unsigned ring_size)
rdev->cp.align_mask = 16 - 1; rdev->cp.align_mask = 16 - 1;
} }
void r600_cp_fini(struct radeon_device *rdev)
{
r600_cp_stop(rdev);
radeon_ring_fini(rdev);
}
/* /*
* GPU scratch registers helpers function. * GPU scratch registers helpers function.
...@@ -2055,9 +2061,11 @@ int r600_init(struct radeon_device *rdev) ...@@ -2055,9 +2061,11 @@ int r600_init(struct radeon_device *rdev)
rdev->accel_working = true; rdev->accel_working = true;
r = r600_startup(rdev); r = r600_startup(rdev);
if (r) { if (r) {
r600_suspend(rdev); dev_err(rdev->dev, "disabling GPU acceleration\n");
r600_cp_fini(rdev);
r600_wb_fini(rdev); r600_wb_fini(rdev);
radeon_ring_fini(rdev); r600_irq_fini(rdev);
radeon_irq_kms_fini(rdev);
r600_pcie_gart_fini(rdev); r600_pcie_gart_fini(rdev);
rdev->accel_working = false; rdev->accel_working = false;
} }
...@@ -2083,20 +2091,17 @@ int r600_init(struct radeon_device *rdev) ...@@ -2083,20 +2091,17 @@ int r600_init(struct radeon_device *rdev)
void r600_fini(struct radeon_device *rdev) void r600_fini(struct radeon_device *rdev)
{ {
/* Suspend operations */
r600_suspend(rdev);
r600_audio_fini(rdev); r600_audio_fini(rdev);
r600_blit_fini(rdev); r600_blit_fini(rdev);
r600_cp_fini(rdev);
r600_wb_fini(rdev);
r600_irq_fini(rdev); r600_irq_fini(rdev);
radeon_irq_kms_fini(rdev); radeon_irq_kms_fini(rdev);
radeon_ring_fini(rdev);
r600_wb_fini(rdev);
r600_pcie_gart_fini(rdev); r600_pcie_gart_fini(rdev);
radeon_agp_fini(rdev);
radeon_gem_fini(rdev); radeon_gem_fini(rdev);
radeon_fence_driver_fini(rdev); radeon_fence_driver_fini(rdev);
radeon_clocks_fini(rdev); radeon_clocks_fini(rdev);
radeon_agp_fini(rdev);
radeon_bo_fini(rdev); radeon_bo_fini(rdev);
radeon_atombios_fini(rdev); radeon_atombios_fini(rdev);
kfree(rdev->bios); kfree(rdev->bios);
......
...@@ -1150,6 +1150,7 @@ extern bool r600_card_posted(struct radeon_device *rdev); ...@@ -1150,6 +1150,7 @@ extern bool r600_card_posted(struct radeon_device *rdev);
extern void r600_cp_stop(struct radeon_device *rdev); extern void r600_cp_stop(struct radeon_device *rdev);
extern void r600_ring_init(struct radeon_device *rdev, unsigned ring_size); extern void r600_ring_init(struct radeon_device *rdev, unsigned ring_size);
extern int r600_cp_resume(struct radeon_device *rdev); extern int r600_cp_resume(struct radeon_device *rdev);
extern void r600_cp_fini(struct radeon_device *rdev);
extern int r600_count_pipe_bits(uint32_t val); extern int r600_count_pipe_bits(uint32_t val);
extern int r600_gart_clear_page(struct radeon_device *rdev, int i); extern int r600_gart_clear_page(struct radeon_device *rdev, int i);
extern int r600_mc_wait_for_idle(struct radeon_device *rdev); extern int r600_mc_wait_for_idle(struct radeon_device *rdev);
......
...@@ -448,7 +448,6 @@ int rs400_suspend(struct radeon_device *rdev) ...@@ -448,7 +448,6 @@ int rs400_suspend(struct radeon_device *rdev)
void rs400_fini(struct radeon_device *rdev) void rs400_fini(struct radeon_device *rdev)
{ {
rs400_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
...@@ -527,7 +526,6 @@ int rs400_init(struct radeon_device *rdev) ...@@ -527,7 +526,6 @@ int rs400_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
rs400_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
......
...@@ -610,7 +610,6 @@ int rs600_suspend(struct radeon_device *rdev) ...@@ -610,7 +610,6 @@ int rs600_suspend(struct radeon_device *rdev)
void rs600_fini(struct radeon_device *rdev) void rs600_fini(struct radeon_device *rdev)
{ {
rs600_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
...@@ -689,7 +688,6 @@ int rs600_init(struct radeon_device *rdev) ...@@ -689,7 +688,6 @@ int rs600_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
rs600_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
......
...@@ -676,7 +676,6 @@ int rs690_suspend(struct radeon_device *rdev) ...@@ -676,7 +676,6 @@ int rs690_suspend(struct radeon_device *rdev)
void rs690_fini(struct radeon_device *rdev) void rs690_fini(struct radeon_device *rdev)
{ {
rs690_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
...@@ -756,7 +755,6 @@ int rs690_init(struct radeon_device *rdev) ...@@ -756,7 +755,6 @@ int rs690_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
rs690_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
......
...@@ -537,7 +537,6 @@ void rv515_set_safe_registers(struct radeon_device *rdev) ...@@ -537,7 +537,6 @@ void rv515_set_safe_registers(struct radeon_device *rdev)
void rv515_fini(struct radeon_device *rdev) void rv515_fini(struct radeon_device *rdev)
{ {
rv515_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
...@@ -615,13 +614,12 @@ int rv515_init(struct radeon_device *rdev) ...@@ -615,13 +614,12 @@ int rv515_init(struct radeon_device *rdev)
if (r) { if (r) {
/* Somethings want wront with the accel init stop accel */ /* Somethings want wront with the accel init stop accel */
dev_err(rdev->dev, "Disabling GPU acceleration\n"); dev_err(rdev->dev, "Disabling GPU acceleration\n");
rv515_suspend(rdev);
r100_cp_fini(rdev); r100_cp_fini(rdev);
r100_wb_fini(rdev); r100_wb_fini(rdev);
r100_ib_fini(rdev); r100_ib_fini(rdev);
radeon_irq_kms_fini(rdev);
rv370_pcie_gart_fini(rdev); rv370_pcie_gart_fini(rdev);
radeon_agp_fini(rdev); radeon_agp_fini(rdev);
radeon_irq_kms_fini(rdev);
rdev->accel_working = false; rdev->accel_working = false;
} }
return 0; return 0;
......
...@@ -1065,9 +1065,11 @@ int rv770_init(struct radeon_device *rdev) ...@@ -1065,9 +1065,11 @@ int rv770_init(struct radeon_device *rdev)
rdev->accel_working = true; rdev->accel_working = true;
r = rv770_startup(rdev); r = rv770_startup(rdev);
if (r) { if (r) {
rv770_suspend(rdev); dev_err(rdev->dev, "disabling GPU acceleration\n");
r600_cp_fini(rdev);
r600_wb_fini(rdev); r600_wb_fini(rdev);
radeon_ring_fini(rdev); r600_irq_fini(rdev);
radeon_irq_kms_fini(rdev);
rv770_pcie_gart_fini(rdev); rv770_pcie_gart_fini(rdev);
rdev->accel_working = false; rdev->accel_working = false;
} }
...@@ -1089,13 +1091,11 @@ int rv770_init(struct radeon_device *rdev) ...@@ -1089,13 +1091,11 @@ int rv770_init(struct radeon_device *rdev)
void rv770_fini(struct radeon_device *rdev) void rv770_fini(struct radeon_device *rdev)
{ {
rv770_suspend(rdev);
r600_blit_fini(rdev); r600_blit_fini(rdev);
r600_cp_fini(rdev);
r600_wb_fini(rdev);
r600_irq_fini(rdev); r600_irq_fini(rdev);
radeon_irq_kms_fini(rdev); radeon_irq_kms_fini(rdev);
radeon_ring_fini(rdev);
r600_wb_fini(rdev);
rv770_pcie_gart_fini(rdev); rv770_pcie_gart_fini(rdev);
radeon_gem_fini(rdev); radeon_gem_fini(rdev);
radeon_fence_driver_fini(rdev); radeon_fence_driver_fini(rdev);
......
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