summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mgag200/mgag200_fb.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>2013-06-27 15:38:25 +0400
committerDave Airlie <airlied@redhat.com>2013-06-28 05:56:36 +0400
commita06b9a74c73750835b8fd69fe0d0bd7877da111b (patch)
treef263c84f7570ac0dbfeb7a1eb6e026acf7c80eb0 /drivers/gpu/drm/mgag200/mgag200_fb.c
parent19d4b72c0c22c14900313f89765c5f7ef0a2718a (diff)
downloadlinux-a06b9a74c73750835b8fd69fe0d0bd7877da111b.tar.xz
drm/mgag200: 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>
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_fb.c')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_fb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 5da824ce9ba1..964f58cee5ea 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -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;
@@ -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;