From: Matthew Brost Date: Fri, 30 Jan 2026 19:49:28 +0000 (-0800) Subject: drm/gpusvm: Allow device pages to be mapped in mixed mappings after system pages X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec49857ad181f2a68a3bea15422f2936ff366d47;p=thirdparty%2Flinux.git drm/gpusvm: Allow device pages to be mapped in mixed mappings after system pages 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 Reviewed-by: Francois Dugast Link: https://patch.msgid.link/20260130194928.3255613-3-matthew.brost@intel.com --- diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c index d733599ceb9a0..871fcccd128a9 100644 --- a/drivers/gpu/drm/drm_gpusvm.c +++ b/drivers/gpu/drm/drm_gpusvm.c @@ -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; }