summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/lirc_dev.c
AgeCommit message (Collapse)Author
2010-08-02V4L/DVB: IR/lirc: make lirc userspace and staging modules buildableJarod Wilson
The lirc userspace needs all the current ioctls defined, and we need to put the header files in places out-of-tree and/or staging lirc drivers (which I plan to prep soon) can easily build with. I've actually tested this in a tree w/all the lirc drivers queued up to be submitted for staging. I'm also reasonably sure that Andy Walls is going to need most of the ioctls anyway for his cx23888 IR driver work. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: lirc: use unlocked_ioctlArnd Bergmann
New code should not rely on the big kernel lock, so use the unlocked_ioctl file operation in lirc. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Jarod Wilson <jarod@redhat.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: IR/lirc_dev: fix locking in lirc_dev_fop_readJarod Wilson
On Wed, Jul 07, 2010 at 02:52:58PM +0200, Jiri Slaby wrote: > Hi, > > stanse found a locking error in lirc_dev_fop_read: > if (mutex_lock_interruptible(&ir->irctl_lock)) > return -ERESTARTSYS; > ... > while (written < length && ret == 0) { > if (mutex_lock_interruptible(&ir->irctl_lock)) { #1 > ret = -ERESTARTSYS; > break; > } > ... > } > > remove_wait_queue(&ir->buf->wait_poll, &wait); > set_current_state(TASK_RUNNING); > mutex_unlock(&ir->irctl_lock); #2 > > If lock at #1 fails, it beaks out of the loop, with the lock unlocked, > but there is another "unlock" at #2. This should do the trick. Completely untested beyond compiling, but its not exactly a complicated fix, and in practice, I'm not aware of anyone ever actually tripping that locking bug, so there's zero functional change in typical use here. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: IR: add lirc device interfaceJarod Wilson
v2: currently unused ioctls are included, but #if 0'd out Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>