diff options
author | Sascha Sommer <saschasommer@freenet.de> | 2007-11-03 20:22:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:01:55 -0500 |
commit | 5a80415bcabf2b59e8c34db6e743c54582cfd3c2 (patch) | |
tree | 0702641680d71fc50826cb98c3e330d35b993aa5 /drivers/media/video/em28xx/em28xx.h | |
parent | ea4fd5679b258d8ae85124a47b587a53ba6409de (diff) |
V4L/DVB (6538): em28xx: fix locking to allow accesses from 2 different threads at the same time
The attached patch modifies the em28xx driver so that there can be ioctls from
multiple different threads.
This is necessary for capture apps like MPlayer that use different threads for
capturing and channel tuning.
Now the locking is only done for the ioctls that change properties of the
device or access the i2c bus.
It also removes some locks that look unnecessary:
In em28xx_init_dev:
the videodevice is not registered yet so nothing can access the hardware
meanwhile, the device struct is not assigned to the interface yet so no race
with disconnect is possible
In em28xx_release_resources:
it gets only called when dev->lock is already held
Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx.h')
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 209f6f9d5581..65670ae2945b 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -265,7 +265,7 @@ struct em28xx { | |||
265 | enum em28xx_stream_state stream; | 265 | enum em28xx_stream_state stream; |
266 | enum em28xx_io_method io; | 266 | enum em28xx_io_method io; |
267 | /* locks */ | 267 | /* locks */ |
268 | struct mutex lock, fileop_lock; | 268 | struct mutex lock; |
269 | spinlock_t queue_lock; | 269 | spinlock_t queue_lock; |
270 | struct list_head inqueue, outqueue; | 270 | struct list_head inqueue, outqueue; |
271 | wait_queue_head_t open, wait_frame, wait_stream; | 271 | wait_queue_head_t open, wait_frame, wait_stream; |