Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH 2/4] drm/xe: Annotate xe_mem_region::mapping with __iomem
Date: Tue,  9 Jan 2024 12:24:03 +0100	[thread overview]
Message-ID: <20240109112405.108136-3-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20240109112405.108136-1-thomas.hellstrom@linux.intel.com>

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: 0887a2e7ab62 ("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>
---
 drivers/gpu/drm/xe/xe_bo.c           | 4 ++--
 drivers/gpu/drm/xe/xe_device_types.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 8e4a3b1f6b93..3cd29bd015a0 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -442,7 +442,7 @@ static int xe_ttm_io_mem_reserve(struct ttm_device *bdev,
 
 		if (vram->mapping &&
 		    mem->placement & TTM_PL_FLAG_CONTIGUOUS)
-			mem->bus.addr = (u8 *)vram->mapping +
+			mem->bus.addr = (u8 __force *)vram->mapping +
 				mem->bus.offset;
 
 		mem->bus.offset += vram->io_start;
@@ -734,7 +734,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
 			/* Create a new VMAP once kernel BO back in VRAM */
 			if (!ret && resource_is_vram(new_mem)) {
 				struct xe_mem_region *vram = res_to_mem_region(new_mem);
-				void *new_addr = vram->mapping +
+				void __iomem *new_addr = vram->mapping +
 					(new_mem->start << PAGE_SHIFT);
 
 				if (XE_WARN_ON(new_mem->start == XE_BO_INVALID_OFFSET)) {
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 71f23ac365e6..171e8615d184 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -98,7 +98,7 @@ struct xe_mem_region {
 	 */
 	resource_size_t actual_physical_size;
 	/** @mapping: pointer to VRAM mappable space */
-	void *__iomem mapping;
+	void __iomem *mapping;
 };
 
 /**
-- 
2.43.0


  parent reply	other threads:[~2024-01-09 11:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 11:24 [PATCH 0/4] drm/xe: Silence a number of sparse warnings Thomas Hellström
2024-01-09 11:24 ` [PATCH 1/4] drm/xe: Use __iomem for the regs pointer Thomas Hellström
2024-01-09 14:48   ` Lucas De Marchi
2024-01-09 11:24 ` Thomas Hellström [this message]
2024-01-09 14:52   ` [PATCH 2/4] drm/xe: Annotate xe_mem_region::mapping with __iomem Lucas De Marchi
2024-01-09 11:24 ` [PATCH 3/4] drm/xe: Annotate multiple mmio pointers " Thomas Hellström
2024-01-09 14:53   ` Lucas De Marchi
2024-01-09 15:27   ` Matt Roper
2024-01-09 11:24 ` [PATCH 4/4] drm/xe: Annotate xe_ttm_stolen_mgr::mapping " Thomas Hellström
2024-01-09 14:55   ` Lucas De Marchi
2024-01-09 13:01 ` ✓ CI.Patch_applied: success for drm/xe: Silence a number of sparse warnings Patchwork
2024-01-09 13:01 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-09 13:02 ` ✓ CI.KUnit: success " Patchwork
2024-01-09 13:10 ` ✓ CI.Build: " Patchwork
2024-01-09 13:10 ` ✓ CI.Hooks: " Patchwork
2024-01-09 13:11 ` ✓ CI.checksparse: " Patchwork
2024-01-09 13:46 ` ✓ CI.BAT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240109112405.108136-3-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox