Skip to content

Commit

Permalink
drm/mgag200: do not attempt to acquire a reservation while in an inte…
Browse files Browse the repository at this point in the history
…rrupt 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>
  • Loading branch information
Maarten Lankhorst authored and Dave Airlie committed Jun 28, 2013
1 parent 19d4b72 commit a06b9a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/mgag200/mgag200_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev,
struct mgag200_bo *bo;
int src_offset, dst_offset;
int bpp = (mfbdev->mfb.base.bits_per_pixel + 7)/8;
int ret;
int ret = -EBUSY;
bool unmap = false;
bool store_for_later = false;
int x2, y2;
Expand All @@ -41,7 +41,8 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev,
* then the BO is being moved and we should
* store up the damage until later.
*/
ret = mgag200_bo_reserve(bo, true);
if (!in_interrupt())
ret = mgag200_bo_reserve(bo, true);
if (ret) {
if (ret != -EBUSY)
return;
Expand Down

0 comments on commit a06b9a7

Please sign in to comment.