linux/drivers/gpu/drm/ttm
Vadim Nikitushkin fcfe64715b drm/ttm: apply the swapout bulk_move fix to the intended condition
Commit 3db7d7d583 ("drm/ttm: fix swapped-out resources never leaving
their bulk_move range") landed in drm-misc-fixes with its one-line
change applied to the wrong "if": the "if (ret)" after
ttm_resource_try_charge() in ttm_bo_alloc_at_place() became
"if (ret > 0)", while the "if (!ret)" after ttm_tt_swapout() in
ttm_bo_swapout_cb() that the patch targeted was left untouched.

ttm_resource_try_charge() returns 0 or a negative error code, so with
"ret > 0" a failed dmem cgroup charge no longer fails the allocation.
Restore that check and apply the intended change: ttm_tt_swapout()
returns the number of pages swapped out on success, so the bulk_move
removal must run for ret > 0.

Fixes: 3db7d7d583 ("drm/ttm: fix swapped-out resources never leaving their bulk_move range")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Vadim Nikitushkin <bub4z0r@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20260910143451.65853-1-bub4z0r@gmail.com
2026-09-10 18:01:41 +02:00
..
tests dma-buf: rename dma_fence_enable_sw_signaling 2026-07-01 16:52:48 +02:00
Makefile drm/ttm: Provide a shmem backup implementation 2025-03-05 17:08:59 +01:00
ttm_agp_backend.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ttm_backup.c shmem: provide a shmem_write_folio wrapper 2026-08-24 18:43:14 -07:00
ttm_bo_internal.h drm/ttm: rename ttm_bo_put to _fini v3 2025-09-17 14:03:21 +02:00
ttm_bo_util.c drm/ttm: Hook up a cgroup-aware reclaim callback for the dmem controller 2026-08-06 23:38:04 +02:00
ttm_bo_vm.c mm: provide vma_[flags_]is_cow_mapping() and remove is_cow_mapping() 2026-08-24 18:42:50 -07:00
ttm_bo.c drm/ttm: apply the swapout bulk_move fix to the intended condition 2026-09-10 18:01:41 +02:00
ttm_device.c drm/ttm: Tidy ttm_operation_ctx initialization 2025-12-03 14:48:41 +00:00
ttm_execbuf_util.c drm/ttm: Include <linux/export.h> 2025-06-16 09:02:44 +02:00
ttm_module.c drm/ttm: add pgprot handling for RISC-V 2025-10-28 09:19:46 +01:00
ttm_module.h
ttm_pool_internal.h drm/ttm/pool: back up at native page order 2026-07-17 09:09:27 -07:00
ttm_pool.c Linux 7.2 2026-08-20 10:58:44 +10:00
ttm_range_manager.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ttm_resource.c drm/ttm: Hook up a cgroup-aware reclaim callback for the dmem controller 2026-08-06 23:38:04 +02:00
ttm_sys_manager.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ttm_tt.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00