Commit f9274562 authored by Jerome Glisse's avatar Jerome Glisse Committed by Dave Airlie

drm/radeon/kms: avoid possible oops (call gart_fini before gart_disable)

radeon_gart_fini might call GART unbind callback function which
might try to access GART table but if gart_disable is call first
the GART table will be unmapped so any access to it will oops.
Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 97f23b3d
...@@ -236,9 +236,9 @@ int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) ...@@ -236,9 +236,9 @@ int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
void r100_pci_gart_fini(struct radeon_device *rdev) void r100_pci_gart_fini(struct radeon_device *rdev)
{ {
radeon_gart_fini(rdev);
r100_pci_gart_disable(rdev); r100_pci_gart_disable(rdev);
radeon_gart_table_ram_free(rdev); radeon_gart_table_ram_free(rdev);
radeon_gart_fini(rdev);
} }
int r100_irq_set(struct radeon_device *rdev) int r100_irq_set(struct radeon_device *rdev)
......
...@@ -165,9 +165,9 @@ void rv370_pcie_gart_disable(struct radeon_device *rdev) ...@@ -165,9 +165,9 @@ void rv370_pcie_gart_disable(struct radeon_device *rdev)
void rv370_pcie_gart_fini(struct radeon_device *rdev) void rv370_pcie_gart_fini(struct radeon_device *rdev)
{ {
radeon_gart_fini(rdev);
rv370_pcie_gart_disable(rdev); rv370_pcie_gart_disable(rdev);
radeon_gart_table_vram_free(rdev); radeon_gart_table_vram_free(rdev);
radeon_gart_fini(rdev);
} }
void r300_fence_ring_emit(struct radeon_device *rdev, void r300_fence_ring_emit(struct radeon_device *rdev,
......
...@@ -492,9 +492,9 @@ void r600_pcie_gart_disable(struct radeon_device *rdev) ...@@ -492,9 +492,9 @@ void r600_pcie_gart_disable(struct radeon_device *rdev)
void r600_pcie_gart_fini(struct radeon_device *rdev) void r600_pcie_gart_fini(struct radeon_device *rdev)
{ {
radeon_gart_fini(rdev);
r600_pcie_gart_disable(rdev); r600_pcie_gart_disable(rdev);
radeon_gart_table_vram_free(rdev); radeon_gart_table_vram_free(rdev);
radeon_gart_fini(rdev);
} }
void r600_agp_enable(struct radeon_device *rdev) void r600_agp_enable(struct radeon_device *rdev)
......
...@@ -203,9 +203,9 @@ void rs400_gart_disable(struct radeon_device *rdev) ...@@ -203,9 +203,9 @@ void rs400_gart_disable(struct radeon_device *rdev)
void rs400_gart_fini(struct radeon_device *rdev) void rs400_gart_fini(struct radeon_device *rdev)
{ {
radeon_gart_fini(rdev);
rs400_gart_disable(rdev); rs400_gart_disable(rdev);
radeon_gart_table_ram_free(rdev); radeon_gart_table_ram_free(rdev);
radeon_gart_fini(rdev);
} }
int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
......
...@@ -268,9 +268,9 @@ void rs600_gart_disable(struct radeon_device *rdev) ...@@ -268,9 +268,9 @@ void rs600_gart_disable(struct radeon_device *rdev)
void rs600_gart_fini(struct radeon_device *rdev) void rs600_gart_fini(struct radeon_device *rdev)
{ {
radeon_gart_fini(rdev);
rs600_gart_disable(rdev); rs600_gart_disable(rdev);
radeon_gart_table_vram_free(rdev); radeon_gart_table_vram_free(rdev);
radeon_gart_fini(rdev);
} }
#define R600_PTE_VALID (1 << 0) #define R600_PTE_VALID (1 << 0)
......
...@@ -126,9 +126,9 @@ void rv770_pcie_gart_disable(struct radeon_device *rdev) ...@@ -126,9 +126,9 @@ void rv770_pcie_gart_disable(struct radeon_device *rdev)
void rv770_pcie_gart_fini(struct radeon_device *rdev) void rv770_pcie_gart_fini(struct radeon_device *rdev)
{ {
radeon_gart_fini(rdev);
rv770_pcie_gart_disable(rdev); rv770_pcie_gart_disable(rdev);
radeon_gart_table_vram_free(rdev); radeon_gart_table_vram_free(rdev);
radeon_gart_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