[PATCH 4/4] drm/xe: Annotate xe_ttm_stolen_mgr::mapping with __iomem

Lucas De Marchi lucas.demarchi at intel.com
Tue Jan 9 14:55:20 UTC 2024


On Tue, Jan 09, 2024 at 12:24:05PM +0100, Thomas Hellström wrote:
>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: d8b52a02cb40 ("drm/xe: Implement stolen memory.")
>Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
>Cc: Matthew Brost <matthew.brost at intel.com>
>Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
>Signed-off-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>

Lucas De Marchi

>---
> drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>index d2b00d0bf1e2..e5d7d5e2bec1 100644
>--- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>+++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>@@ -31,7 +31,7 @@ struct xe_ttm_stolen_mgr {
> 	/* GPU base offset */
> 	resource_size_t stolen_base;
>
>-	void *__iomem mapping;
>+	void __iomem *mapping;
> };
>
> static inline struct xe_ttm_stolen_mgr *
>@@ -275,7 +275,7 @@ static int __xe_ttm_stolen_io_mem_reserve_bar2(struct xe_device *xe,
> 	drm_WARN_ON(&xe->drm, !(mem->placement & TTM_PL_FLAG_CONTIGUOUS));
>
> 	if (mem->placement & TTM_PL_FLAG_CONTIGUOUS && mgr->mapping)
>-		mem->bus.addr = (u8 *)mgr->mapping + mem->bus.offset;
>+		mem->bus.addr = (u8 __force *)mgr->mapping + mem->bus.offset;
>
> 	mem->bus.offset += mgr->io_base;
> 	mem->bus.is_iomem = true;
>-- 
>2.43.0
>


More information about the Intel-xe mailing list