Commit graph

201608 commits

Author SHA1 Message Date
Jarod Wilson
c5ac457117 V4L/DVB: staging/lirc: add lirc_sasem driver
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:28 -03:00
Jarod Wilson
805a896665 V4L/DVB: staging/lirc: add lirc_parallel driver
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:27 -03:00
Jarod Wilson
c147f9078a V4L/DVB: staging/lirc: add lirc_it87 driver
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:26 -03:00
Jarod Wilson
85cb01afc8 V4L/DVB: staging/lirc: add lirc_ite8709 driver
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:25 -03:00
Jarod Wilson
4cb613aea4 V4L/DVB: staging/lirc: add lirc_imon driver
Nb: this is a very trimmed-down lirc_imon, which only supports the
oldest generation of imon devices that don't do onboard signal decoding
like the most recent generation imon devices -- those are now supported
by the ir-core imon driver.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:24 -03:00
Jarod Wilson
eedaf1ae7c V4L/DVB: staging/lirc: add lirc_igorplugusb driver
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:23 -03:00
Mauro Carvalho Chehab
35f168d10f V4L/DVB: staging: Add an specific TODO note for lirc_i2c
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:23 -03:00
Jarod Wilson
085ffd08aa V4L/DVB: staging/lirc: add lirc_i2c driver
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:22 -03:00
Jarod Wilson
9119fddb77 V4L/DVB: staging/lirc: add lirc_ene0100 driver
[mchehab@redhat.com: fixed a few WARNING: please, no space before tabs]
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:21 -03:00
Jarod Wilson
d10d634143 V4L/DVB: staging/lirc: add lirc_bt829 driver
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:19 -03:00
Michael Krufky
17f93e1e3b V4L/DVB: af9005: use generic_bulk_ctrl_endpoint_response
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Acked-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:18 -03:00
Jarod Wilson
7e48b30af0 V4L/DVB: dvb: add support for kworld 340u and ub435-q to em28xx-dvb
This adds support for the KWorld PlusTV 340U and KWorld UB345-Q ATSC
sticks, which are really the same device. The sticks have an eMPIA
em2870 usb bridge chipset, an LG Electronics LGDT3304 ATSC/QAM
demodulator and an NXP TDA18271HD tuner -- early versions of the 340U
have a a TDA18271HD/C1, later models and the UB435-Q have a C2.

The stick has been tested succesfully with both VSB_8 and QAM_256 signals.
Its using lgdt3304 support added to the lgdt3305 driver by a prior patch,
rather than the current lgdt3304 driver, as its severely lacking in
functionality by comparison (see said patch for details).

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:17 -03:00
Jiri Slaby
1c488ea9d5 V4L/DVB: DVB: fix dvr node refcounting
In dvb_dvr_release, there is a test dvbdev->users==-1, but users are
never negative. This error results in hung tasks:
  task                        PC stack   pid father
bash          D ffffffffa000c948     0  3264   3170 0x00000000
 ffff88003aec5ce8 0000000000000086 0000000000011f80 0000000000011f80
 ffff88003aec5fd8 ffff88003aec5fd8 ffff88003b848670 0000000000011f80
 ffff88003aec5fd8 0000000000011f80 ffff88003e02a030 ffff88003b848670
Call Trace:
 [<ffffffff813dd4a5>] dvb_dmxdev_release+0xc5/0x130
 [<ffffffff8107b750>] ? autoremove_wake_function+0x0/0x40
 [<ffffffffa00013a2>] dvb_usb_adapter_dvb_exit+0x42/0x70 [dvb_usb]
 [<ffffffffa0000525>] dvb_usb_exit+0x55/0xd0 [dvb_usb]
 [<ffffffffa00005ee>] dvb_usb_device_exit+0x4e/0x70 [dvb_usb]
 [<ffffffffa000a065>] af9015_usb_device_exit+0x55/0x60 [dvb_usb_af9015]
 [<ffffffff813a3f05>] usb_unbind_interface+0x55/0x1a0
 [<ffffffff81316000>] __device_release_driver+0x70/0xe0
...

So check against 1 there instead.

