Skip to content

Commit 91a4484

Browse files
mlankhorstkamalmostafa
authored andcommitted
drm/ast: do not attempt to acquire a reservation while in an interrupt handler
commit 8ade2b8 upstream. 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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]>
1 parent 3f48984 commit 91a4484

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/ast/ast_fb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
5050
struct ast_bo *bo;
5151
int src_offset, dst_offset;
5252
int bpp = (afbdev->afb.base.bits_per_pixel + 7)/8;
53-
int ret;
53+
int ret = -EBUSY;
5454
bool unmap = false;
5555
bool store_for_later = false;
5656
int x2, y2;
@@ -64,7 +64,8 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
6464
* then the BO is being moved and we should
6565
* store up the damage until later.
6666
*/
67-
ret = ast_bo_reserve(bo, true);
67+
if (!in_interrupt())
68+
ret = ast_bo_reserve(bo, true);
6869
if (ret) {
6970
if (ret != -EBUSY)
7071
return;

0 commit comments

Comments
 (0)