Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: francois.dugast@intel.com, thomas.hellstrom@linux.intel.com,
	himal.prasad.ghimiray@intel.com
Subject: [PATCH 2/2] drm/gpusvm: Allow device pages to be mapped in mixed mappings after system pages
Date: Fri, 30 Jan 2026 11:49:28 -0800	[thread overview]
Message-ID: <20260130194928.3255613-3-matthew.brost@intel.com> (raw)
In-Reply-To: <20260130194928.3255613-1-matthew.brost@intel.com>

The current code rejects device mappings whenever system pages have
already been encountered. This is not the intended behavior when
allow_mixed is set.

Relax the restriction by permitting a single pagemap to be selected when
allow_mixed is enabled, even if system pages were found earlier.

Fixed: bce13d6ecd6c ("drm/gpusvm, drm/xe: Allow mixed mappings for userptr")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_gpusvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
index d733599ceb9a..871fcccd128a 100644
--- a/drivers/gpu/drm/drm_gpusvm.c
+++ b/drivers/gpu/drm/drm_gpusvm.c
@@ -1495,7 +1495,7 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 			}
 			zdd = page->zone_device_data;
 			if (pagemap != page_pgmap(page)) {
-				if (i > 0) {
+				if (pagemap) {
 					err = -EOPNOTSUPP;
 					goto err_unmap;
 				}
-- 
2.34.1


  parent reply	other threads:[~2026-01-30 19:49 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
2026-01-30 19:49 ` Matthew Brost [this message]
2026-02-02 12:36   ` [PATCH 2/2] drm/gpusvm: Allow device pages to be mapped in mixed mappings after system pages 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=20260130194928.3255613-3-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francois.dugast@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --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