BTW why's the TODO there? Adding TODOs to the code without
descriptions is like adding nothing.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:16 -03:00
Laurent Pinchart
bbafc0cb6c V4L/DVB: uvc: Move constants and structures definitions to linux/usb/video.h
The UVC host and gadget drivers both define constants and structures in
private header files. Move all those definitions to linux/usb/video.h
where they can be shared by the two drivers (and be available for
userspace applications).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:15 -03:00
Antti Palosaari
c89f66f629 V4L/DVB: af9013: fix comments
Fix comments. It is demodulator driver not DVB USB -bridge.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:14 -03:00
Antti Palosaari
ce99efa53e V4L/DVB: af9013: output fw version as four digit long
Firmware version is four digit long. Print all four digits instead of
three digits used earlier.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:13 -03:00
Antti Palosaari
8af5e3813b V4L/DVB: af9013: af9013_read_status() refactoring
Function af9013_read_status() refactoring. Read lock bits in different
order to save count of register reads.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:12 -03:00
Antti Palosaari
737fabf051 V4L/DVB: af9013: program tuner before demodulator
Program tuner before demodulator in case of channel set. Earlier it was
programmed during demodulator programming. This seems to resolve weird
error where demodulator misses sometimes ability to gain lock.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:11 -03:00
Antti Palosaari
2606cfa3f6 V4L/DVB: af9015: support for AverMedia AVerTV Volar M (A815Mac)
Add USB ID 07ca:815a for AverMedia AVerTV Volar M (A815Mac).

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:10 -03:00
Antti Palosaari
4e9f567775 V4L/DVB: get_dvb_firmware: update af9015
New driver contains new firmware 5.1.0.0. Fix script to get that.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:10 -03:00
Antti Palosaari
3b11f4e90d V4L/DVB: af9013: add support for firmware 5.1.0.0
Add support for new firmware version 5.1.0.0.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:09 -03:00
Jean-François Moine
76ed0fe757 V4L/DVB: gspca - vc032x: Move the first VC0321 settings to sd_init()
The first VC0321 settings were done at webcam connection only. They must also
be done on resume after suspend.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:07 -03:00
Jean-François Moine
19697b546c V4L/DVB: gspca - sonixj: Do the audio input work for webcams with a microphone
The bit 0x04 of the bridge register 02 (GPIO) is used for audio connection
in webcams containing the bridge SN9C105. This patch sets it correctly,
according to the presence of an audio device.

Tested-by: Kyle Baker <kyleabaker@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:06 -03:00
Jean-François Moine
35680baa68 V4L/DVB: gspca - main: Handle the audio device
When there is an audio device, use a lower alternate setting.
This patch does not fix correctly all audio and bandwidth problems.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:06 -03:00
Jean-François Moine
c4dc692ce6 V4L/DVB: gspca - main: Adjust and remove some debug messages
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:05 -03:00
Jean-François Moine
a4f96eb2b1 V4L/DVB: gspca - main: Remove useless audio ioctl's
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:04 -03:00
Jean-François Moine
a2ba6f27cd V4L/DVB: gspca - main: Fix a compilation warning
Reported-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:02 -03:00
Dan Carpenter
b5f5933a6a V4L/DVB: au0828: move dereference below sanity checks
This function has sanity checks to make sure that "dev" is non-null.  I
moved the dereference down below the checks.  In the current code "dev"
is never actually null.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:01 -03:00
Dan Carpenter
49b7a12c0a V4L/DVB: media/IR: testing the wrong variable
There is a typo here.  We meant to test "rbuf" instead of "drv".  We
already tested "drv" earlier.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:00 -03:00
Julia Lawall
5c79b496a7 V4L/DVB: drivers/video/omap2/displays: add missing mutex_unlock
Add a mutex_unlock missing on the error paths.  The use of the mutex is
balanced elsewhere in the file.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E1;
@@

* mutex_lock(E1,...);
  <+... when != E1
  if (...) {
    ... when != E1
*   return ...;
  }
  ...+>
* mutex_unlock(E1,...);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:59 -03:00
Andrew Morton
febe2ea10e V4L/DVB: "dib3000mc: reduce large stack usage" fix
s/ENODEV/ENOMEM, per Andreas.

This fix got lost when someone merged "dib3000mc: reduce large stack
usage".  Please don't lose fixes.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:59 -03:00
Jiri Slaby
37b58bfe4b V4L/DVB: VIDEO: ivtvfb, remove unneeded NULL test
Stanse found that in ivtvfb_callback_cleanup and ivtvfb_callback_init
there are unneeded tests for itv being NULL. But itv is initialized
as container_of with non-zero offset in those functions, so it is
never NULL (even if v4l2_dev is). This was found because itv is
dereferenced earlier than the test.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:57 -03:00
Jarod Wilson
6efb870a11 V4L/DVB: IR/lirc: use memdup_user instead of copy_from_user
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:56 -03:00
Jarod Wilson
5690085e7b V4L/DVB: IR/lirc: make lirc userspace and staging modules buildable
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-02 16:42:55 -03:00
Christian Dietrich
1e68752877 V4L/DVB: drivers/media/video: Remove dead CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE
CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE doesn't exist in Kconfig and is never defined anywhere
else, therefore removing all references for it from the source code.

Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:54 -03:00
Joe Perches
abf84383ec V4L/DVB: drivers/media: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:53 -03:00
Jean-François Moine
1676e4ab55 V4L/DVB: gspca - sq930x: Add some comments for sensor mt9v111
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:52 -03:00
Jean-François Moine
ef35d34fea V4L/DVB: gspca - vc032x: Add trace of USB exchanges
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:51 -03:00
Jean-François Moine
fe854ec07c V4L/DVB: gspca - vc032x: Stop the USB exchanges on error
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:50 -03:00
Jean-François Moine
98475cb642 V4L/DVB: gspca - vc032x: Add some comments
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:49 -03:00
Jean-François Moine
f7059eaa28 V4L/DVB: gspca - main: Don't use the frame buffer flags
This patch fixes possible race conditions in queue management with SMP:
when a frame was completed, the irq function tried to use the next frame
buffer. At this time, it was possible that the application on an other
processor updated the frame pointer, making the image to point to a bad
buffer.
The patch contains two main changes:
- the image transfer uses the queue indexes which are protected against
  simultaneous memory access,
