From 820e6a80587c0191c630641583e8d98687942146 Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair.francis@wdc.com>
Date: Wed, 27 Feb 2019 15:31:29 -0800
Subject: [PATCH 10/10] HACK: radeon: Don't set PCI DMA mask

Setting a PCI DMA mask when running on RISC-V results in these messages
beeing seen during boot:

    [drm:r600_ring_test] *ERROR* radeon: ring 0 test failed (scratch(0x8504)=0xCAFEDEAD)
    radeon 0000:04:00.0: disabling GPU acceleration

and results with a partially working graphcis card. By not setting a DMA
mask the messages aren't seen and the GPU works.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 drivers/gpu/drm/radeon/radeon_device.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 53f29a115104..add186346544 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1377,12 +1377,11 @@ int radeon_device_init(struct radeon_device *rdev,
 #endif
 
 	dma_bits = rdev->need_dma32 ? 32 : 40;
-	r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
-	if (r) {
-		rdev->need_dma32 = true;
-		dma_bits = 32;
-		pr_warn("radeon: No suitable DMA available\n");
-	}
+
+	rdev->need_dma32 = true;
+	dma_bits = 32;
+	pr_warn("radeon: No suitable DMA available\n");
+
 	r = pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
 	if (r) {
 		pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(32));
-- 
2.21.0

