Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>,
	<thomas.hellstrom@linux.intel.com>,
	<himal.prasad.ghimiray@intel.com>
Subject: Re: [PATCH 1/2] drm/gpusvm: Force unmapping on error in drm_gpusvm_get_pages
Date: Mon, 2 Feb 2026 13:17:04 +0100	[thread overview]
Message-ID: <aYCVwEs7wg89LybW@fdugast-desk> (raw)
In-Reply-To: <20260130194928.3255613-2-matthew.brost@intel.com>

On Fri, Jan 30, 2026 at 11:49:27AM -0800, Matthew Brost wrote:
> drm_gpusvm_get_pages() only sets the local flags prior to committing the
> pages. If an error occurs mid-mapping, has_dma_mapping will be clear,
> causing the unmap function to skip unmapping pages that were
> successfully mapped before the error. Fix this by forcibly setting
> has_dma_mapping in the error path to ensure all previously mapped pages
> are properly unmapped.
> 
> Fixes: 99624bdff867 ("drm/gpusvm: Add support for GPU Shared Virtual Memory")
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>

Reviewed-by: Francois Dugast <francois.dugast@intel.com>

> ---
>  drivers/gpu/drm/drm_gpusvm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
> index aa9a0b60e727..d733599ceb9a 100644
> --- a/drivers/gpu/drm/drm_gpusvm.c
> +++ b/drivers/gpu/drm/drm_gpusvm.c
> @@ -1572,6 +1572,7 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
>  	return 0;
>  
>  err_unmap:
> +	svm_pages->flags.has_dma_mapping = true;
>  	__drm_gpusvm_unmap_pages(gpusvm, svm_pages, num_dma_mapped);
>  	drm_gpusvm_notifier_unlock(gpusvm);
>  err_free:
> -- 
> 2.34.1
> 

  reply	other threads:[~2026-02-02 12:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 19:49 [PATCH 0/2] Small GPUSVM fixes Matthew Brost
2026-01-30 19:49 ` [PATCH 1/2] drm/gpusvm: Force unmapping on error in drm_gpusvm_get_pages Matthew Brost
2026-02-02 12:17   ` Francois Dugast [this message]
2026-01-30 19:49 ` [PATCH 2/2] drm/gpusvm: Allow device pages to be mapped in mixed mappings after system pages Matthew Brost
2026-02-02 12:36   ` Francois Dugast
2026-01-30 19:55 ` ✗ CI.checkpatch: warning for Small GPUSVM fixes Patchwork
2026-01-30 19:57 ` ✓ CI.KUnit: success " Patchwork
2026-01-30 20:30 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-03  6:15 ` ✗ CI.checkpatch: warning for Small GPUSVM fixes (rev2) Patchwork
2026-02-03  6:16 ` ✓ CI.KUnit: success " Patchwork
2026-02-03  6:50 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-03 19:33 ` ✓ Xe.CI.FULL: " 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=aYCVwEs7wg89LybW@fdugast-desk \
    --to=francois.dugast@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@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