[PATCH 2/5] drm/xe/ggtt: Use ioread64 to dereference ggtt::gsm

Thomas Hellström thomas.hellstrom at linux.intel.com
Wed Jan 17 13:40:45 UTC 2024


The pointer is an __iomem pointer.
Silence the sparse warning.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Matthew Brost <matthew.brost at intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
---
 drivers/gpu/drm/xe/xe_ggtt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index 6fdf830678b3..305f414b9b65 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -307,11 +307,11 @@ void xe_ggtt_printk(struct xe_ggtt *ggtt, const char *prefix)
 		unsigned int i = addr / XE_PAGE_SIZE;
 
 		xe_tile_assert(ggtt->tile, addr <= U32_MAX);
-		if (ggtt->gsm[i] == scratch_pte)
+		if (ioread64(ggtt->gsm + i) == scratch_pte)
 			continue;
 
 		printk("%s    ggtt[0x%08x] = 0x%016llx",
-		       prefix, (u32)addr, ggtt->gsm[i]);
+		       prefix, (u32)addr, ioread64(ggtt->gsm + i));
 	}
 }
 
-- 
2.43.0



More information about the Intel-xe mailing list