Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: intel-xe@lists.freedesktop.org, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 2/5] drm/xe/ggtt: Use ioread64 to dereference ggtt::gsm
Date: Tue, 30 Jan 2024 17:11:00 +0000	[thread overview]
Message-ID: <ZbktpAoNbeApS+xy@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240117134048.165425-3-thomas.hellstrom@linux.intel.com>

On Wed, Jan 17, 2024 at 02:40:45PM +0100, Thomas Hellström wrote:
> 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@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

This patch itself LGTM but wondering if we need also need a fixup for
the below code?

 73 void xe_ggtt_set_pte(struct xe_ggtt *ggtt, u64 addr, u64 pte)
 74 {
 75         xe_tile_assert(ggtt->tile, !(addr & XE_PTE_MASK));
 76         xe_tile_assert(ggtt->tile, addr < ggtt->size);
 77
 78         writeq(pte, &ggtt->gsm[addr >> XE_PTE_SHIFT]);
 79 }

With:
s/writeq(pte, &ggtt->gsm[addr >> XE_PTE_SHIFT])/iowrite64(pte, gtt->gsm + (addr >> XE_PTE_SHIFT)/ 

Anyways as I said this patch LGTM, with that:
Reviewed-by: Matthew Brost <matthew.brost@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
> 

  reply	other threads:[~2024-01-30 17:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 13:40 [PATCH 0/5] Fixes for sparse warning Thomas Hellström
2024-01-17 13:40 ` [PATCH 1/5] drm/xe/dmabuf: Make xe_dmabuf_ops static Thomas Hellström
2024-01-17 13:48   ` Francois Dugast
2024-01-17 13:40 ` [PATCH 2/5] drm/xe/ggtt: Use ioread64 to dereference ggtt::gsm Thomas Hellström
2024-01-30 17:11   ` Matthew Brost [this message]
2024-01-17 13:40 ` [PATCH 3/5] drm/xe: Annotate mcr_[un]lock() Thomas Hellström
2024-01-30 17:18   ` Matthew Brost
2024-01-17 13:40 ` [PATCH 4/5] drm/xe: Don't use __user error pointers Thomas Hellström
2024-01-30 17:54   ` Matthew Brost
2024-01-17 13:40 ` [PATCH 5/5] drm/xe: Use a NULL pointer instead of 0 Thomas Hellström
2024-01-17 13:59   ` Francois Dugast
2024-01-17 23:12 ` ✓ CI.Patch_applied: success for Fixes for sparse warning Patchwork
2024-01-17 23:12 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-17 23:13 ` ✓ CI.KUnit: success " Patchwork
2024-01-17 23:21 ` ✓ CI.Build: " Patchwork
2024-01-17 23:21 ` ✓ CI.Hooks: " Patchwork
2024-01-17 23:22 ` ✓ CI.checksparse: " Patchwork
2024-01-17 23: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=ZbktpAoNbeApS+xy@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@linux.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