Commit a06b9a74 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Dave Airlie

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: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 19d4b72c
...@@ -27,7 +27,7 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev, ...@@ -27,7 +27,7 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev,
struct mgag200_bo *bo; struct mgag200_bo *bo;
int src_offset, dst_offset; int src_offset, dst_offset;
int bpp = (mfbdev->mfb.base.bits_per_pixel + 7)/8; int bpp = (mfbdev->mfb.base.bits_per_pixel + 7)/8;
int ret; int ret = -EBUSY;
bool unmap = false; bool unmap = false;
bool store_for_later = false; bool store_for_later = false;
int x2, y2; int x2, y2;
...@@ -41,7 +41,8 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev, ...@@ -41,7 +41,8 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev,
* then the BO is being moved and we should * then the BO is being moved and we should
* store up the damage until later. * 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) {
if (ret != -EBUSY) if (ret != -EBUSY)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment