diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-02-24 05:39:49 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 15:31:14 -0400 |
commit | 9be29369598543ff1d4800c2591640bc11ef2197 (patch) | |
tree | 9e31a367de48684cda8165b37e82343e7352978d /drivers/media/platform/omap3isp/ispvideo.c | |
parent | bf104c238dc1c7172460853882a545141eaa8222 (diff) |
[media] media: omap3isp: video: Don't call vb2 mmap with queue lock held
videobuf2 has long been subject to AB-BA style deadlocks due to the
queue lock and mmap_sem being taken in different orders for the mmap
operation. The problem has been fixed by making this operation callable
without taking the queue lock, using an mmap_lock internal to videobuf2.
The omap3isp driver still calls the mmap operation with the queue lock
held, resulting in a potential deadlock. As the operation can now be
called without locking the queue, fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/omap3isp/ispvideo.c')
-rw-r--r-- | drivers/media/platform/omap3isp/ispvideo.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c index 3fe9047ef466..89ef31b81694 100644 --- a/drivers/media/platform/omap3isp/ispvideo.c +++ b/drivers/media/platform/omap3isp/ispvideo.c | |||
@@ -1326,14 +1326,8 @@ static unsigned int isp_video_poll(struct file *file, poll_table *wait) | |||
1326 | static int isp_video_mmap(struct file *file, struct vm_area_struct *vma) | 1326 | static int isp_video_mmap(struct file *file, struct vm_area_struct *vma) |
1327 | { | 1327 | { |
1328 | struct isp_video_fh *vfh = to_isp_video_fh(file->private_data); | 1328 | struct isp_video_fh *vfh = to_isp_video_fh(file->private_data); |
1329 | struct isp_video *video = video_drvdata(file); | ||
1330 | int ret; | ||
1331 | |||
1332 | mutex_lock(&video->queue_lock); | ||
1333 | ret = vb2_mmap(&vfh->queue, vma); | ||
1334 | mutex_unlock(&video->queue_lock); | ||
1335 | 1329 | ||
1336 | return ret; | 1330 | return vb2_mmap(&vfh->queue, vma); |
1337 | } | 1331 | } |
1338 | 1332 | ||
1339 | static struct v4l2_file_operations isp_video_fops = { | 1333 | static struct v4l2_file_operations isp_video_fops = { |