1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/panfrost
Adrián Larumbe e57f2187cc drm/panfrost: Fix dma_resv deadlock at drm object pin time
When Panfrost must pin an object that is being prepared a dma-buf
attachment for on behalf of another driver, the core drm gem object pinning
code already takes a lock on the object's dma reservation.

However, Panfrost GEM object's pinning callback would eventually try taking
the lock on the same dma reservation when delegating pinning of the object
onto the shmem subsystem, which led to a deadlock.

This can be shown by enabling CONFIG_DEBUG_WW_MUTEX_SLOWPATH, which throws
the following recursive locking situation:

weston/3440 is trying to acquire lock:
ffff000000e235a0 (reservation_ww_class_mutex){+.+.}-{3:3}, at: drm_gem_shmem_pin+0x34/0xb8 [drm_shmem_helper]
but task is already holding lock:
ffff000000e235a0 (reservation_ww_class_mutex){+.+.}-{3:3}, at: drm_gem_pin+0x2c/0x80 [drm]

Fix it by replacing drm_gem_shmem_pin with its locked version, as the lock
had already been taken by drm_gem_pin().

Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Steven Price <steven.price@arm.com>
Fixes: a780278472 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()")
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240523113236.432585-2-adrian.larumbe@collabora.com
2024-05-29 09:30:38 +02:00
..
Kconfig drm/panfrost: fix GENERIC_ATOMIC64 dependency 2023-01-18 11:09:57 +00:00
Makefile drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs 2024-03-11 13:27:10 +01:00
panfrost_devfreq.c drm/panfrost: Fix incorrect updating of current device frequency 2023-11-30 10:53:42 +00:00
panfrost_devfreq.h drm/panfrost: Add fdinfo support GPU load metrics 2023-10-04 13:04:15 +02:00
panfrost_device.c drm/panfrost: Synchronize and disable interrupts before powering off 2023-12-05 11:39:59 +01:00
panfrost_device.h drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs 2024-03-11 13:27:10 +01:00
panfrost_drv.c drm/panfrost: Only display fdinfo's engine and cycle tags when profiling is on 2024-03-25 15:54:50 +00:00
panfrost_dump.c drm/panfrost: Remove incorrect IS_ERR() check 2023-10-30 15:00:14 +00:00
panfrost_dump.h drm/panfrost: Add support for devcoredump 2022-08-08 12:39:55 +01:00
panfrost_features.h drm/panfrost: Add Mali-G57 "Natt" support 2022-05-26 09:53:38 -04:00
panfrost_gem.c drm/panfrost: Fix dma_resv deadlock at drm object pin time 2024-05-29 09:30:38 +02:00
panfrost_gem.h Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
panfrost_gem_shrinker.c drm/panfrost: dynamically allocate the drm-panfrost shrinker 2023-10-04 10:32:25 -07:00
panfrost_gpu.c drm/panfrost: fix power transition timeout warnings 2024-03-28 16:23:10 +00:00
panfrost_gpu.h drm/panfrost: Synchronize and disable interrupts before powering off 2023-12-05 11:39:59 +01:00
panfrost_issues.h drm/panfrost: Add Mali-G57 "Natt" support 2022-05-26 09:53:38 -04:00
panfrost_job.c drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs 2024-03-11 13:27:10 +01:00
panfrost_job.h drm/panfrost: Synchronize and disable interrupts before powering off 2023-12-05 11:39:59 +01:00
panfrost_mmu.c drm/panfrost: Fix the error path in panfrost_mmu_map_fault_addr() 2024-04-04 18:11:01 +03:00
panfrost_mmu.h drm/panfrost: Synchronize and disable interrupts before powering off 2023-12-05 11:39:59 +01:00
panfrost_perfcnt.c drm/gem: Take reservation lock for vmap/vunmap operations 2022-10-18 01:21:38 +03:00
panfrost_perfcnt.h drm/panfrost: Open/close the perfcnt BO 2019-12-06 11:06:20 -06:00
panfrost_regs.h drm/panfrost: Perform hard reset to recover GPU if soft reset fails 2023-11-10 14:11:25 +00:00
TODO drm/panfrost: Remove commented out call to panfrost_core_dump 2019-10-09 13:36:56 -05:00