From 13e3a45c319ab600ee4a2b9a1d892d9b6cd23243 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Wed, 4 Nov 2020 06:03:27 +0100 Subject: [PATCH] drm/radeon: make all PCI GPUs use 32 bits DMA bit mask Prevent to fail r600_ring_test on ATI PCI devices hosted on K8 or K10 platforms, this error: > [drm:r600_ring_test [radeon]] *ERROR* radeon: > ring 0 test failed (scratch(0x8504)=0xCAFEDEAD) > radeon 0000:03:00.0: disabling GPU acceleration and this error: > trying to bind memory to uninitialized GART ! Such PCI hardware works correctly on Intel 82801 platform, so this change may be non-optimal for them on non-K8/K10 platforms. Signed-off-by: Thomas Debesse --- drivers/gpu/drm/radeon/radeon_device.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 266e3cbbd09b..b4cf4297d427 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -1372,8 +1372,16 @@ int radeon_device_init(struct radeon_device *rdev, dma_bits = 40; if (rdev->flags & RADEON_IS_AGP) dma_bits = 32; - if ((rdev->flags & RADEON_IS_PCI) && - (rdev->family <= CHIP_RS740)) + /* Some platforms may accept 40 bits for the same PCI hardware + * that would requires 32 bits on other ones. + * PCI ATI Radeon HD 4350 (RV710) is known to work with 40 bits + * on computers running Intel Eaglelake E5200 CPU with 82801 PCI + * bridge while 32 bits are required to not fail r600_ring_test + * on computers running AMD K8 Athlon 3200+ CPU with K8T800Pro + * VT8237/8251 PCI bridge and computers running AMD K10 Phenom II + * X4 970 with Nvidia nForce3 250Gb PCI bridge. + */ + if (rdev->flags & RADEON_IS_PCI) dma_bits = 32; #ifdef CONFIG_PPC64 if (rdev->family == CHIP_CEDAR) -- 2.25.1