@@ -2391,6 +2391,7 @@ struct radeon_device {
struct radeon_wb wb;
struct radeon_dummy_page dummy_page;
bool shutdown;
+ bool need_dma32;
bool need_swiotlb;
bool accel_working;
bool fastfb_working; /* IGP feature*/
@@ -1363,25 +1363,28 @@ int radeon_device_init(struct radeon_device *rdev,
else
rdev->mc.mc_mask = 0xffffffffULL; /* 32 bit MC */
- /* set DMA mask.
+ /* set DMA mask + need_dma32 flags.
* PCIE - can handle 40-bits.
* IGP - can handle 40-bits
* AGP - generally dma32 is safest
* PCI - dma32 for legacy pci gart, 40 bits on newer asics
*/
- dma_bits = 40;
+ rdev->need_dma32 = false;
if (rdev->flags & RADEON_IS_AGP)
- dma_bits = 32;
+ rdev->need_dma32 = true;
if ((rdev->flags & RADEON_IS_PCI) &&
(rdev->family <= CHIP_RS740))
- dma_bits = 32;
+ rdev->need_dma32 = true;
#ifdef CONFIG_PPC64
if (rdev->family == CHIP_CEDAR)
- dma_bits = 32;
+ rdev->need_dma32 = true;
#endif
+ dma_bits = rdev->need_dma32 ? 32 : 40;
r = dma_set_mask_and_coherent(&rdev->pdev->dev, DMA_BIT_MASK(dma_bits));
if (r) {
+ rdev->need_dma32 = true;
+ dma_bits = 32;
pr_warn("radeon: No suitable DMA available\n");
return r;
}
@@ -738,7 +738,7 @@ int radeon_ttm_init(struct radeon_device *rdev)
&radeon_bo_driver,
rdev->ddev->anon_inode->i_mapping,
rdev->ddev->vma_offset_manager,
- dma_addressing_limited(&rdev->pdev->dev));
+ rdev->need_dma32);
if (r) {
DRM_ERROR("failed initializing buffer object driver(%d).\n", r);
return r;
This causes screen corruption when using the GPU which makes the system unusable. It was noticed by several people closer to when the change went in as well. We looked into it a bit at the time but couldn't determine the problem. It only seems to affect really old chips (like 15-20 years old) which makes it hard to reproduce if you don't have an old system. There were a couple of threads at the time, but nothing was resolved. I was able to find one of them: https://lkml.org/lkml/2019/12/14/263 This reverts commit 33b3ad3788ab ("drm/radeon: handle PCIe root ports with addressing limitations"). Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206973 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206697 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=207763 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1140 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1287 Fixes: 33b3ad3788ab ("drm/radeon: handle PCIe root ports with addressing limitations") Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Cc: Christoph Hellwig <hch@lst.de> Cc: christian.koenig@amd.com --- v2: provide a better commit message. The issue seems to be related to himem. Any ideas? drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++----- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-)