]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/gpusvm: Allow device pages to be mapped in mixed mappings after system pages
authorMatthew Brost <matthew.brost@intel.com>
Fri, 30 Jan 2026 19:49:28 +0000 (11:49 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Wed, 4 Feb 2026 19:22:51 +0000 (11:22 -0800)
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.

Fixes: bce13d6ecd6c ("drm/gpusvm, drm/xe: Allow mixed mappings for userptr")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Francois Dugast <francois.dugast@intel.com>
Link: https://patch.msgid.link/20260130194928.3255613-3-matthew.brost@intel.com
drivers/gpu/drm/drm_gpusvm.c

index d733599ceb9a04a273af4084d9615afb0ddbd009..871fcccd128a9bc5ad893d9db6624d3d7f5564c6 100644 (file)
@@ -1495,7 +1495,7 @@ map_pages:
                        }
                        zdd = page->zone_device_data;
                        if (pagemap != page_pgmap(page)) {
-                               if (i > 0) {
+                               if (pagemap) {
                                        err = -EOPNOTSUPP;
                                        goto err_unmap;
                                }