Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ast: do not attempt to acquire a reservation while in an interrupt handler

Mutexes should not be acquired in interrupt context. While the trylock
fastpath is arguably safe on all implementations, the slowpath
unlock path definitely isn't.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Maarten Lankhorst and committed by
Dave Airlie
8ade2b82 a06b9a74

+3 -2
+3 -2
drivers/gpu/drm/ast/ast_fb.c
··· 51 51 struct ast_bo *bo; 52 52 int src_offset, dst_offset; 53 53 int bpp = (afbdev->afb.base.bits_per_pixel + 7)/8; 54 - int ret; 54 + int ret = -EBUSY; 55 55 bool unmap = false; 56 56 bool store_for_later = false; 57 57 int x2, y2; ··· 65 65 * then the BO is being moved and we should 66 66 * store up the damage until later. 67 67 */ 68 - ret = ast_bo_reserve(bo, true); 68 + if (!in_interrupt()) 69 + ret = ast_bo_reserve(bo, true); 69 70 if (ret) { 70 71 if (ret != -EBUSY) 71 72 return;