Commit 6cb5225f authored by Michel Dänzer's avatar Michel Dänzer Committed by Ben Hutchings

drm/radeon: Don't flush the GART TLB if rdev->gart.ptr == NULL

commit 233709d2 upstream.

This can be the case when the GPU is powered off, e.g. via vgaswitcheroo
or runpm. When the GPU is powered up again, radeon_gart_table_vram_pin
flushes the TLB after setting rdev->gart.ptr to non-NULL.

Fixes panic on powering off R7xx GPUs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61529Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 6f26afc9
......@@ -171,8 +171,10 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
}
}
}
mb();
radeon_gart_tlb_flush(rdev);
if (rdev->gart.ptr) {
mb();
radeon_gart_tlb_flush(rdev);
}
}
int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
......@@ -217,8 +219,10 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
}
}
}
mb();
radeon_gart_tlb_flush(rdev);
if (rdev->gart.ptr) {
mb();
radeon_gart_tlb_flush(rdev);
}
return 0;
}
......
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