- the image pointer which is used for image concatenation is only set at
  interrupt level.
Some subdrivers which used the image pointer have been updated.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:48 -03:00
Jean-François Moine
02bbcb9d86 V4L/DVB: gspca - main: Possible race condition in queue management
The problem may occur with SMP:
- a frame is completed at interrupt level (in gspca_frame_add with
  packet_type == LAST_PACKET,
- just after clearing the bit V4L2_BUF_FLAG_QUEUED and before setting
  the bit V4L2_BUF_FLAG_DONE, on the other processor, the application
  tries to requeue the same frame buffer,
- then, the qbuf function succeeds because ALL_FLAGS are not set.
The fix sets and resets the two flags in one instruction.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:47 -03:00
Christoph Egger
9059cd4440 V4L/DVB: remove obsolete conditionalizing on DVB_DIBCOM_DEBUG
As pointed by Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>,

The config Option DVB_DIBCOM_DEBUG was dropped while removing the dibusb
driver in favor of dvb-usb in 2005. However it remaind existant at some
places of the kernel config.

Instead of just removing the debug capability, the better is to just remove
the bad dependency, making the modprobe function always visible.

Thanks-to: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:46 -03:00
Ben Hutchings
7638699c25 V4L/DVB: lgs8gxx: remove firmware for lgs8g75
The recently added support for lgs8g75 included some 8051 machine code
without accompanying source code.  Replace this with use of the
firmware loader.

Compile-tested only.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:45 -03:00
Tobias Lorenz
73c994e4fb V4L/DVB: si470x: -EINVAL overwritten in si470x_vidioc_s_tuner()
This patch to the si470x_vidioc_s_tuner function was developed in
cooperation with Roel Kluin <roel.kluin@gmail.com>. It sets the default
retval to 0 instead of -EINVAL, identical to what is done in all other
set/get functions of v4l2_ioctl_ops. This is just as cosmetic change, as
retval is directly overwritten by the si470x_disconnect_check() anyway.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:44 -03:00
Jarod Wilson
22b0766b62 V4L/DVB: IR/mceusb: more streamlining of device init
Spent a while last night getting device initialization packet captures
under Windows for all generations of devices. There are a few places
where we were doing things differently, and few things we were doing
that we don't need to do, particularly on gen3 hardware, and I *think*
one of those things is what was locking up my pinnacle hw from time to
time -- at least, its been perfectly well behaved every time its been
plugged in since making this change.

First up, we're adding a bit more to the gen1 init routine here. Its
not absolutely necessary, the hardware works the same both with and
without it, but I'd like to be consistent w/Windows here.

Second, DEVICE_RESET is never called when initializing either of my
gen3 devices, its only called for gen1 and gen2. The bits in the gen3
init after removing that, are safe (and interesting) to run on all
hardware, so there's no more gen3-specific init done, there's instead
a generic mceusb_get_parameters() that is run for all hardware.

Third, the gen3 flag isn't needed. We only care if hardware is gen3
during probe, so I've dropped that from the device flags struct.

Successfully tested on all three generations of mceusb hardware.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:43 -03:00
Mauro Carvalho Chehab
ca17a4f0bf V4L/DVB: IR/mceusb: remove unused vars from gen1 init
Prior init unification/simplification patch made these unused, forgot
to remove them, so this silences:

drivers/media/IR/mceusb.c: In function ‘mceusb_gen1_init’:
drivers/media/IR/mceusb.c:769: warning: unused variable ‘partial’
drivers/media/IR/mceusb.c:768: warning: unused variable ‘i’

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:42 -03:00
Arnd Bergmann
044e5878c2 V4L/DVB: lirc: use unlocked_ioctl
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-02 16:42:22 -03:00
Randy Dunlap
f9839da051 V4L/DVB: IR: jvc-decoder needs BITREVERSE
ir-jvc-decoder uses bitreverse interfaces, so it should select
BITREVERSE.

ir-jvc-decoder.c:(.text+0x550bc): undefined reference to `byte_rev_table'
ir-jvc-decoder.c:(.text+0x550c6): undefined reference to `byte_rev_table'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 15:36:32 -03:00
Jarod Wilson
69c271f33b V4L/DVB: IR/lirc_dev: fix locking in lirc_dev_fop_read
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-02 15:36:23 -03:00