linux/drivers/gpu/drm/lima
Henrik Grimler 3b3bce4a69 drm/lima: call drm_mm_init() with a valid allocation range
lima_vm_create() is currently run before va_start and va_end are set up,
meaning they are both 0. lima_vm_create() runs drm_mm_init() with them
as arguments for the allocator, and if DRM_DEBUG_MM is enabled the
DRM_MM_BUG_ON check in drm_mm_init then fires, as seen here on
exynos4412-odroid-u2:

[    1.736297] ------------[ cut here ]------------
[    1.740370] kernel BUG at drivers/gpu/drm/drm_mm.c:931!
[    1.745574] Internal error: Oops - BUG: 0 [#1] SMP ARM
[    1.750697] Modules linked in:
[    1.753734] CPU: 0 UID: 0 PID: 41 Comm: kworker/u16:1 Not tainted 7.0.10-postmarketos-exynos4 #11 PREEMPT
[    1.763372] Hardware name: Samsung Exynos (Flattened Device Tree)
[    1.769446] Workqueue: events_unbound deferred_probe_work_func
[    1.775261] PC is at drm_mm_init+0x9c/0xa4
[    1.779339] LR is at lima_vm_create+0x144/0x17c
[ ... ]

Fix the issue by moving the lima_vm_create() call after va_start and
va_end are set up.

Fixes: a1d2a63399 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Henrik Grimler <henrik.grimler@axis.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patch.msgid.link/20260601-lima-alloc-fix-v1-1-16d3f3b7b780@axis.com
2026-06-30 14:07:22 +08:00
..
Kconfig
lima_bcast.c drm/lima: add mask irq callback to gp and pp 2024-04-15 09:05:38 +08:00
lima_bcast.h drm/lima: add mask irq callback to gp and pp 2024-04-15 09:05:38 +08:00
lima_ctx.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
lima_ctx.h drm/lima: remove guilty drm_sched context handling 2024-02-12 16:27:28 +08:00
lima_devfreq.c drm/lima: Fix opp clkname setting in case of missing regulator 2022-11-14 19:08:21 +08:00
lima_devfreq.h
lima_device.c drm/lima: call drm_mm_init() with a valid allocation range 2026-06-30 14:07:22 +08:00
lima_device.h Revert "drm/lima: allocate unique id per drm_file" 2023-04-05 08:40:06 +08:00
lima_dlbu.c
lima_dlbu.h
lima_drv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
lima_drv.h drm/lima: fix void pointer to enum lima_gpu_id cast warning 2024-04-15 09:06:27 +08:00
lima_dump.h
lima_gem.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
lima_gem.h
lima_gp.c drm/lima: fix shared irq handling on driver remove 2024-04-15 09:06:18 +08:00
lima_gp.h
lima_l2_cache.c drm/lima: standardize debug messages by ip name 2024-02-12 16:27:48 +08:00
lima_l2_cache.h
lima_mmu.c drm/lima: fix shared irq handling on driver remove 2024-04-15 09:06:18 +08:00
lima_mmu.h
lima_pmu.c drm/lima: standardize debug messages by ip name 2024-02-12 16:27:48 +08:00
lima_pmu.h
lima_pp.c drm/lima: fix shared irq handling on driver remove 2024-04-15 09:06:18 +08:00
lima_pp.h
lima_regs.h
lima_sched.c drm/lima: Remove drm_sched_init_args->num_rqs usage 2026-04-17 14:43:29 +02:00
lima_sched.h drm/sched: Store the drm client_id in drm_sched_fence 2025-05-28 16:15:58 +02:00
lima_trace.c
lima_trace.h drm: Get rid of drm_sched_job.id 2025-05-28 16:16:15 +02:00
lima_vm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
lima_vm.h
Makefile