FROMLIST: drm/i915: Fix page cleanup on DMA remap failure
When converting to folios the cleanup path of shmem_get_pages() was missed. When a DMA remap fails and the max segment size is greater than PAGE_SIZE it will attempt to retry the remap with a PAGE_SIZEd segment size. The cleanup code isn't properly using the folio apis and as a result isn't handling compound pages correctly. v2 -> v3: (Ville) Just use shmem_sg_free_table() as-is in the failure path of shmem_get_pages(). shmem_sg_free_table() will clear mapping unevictable but it will be reset when it retries in shmem_sg_alloc_table(). v1 -> v2: (Ville) Fixed locations where we were not clearing mapping unevictable. Cc: stable@vger.kernel.org Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Cc: Vidya Srinivas <vidya.srinivas@intel.com> Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13487 Link: https://lore.kernel.org/lkml/20250116135636.410164-1-bgeffon@google.com/ Fixes: 0b62af28 ("i915: convert shmem_sg_free_table() to use a folio_batch") Signed-off-by:Brian Geffon <bgeffon@google.com> Suggested-by:
Tomasz Figa <tfiga@google.com> Reviewed-by:
Jonathan Cavitt <jonathan.cavitt@intel.com> Tested-by:
Vidya Srinivas <vidya.srinivas@intel.com> (am from https://patchwork.kernel.org/patch/13951705/) (also found at https://lore.kernel.org/r/20250127204332.336665-1-bgeffon@google.com ) BUG=b:341810357 TEST=fixes local repro Change-Id: I53426e2d57d2bf4fe790fe0bb14aab0e52d9043c Signed-off-by:
Brian Geffon <bgeffon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/6207891 Reviewed-by:
Prahlad Kilambi <prahladk@google.com> Reviewed-by:
Sean Paul <sean@poorly.run> Commit-Queue: Sean Paul <seanpaul@chromium.org> Reviewed-by:
Drew Davenport <ddavenport@chromium.org> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Signed-off-by:
Hubert Mazur <hmazur@google.com>
Loading
Please sign in to comment