aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mgag200
diff options
context:
space:
mode:
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>2013-06-27 07:38:25 -0400
committerDave Airlie <airlied@redhat.com>2013-06-27 21:56:36 -0400
commita06b9a74c73750835b8fd69fe0d0bd7877da111b (patch)
treef263c84f7570ac0dbfeb7a1eb6e026acf7c80eb0 /drivers/gpu/drm/mgag200
parent19d4b72c0c22c14900313f89765c5f7ef0a2718a (diff)
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')
-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,
27 struct mgag200_bo *bo; 27 struct mgag200_bo *bo;
28 int src_offset, dst_offset; 28 int src_offset, dst_offset;
29 int bpp = (mfbdev->mfb.base.bits_per_pixel + 7)/8; 29 int bpp = (mfbdev->mfb.base.bits_per_pixel + 7)/8;
30 int ret; 30 int ret = -EBUSY;
31 bool unmap = false; 31 bool unmap = false;
32 bool store_for_later = false; 32 bool store_for_later = false;
33 int x2, y2; 33 int x2, y2;
@@ -41,7 +41,8 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev,
41 * then the BO is being moved and we should 41 * then the BO is being moved and we should
42 * store up the damage until later. 42 * store up the damage until later.
43 */ 43 */
44 ret = mgag200_bo_reserve(bo, true); 44 if (!in_interrupt())
45 ret = mgag200_bo_reserve(bo, true);
45 if (ret) { 46 if (ret) {
46 if (ret != -EBUSY) 47 if (ret != -EBUSY)
47 return; 48 return;