Skip to content

Commit 77232e6

Browse files
author
Thomas Hellström
committed
drm/xe: Annotate xe_mem_region::mapping with __iomem
The pointer points to IO memory, but the __iomem annotation was incorrectly placed. Annotate it correctly, update its usage accordingly and fix the corresponding sparse error. Fixes: 0887a2e ("drm/xe: Make xe_mem_region struct") Cc: Oak Zeng <oak.zeng@intel.com> Cc: Michael J. Ruhl <michael.j.ruhl@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240109112405.108136-3-thomas.hellstrom@linux.intel.com (cherry picked from commit 20855b6) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 3ec276d commit 77232e6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static int xe_ttm_io_mem_reserve(struct ttm_device *bdev,
442442

443443
if (vram->mapping &&
444444
mem->placement & TTM_PL_FLAG_CONTIGUOUS)
445-
mem->bus.addr = (u8 *)vram->mapping +
445+
mem->bus.addr = (u8 __force *)vram->mapping +
446446
mem->bus.offset;
447447

448448
mem->bus.offset += vram->io_start;
@@ -734,7 +734,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
734734
/* Create a new VMAP once kernel BO back in VRAM */
735735
if (!ret && resource_is_vram(new_mem)) {
736736
struct xe_mem_region *vram = res_to_mem_region(new_mem);
737-
void *new_addr = vram->mapping +
737+
void __iomem *new_addr = vram->mapping +
738738
(new_mem->start << PAGE_SHIFT);
739739

740740
if (XE_WARN_ON(new_mem->start == XE_BO_INVALID_OFFSET)) {

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct xe_mem_region {
9797
*/
9898
resource_size_t actual_physical_size;
9999
/** @mapping: pointer to VRAM mappable space */
100-
void *__iomem mapping;
100+
void __iomem *mapping;
101101
};
102102

103103
/**

0 commit comments

Comments
 (0)