Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v6 1/4] drm/xe: Use devm_ioremap_wc for VRAM mapping and drop manual unmap
Date: Fri, 27 Jun 2025 09:43:11 +0100	[thread overview]
Message-ID: <b7d0f51e-cc37-46ff-9401-a7eec5ed63fd@intel.com> (raw)
In-Reply-To: <20250626071437.3223888-2-piotr.piorkowski@intel.com>

On 26/06/2025 08:14, Piórkowski, Piotr wrote:
> From: Piotr Piórkowski <piotr.piorkowski@intel.com>
> 
> Let's replace the manual call to ioremap_wc function with devm_ioremap_wc
> function, ensuring that VRAM mappings are automatically released when
> the driver is detached.
> Since devm_ioremap_wc registers the mapping with the device's managed
> resources, the explicit iounmap call in vram_fini is no longer needed,
> so let's remove it.
> 
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> Suggested-by: Matthew Auld <matthew.auld@intel.com>

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> ---
>   drivers/gpu/drm/xe/xe_vram.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vram.c b/drivers/gpu/drm/xe/xe_vram.c
> index e421a74fb87c..3a4c84e9efc6 100644
> --- a/drivers/gpu/drm/xe/xe_vram.c
> +++ b/drivers/gpu/drm/xe/xe_vram.c
> @@ -156,7 +156,8 @@ static int determine_lmem_bar_size(struct xe_device *xe)
>   	xe->mem.vram.dpa_base = 0;
>   
>   	/* set up a map to the total memory area. */
> -	xe->mem.vram.mapping = ioremap_wc(xe->mem.vram.io_start, xe->mem.vram.io_size);
> +	xe->mem.vram.mapping = devm_ioremap_wc(&pdev->dev, xe->mem.vram.io_start,
> +					       xe->mem.vram.io_size);
>   
>   	return 0;
>   }
> @@ -278,9 +279,6 @@ static void vram_fini(void *arg)
>   	struct xe_tile *tile;
>   	int id;
>   
> -	if (xe->mem.vram.mapping)
> -		iounmap(xe->mem.vram.mapping);
> -
>   	xe->mem.vram.mapping = NULL;
>   
>   	for_each_tile(tile, xe, id)


  reply	other threads:[~2025-06-27  8:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26  7:14 [PATCH v6 0/4] Cleaning up code related to VRAM regions and its initialization - part 2 Piórkowski, Piotr
2025-06-26  7:14 ` [PATCH v6 1/4] drm/xe: Use devm_ioremap_wc for VRAM mapping and drop manual unmap Piórkowski, Piotr
2025-06-27  8:43   ` Matthew Auld [this message]
2025-06-26  7:14 ` [PATCH v6 2/4] drm/xe: Use dynamic allocation for tile and device VRAM region structures Piórkowski, Piotr
2025-06-26  7:14 ` [PATCH v6 3/4] drm/xe: Move struct xe_vram_region to a dedicated header Piórkowski, Piotr
2025-06-26  7:14 ` [PATCH v6 4/4] drm/xe: Unify the initialization of VRAM regions Piórkowski, Piotr
2025-06-26  7:22 ` ✗ CI.checkpatch: warning for Cleaning up code related to VRAM regions and its initialization - part 2 (rev9) Patchwork
2025-06-26  7:23 ` ✓ CI.KUnit: success " Patchwork
2025-06-26  8:15 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-27  6:03 ` ✗ Xe.CI.Full: failure " 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=b7d0f51e-cc37-46ff-9401-a7eec5ed63fd@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=piotr.piorkowski@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