Commit graph

3764 commits

Author SHA1 Message Date
Devin Heitmueller 231ffc9c07 V4L/DVB (9920): em28xx: fix NULL pointer dereference in call to VIDIOC_INT_RESET command
Fix a NULL pointer dereference that would occur if the video decoder tied to
the em28xx supports the VIDIOC_INT_RESET call (for example: the cx25840 driver)

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-23 09:13:50 -02:00
Hans Verkuil 3ca81a5525 V4L/DVB (9906): v4l2-compat: test for unlocked_ioctl as well.
The v4l_compat_ioctl32() function only tested for the presence of the
ioctl op, not for unlocked_ioctl. So it would always return an error
when used with drivers that use unlocked_ioctl instead of ioctl.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-16 16:43:59 -02:00
Mauro Carvalho Chehab 8b21c1e90e V4L/DVB (9885): drivers/media Kconfig's: fix bugzilla #12204
When the tuner modules were moved to common/tuners, a separate customize
option were added for tuners. However, the automatic selection of the
tuners were still using the older option.

This causes that the automatic selection to fail, if DVB_FE_CUSTOMISE is
selected. Also, since those tuners are now under MEDIA_TUNER_CUSTOMIZE
menu, if you unset MEDIA_TUNER_CUSTOMIZE, you can't manually select the
tuners.

This patch fixes this error by replacing DVB_FE_CUSTOMISE by
MEDIA_TUNER_CUSTOMIZE on all places were a tuner is selected.

The patch were generated by this small script:

for i in `find drivers/media -name Kconfig`; do
  cat $i|perl -ne 's/(MEDIA_TUNER.*)DVB_FE_CUSTOMISE/\1MEDIA_TUNER_CUSTOMIZE/; print $_' >a
  mv a $i
done

Also, manually reordered the tuner entries.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-16 16:43:59 -02:00
Jim Paris f86d4a9173 V4L/DVB (9875): gspca - main: Fix vidioc_s_jpegcomp locking.
Signed-off-by: Jim Paris <jim@jtan.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-16 16:43:58 -02:00
Mauro Carvalho Chehab a693b0cdba em28xx: remove backward compat macro added on a previous fix
commit 50f3beb50a fixed em28xx-alsa
locking schema. However, a backport macro was kept.

This patch removes the macro, since it is not needed for the module
compilation against upstream.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01 18:04:14 -02:00
Hans Verkuil 484ab62c5e V4L/DVB (9748): em28xx: fix compile warning
Label fail_unreg is no longer used.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01 17:12:57 -02:00
Douglas Schilling Landgraf faa3bd2e48 V4L/DVB (9743): em28xx: fix oops audio
Replaced usb_kill_usb for usb_unlink_usb
(wait until urb to fully stop require USB core to put the calling process to sleep).

Oops:
http://www.kerneloops.org/raw.php?rawid=71799&msgid=

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01 17:09:42 -02:00
Mauro Carvalho Chehab 50f3beb50a V4L/DVB (9742): em28xx-alsa: implement another locking schema
Instead of using a spinlock, it is better to call the proper pcm stream
locking schema.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-24 12:24:52 -02:00
Jean-Francois Moine e07a1d8ab2 V4L/DVB (9691): gspca: Move the video device to a separate area.
The video device was part of the gspca device. On device disconnection
while streaming, the device structure is freed at close time.
In this case, the remaining close job on the video device run out of
allocated memory.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-24 12:01:38 -02:00
Jean-Francois Moine 5c4fa002b1 V4L/DVB (9690): gspca: Lock the subdrivers via module_get/put.
The previous subdriver protection against rmmod was done via the
file operations table in the device descriptor. On device disconnection
while streaming, the device structure was freed at close time, and the
module_put still used the module name in the freed area.
Now, explicit module get/put are done on open and close.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-24 12:01:23 -02:00
Jean-Francois Moine 98522a7be9 V4L/DVB (9689): gspca: Memory leak when disconnect while streaming.
As a side effect, the sd routine stop0 is called on disconnect.
This permits the subdriver to free its resources.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-24 12:01:07 -02:00
Mauro Carvalho Chehab 818a557eeb V4L/DVB (9668): em28xx: fix a race condition with hald
Newer versions of hald tries to open it to call QUERYCAP.

Due to the lack of a proper locking, it is possible to open the device
before it finishes initialization.

This patch adds a lock to avoid this risk, and to protect the list of
em28xx devices.

While here, remove the uneeded BKL lock.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-20 18:12:02 -02:00
Mauro Carvalho Chehab f2a2e49105 V4L/DVB (9647): em28xx: void having two concurrent control URB's
Now that we have a polling task for IR, there's a race condition, since
IR can be polling while other operations are being doing. Also, we are
now sharing the same urb_buf for both read and write control urb
operations. So, we need a mutex.

Thanks to Davin Heitmueller <devin.heitmueller@gmail.com> for warning me.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-20 17:20:14 -02:00
Mauro Carvalho Chehab c4a98793a6 V4L/DVB (9646): em28xx: avoid allocating/dealocating memory on every control urb
Before this patch, every register setup on em28xx were dynamically
allocating a temporary buffer for control URB's to be handled.

To avoid this ping-pong, use, instead a pre-allocated buffer.

Also, be sure that read control URB's also use the buffer, instead of
relying on a stack buffer.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-20 17:19:31 -02:00
Mauro Carvalho Chehab 625ff16794 V4L/DVB (9645): em28xx: Avoid memory leaks if registration fails
em28xx_init_dev() has some error conditions that are not properly
de-allocating dev var, nor freeing the device number for a future usage.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-20 17:19:20 -02:00
Harvey Harrison deaf53e3c8 V4L/DVB (9635): v4l: s2255drv fix firmware test on big-endian
Noticed by sparse:
drivers/media/video/s2255drv.c:2531:6: warning: restricted __le32 degrades to integer

Cc: Dean Anderson <dean@sensoray.com>
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-16 23:57:23 -02:00
Devin Heitmueller 3f9b46c154 V4L/DVB (9632): make em28xx aux audio input work
The attached patch makes the em28xx auxillary audio input work.
Tested with the HVR-950.

em28xx: make auxillary audio input work

The tuner audio input was working but the aux input wasn't.  Tested with
the HVR-950.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-16 23:56:25 -02:00
Mauro Carvalho Chehab c41109fc9a V4L/DVB (9627): em28xx: Avoid i2c register error for boards without eeprom
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-16 23:55:48 -02:00
Mauro Carvalho Chehab 01a1a3cc1e V4L/DVB (9624): CVE-2008-5033: fix OOPS on tvaudio when controlling bass/treble
This bug were supposed to be fixed by 5ba2f67afb,
where a call to NULL happens.

Not all tvaudio chips allow controlling bass/treble. So, the driver
has a table with a flag to indicate if the chip does support it.

Unfortunately, the handling of this logic were broken for a very long
time (probably since the first module version). Due to that, an OOPS
were generated for devices that don't support bass/treble.

This were the resulting OOPS message before the patch, with debug messages
enabled:

tvaudio' 1-005b: VIDIOC_S_CTRL
BUG: unable to handle kernel NULL pointer dereference at 00000000
IP: [<00000000>]
*pde = 22fda067 *pte = 00000000
Oops: 0000 [#1] SMP
Modules linked in: snd_hda_intel snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_hwdep snd soundcore tuner_simple tuner_types tea5767 tuner
tvaudio bttv bridgebnep rfcomm l2cap bluetooth it87 hwmon_vid hwmon fuse sunrpc ipt_REJECT
nf_conntrack_ipv4 iptable_filter ip_tables ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 xt_state nf_conntrack
ip6table_filter ip6_tables x_tables ipv6 dm_mirrordm_multipath dm_mod configfs videodev v4l1_compat
ir_common 8139cp compat_ioctl32 v4l2_common 8139too videobuf_dma_sg videobuf_core mii btcx_risc tveeprom
i915 button snd_page_alloc serio_raw drm pcspkr i2c_algo_bit i2c_i801 i2c_core iTCO_wdt
iTCO_vendor_support sr_mod cdrom sg ata_generic pata_acpi ata_piix libata sd_mod scsi_mod ext3 jbdmbcache
uhci_hcd ohci_hcd ehci_hcd [last unloaded: soundcore]

Pid: 15413, comm: qv4l2 Not tainted (2.6.25.14-108.fc9.i686 #1)
EIP: 0060:[<00000000>] EFLAGS: 00210246 CPU: 0
EIP is at 0x0
EAX: 00008000 EBX: ebd21600 ECX: e2fd9ec4 EDX: 00200046
ESI: f8c0f0c4 EDI: f8c0f0c4 EBP: e2fd9d50 ESP: e2fd9d2c
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process qv4l2 (pid: 15413, ti=e2fd9000 task=ebe44000 task.ti=e2fd9000)
Stack: f8c0c6ae e2ff2a00 00000d00 e2fd9ec4 ebc4e000 e2fd9d5c f8c0c448 00000000
       f899c12a e2fd9d5c f899c154 e2fd9d68 e2fd9d80 c0560185 e2fd9d88 f8f3e1d8
       f8f3e1dc ebc4e034 f8f3e18c e2fd9ec4 00000000 e2fd9d90 f899c286 c008561c
Call Trace:
 [<f8c0c6ae>] ? chip_command+0x266/0x4b6 [tvaudio]
 [<f8c0c448>] ? chip_command+0x0/0x4b6 [tvaudio]
 [<f899c12a>] ? i2c_cmd+0x0/0x2f [i2c_core]
 [<f899c154>] ? i2c_cmd+0x2a/0x2f [i2c_core]
 [<c0560185>] ? device_for_each_child+0x21/0x49
 [<f899c286>] ? i2c_clients_command+0x1c/0x1e [i2c_core]
 [<f8f283d8>] ? bttv_call_i2c_clients+0x14/0x16 [bttv]
 [<f8f23601>] ? bttv_s_ctrl+0x1bc/0x313 [bttv]
 [<f8f23445>] ? bttv_s_ctrl+0x0/0x313 [bttv]
 [<f8b6096d>] ? __video_do_ioctl+0x1f84/0x3726 [videodev]
 [<c05abb4e>] ? sock_aio_write+0x100/0x10d
 [<c041b23e>] ? kmap_atomic_prot+0x1dd/0x1df
 [<c043a0c9>] ? enqueue_hrtimer+0xc2/0xcd
 [<c04f4fa4>] ? copy_from_user+0x39/0x121
 [<f8b622b9>] ? __video_ioctl2+0x1aa/0x24a [videodev]
 [<c04054fd>] ? do_notify_resume+0x768/0x795
 [<c043c0f7>] ? getnstimeofday+0x34/0xd1
 [<c0437b77>] ? autoremove_wake_function+0x0/0x33
 [<f8b62368>] ? video_ioctl2+0xf/0x13 [videodev]
 [<c048c6f0>] ? vfs_ioctl+0x50/0x69
 [<c048c942>] ? do_vfs_ioctl+0x239/0x24c
 [<c048c995>] ? sys_ioctl+0x40/0x5b
 [<c0405bf2>] ? syscall_call+0x7/0xb
 [<c0620000>] ? cpuid4_cache_sysfs_exit+0x3d/0x69
 =======================
Code:  Bad EIP value.
EIP: [<00000000>] 0x0 SS:ESP 0068:e2fd9d2c

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:39:47 -02:00
Mauro Carvalho Chehab c6241b6c64 V4L/DVB (9623): tvaudio: Improve debug msg by printing something more human
Before the patch, the used ioctl were printed as an hexadecimal code,
hard to be understand without consulting the way _IO macros work.
Instead, use the V4L default handler for printing such errors into a way
that would be easier to understand.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:45 -02:00
Mauro Carvalho Chehab 41f5230f3f V4L/DVB (9622): tvaudio: Improve comments and remove a unneeded prototype
Some comments are not clear enough. Improve it to allow a better
understanding of the driver behavior.

While there, remove an unneeded struct prototype.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:45 -02:00
Mauro Carvalho Chehab 494264379d V4L/DVB (9621): Avoid writing outside shadow.bytes[] array
There were no check about the limits of shadow.bytes array. This offers
a risk of writing values outside the limits, overriding other data
areas.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:45 -02:00
Mauro Carvalho Chehab 81cb5c4f7f V4L/DVB (9620): tvaudio: use a direct reference for chip description
Instead of storing the pointer for the proper entry at chip description
table, the driver were storing an indirect reference, by using an index.
Better to reference directly the data.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:45 -02:00
Mauro Carvalho Chehab b4ab114cf7 V4L/DVB (9619): tvaudio: update initial comments
A driver used on several bttv boards since 2000 is not experimental
anymore ;) Remove it from the comments.

While there, update copyrights addind a quick note about the "recent"
updates since 2005.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:44 -02:00
Mauro Carvalho Chehab 099b7fcc77 V4L/DVB (9618): tvaudio: add additional logic to avoid OOPS
This patch checks for volume, bass, treble, set mode and get mode
callbacks before actually enabling the code that would use them.

Instead of aborting the driver for load, this patch will allow it to
load with a reduced number of functionatities.

This prevents OOPS if some board entry is missing a needed callback.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:44 -02:00
Mauro Carvalho Chehab dd03e970a1 V4L/DVB (9617): tvtime: remove generic_checkmode callback
generic_checkmode() were called, via a callback, for some tvaudio chips.
There's just one callback code used on all those boards. So, it makes no
sense on keeping this as a callback.

Since there were some OOPS reported on tvaudio on kerneloops.org, this
patch removes this callback, adding the code at the only place were it
is called: inside chip_tread. A flag were added to indicate the need for
a kernel thread to set stereo mode on cards that needs it.

Using this more direct approach simplifies the code, making it more
robust against human errors.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:44 -02:00
Mauro Carvalho Chehab af1a9951fc V4L/DVB (9616): tvaudio: cleanup - group all callbacks together
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:44 -02:00
Mauro Carvalho Chehab 04e6f99025 V4L/DVB (9615): tvaudio: instead of using a magic number, use ARRAY_SIZE
Also, the default standard is the first one. So, fix the comment at the
array.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:44 -02:00
Mauro Carvalho Chehab 5c65335103 V4L/DVB (9613): tvaudio: fix a memory leak
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-14 14:24:44 -02:00
Andy Walls 1d6782bda5 V4L/DVB (9516): cx18: Move DVB buffer transfer handling from irq handler to work_queue
cx18: Move DVB buffer transfer handling from irq handler to work_queue thread.
In order to properly lock the epu2cpu mailbox for driver to CX23418 commands,
the DVB/TS buffer handling needs to be moved from the IRQ handler and IRQ
context to a work queue.  This work_queue implmentation is strikingly similar
to the ivtv implementation - for better or worse.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:33 -02:00
Jean-Francois Moine c9ff1b689a V4L/DVB (9557): gspca: Small changes for the sensor HV7131B in zc3xx.
- touch only one register for brightness change
- no quality control
- don't probe again at streamon time.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:32 -02:00
Jean-Francois Moine 03bf75654c V4L/DVB (9556): gspca: Bad init sequence for sensor HV7131B in zc3xx.
This patch fixes the H flip and the R & B color inversion of mode 320x240.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:32 -02:00
Krzysztof Helt 93d0f0385a V4L/DVB (9549): gspca: Fix a typo in one of gspca chips name.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:31 -02:00
Andy Walls 465f8a805d V4L/DVB (9515): cx18: Use correct Mailbox IRQ Ack values and misc IRQ handling cleanup
cx18: Use correct Mailbox IRQ Ack values and misc IRQ handling cleanup.
The SCB field definitions for Ack IRQ's for mailboxes were inconsistent with
the bitmasks being loaded into those SCB fields and the SW2 Ack IRQ handling
logic.  Renamed fields in SCB to make things consistent and did misc IRQ
handling cleanups: removing legacy ivtv dma_reg_lock, HPU IRQ flags, etc.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:31 -02:00
Frederic CAND 17ff61cb20 V4L/DVB (9493): kconfig patch
Ok I made a patch that converts gspca kconfig file to a more standard=
one, with tabs + 2 white spaces, so that if a warning is added it still
compiles
please find it attached

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:30 -02:00
Andy Walls 4e6b61047d V4L/DVB (9511): cx18: Mark CX18_CPU_DE_RELEASE_MDL as a slow API call
cx18: Mark CX18_CPU_DE_RELEASE_MDL as a slow API call.
Give the encoder time to complete the MDL release before destroying the
encoder internal task.  This avoids an encoder lockup on the next digital
capture and error messages about buffers being returned for an inactive
encoder task handle.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:29 -02:00
Andy Walls f056d29eeb V4L/DVB (9510): cx18: Fix write retries for registers that always change - part 2.
cx18: Fix write retries for registers that always change - part 2.
Some registers, especially interrupt related ones, will never read
back the value just written.  Modified interrupt register readback
checks to make sure the intended effect was achieved.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:28 -02:00
Hans Verkuil 58ae1c2318 V4L/DVB (9506): ivtv/cx18: fix test whether modules should be loaded or not.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:28 -02:00
Darron Broad 1a8dc86db1 V4L/DVB (9499): cx88-mpeg: final fix for analogue only compilation + de-alloc fix
Final fix for when analogue only is selected
for compilation (ie, !CX88_DVB)

This tidies up previous fix and adds missing
de-alloc memory leak on fault (eg, if fe1 fails to alloc
where fe0 was allocated).

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:27 -02:00
Frederic CAND 9c8e0a260e V4L/DVB (9496): cx88-blackbird: bugfix: cx88-blackbird-mpeg-users
Allows multiple access to the mpeg device

Signed-off-by: Frederic CAND <frederic.cand@anevia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:27 -02:00
Frederic CAND a2482377c9 V4L/DVB (9495): cx88-blackbird: bugfix: cx88-blackbird-poll-fix
Starts encoder not only on a read call but also on a poll command.

Signed-off-by: Frederic CAND <frederic.cand@anevia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:27 -02:00
Hans Verkuil 7c34158f20 V4L/DVB (9486): ivtv/ivtvfb: no longer experimental
Remove the EXPERIMENTAL tag.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:25 -02:00
Hans Verkuil 6a95ec5906 V4L/DVB (9485): ivtv: remove incorrect V4L1 & tvaudio dependency
ivtv used tvaudio in the past and at the time tvaudio required V4L1.
Since tvaudio is no longer dependent on V4L1 and since ivtv actually
no longer uses tvaudio at all, this is no removed from Kconfig.

Without this patch ivtv won't be build if V4L1 is disabled.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:25 -02:00
Andy Walls f3a3e881b8 V4L/DVB (9475): cx18: Disable write retries for registers that always change - part 1.
cx18: Disable write retries for registers that always change - part 1.
Interrupt related registers will likely not read back the value we just wrote.
Disable retries for these registers for now to avoid accidently discarding
interrupts.  More intelligent read back verification criteria are needed for
these and other registers (e.g. GPIO line registers), which will be addressed in
subsequent changes.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:24 -02:00
Jean Delvare 8182ff69f8 V4L/DVB (9372): Minor fixes to the saa7110 driver
* Apparently the author of the saa7110 driver was confused by the
  number of outputs returned by DECODER_GET_CAPABILITIES. Of course a
  decoder chip has no analog ouputs, but it must have at least one
  digital output.

* Fix an off-by-one error when checking the input value of
  DECODER_SET_INPUT.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:23 -02:00
Rafael Diniz b058e3f395 V4L/DVB (9368): VBI fix for cx88 cards
The attached patch fix VBI support cx88 card.
I'm running a capture for hours, getting the closed caption from it[1], and
it's working perfect - the output is the same of a bttv card.
Please apply this patch as soon as possible.

[1] - using zvbi-ntsc-cc of zvbi project.

Signed-off-by: Rafael Diniz <diniz@wimobilis.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:23 -02:00
Matthias Schwarzott 0e8bac9791 V4L/DVB (9357): cx88-dvb: Fix Oops in case i2c bus failed to register
There already is an report at kernel bugzilla about this issue:
http://bugzilla.kernel.org/show_bug.cgi?id=9455

When enabling extra checks for the i2c-bus of cx88 based cards by
loading i2c_algo_bit with bit_test=1 this may trigger an oops
when loading cx88_dvb.

This is caused by the extra check code that detects that the
sda-line is stuck high and thus does not register the i2c-bus.

cx88-dvb however does not check if the i2c-bus is valid and just
uses core->i2c_adap to attach dvb frontend modules.
This leads to an oops at the first call to i2c_transfer:

$ modprobe i2c_algo_bit bit_test=1
$ modprobe cx8802

cx88/2: cx2388x MPEG-TS Driver Manager version 0.0.6 loaded
cx88[0]: quirk: PCIPCI_NATOMA -- set TBFX
cx88[0]: subsystem: 0070:9202, board: Hauppauge Nova-S-Plus DVB-S [card=37,autodetected], frontend(s): 1
cx88[0]: TV tuner type 4, Radio tuner type -1
cx88[0]: SDA stuck high!
cx88[0]: i2c register FAILED
input: cx88 IR (Hauppauge Nova-S-Plus  as /class/input/input5
cx88[0]/2: cx2388x 8802 Driver Manager
cx88-mpeg driver manager 0000:00:10.2: enabling device (0154 -> 0156)
cx88-mpeg driver manager 0000:00:10.2: PCI INT A -> Link[LNKD] -> GSI 9 (level, low) -> IRQ 9
cx88[0]/2: found at 0000:00:10.2, rev: 5, irq: 9, latency: 64, mmio: 0xfb000000
cx8802_probe() allocating 1 frontend(s)
cx88/2: cx2388x dvb driver version 0.0.6 loaded
cx88/2: registering cx8802 driver, type: dvb access: shared
cx88[0]/2: subsystem: 0070:9202, board: Hauppauge Nova-S-Plus DVB-S [card=37]
cx88[0]/2: cx2388x based DVB/ATSC card
BUG: unable to handle kernel NULL pointer dereference at 00000000
IP: [<e084d4ef>] :i2c_core:i2c_transfer+0x1f/0x80
*pde = 00000000
Modules linked in: cx88_dvb(+) cx8802 cx88xx ir_common i2c_algo_bit tveeprom videobuf_dvb btcx_risc
mga drm ipv6 fscpos eeprom nfsd exportfs stv0299 b2c2_flexcop_pci b2c2_flexcop cx24123 s5h1420 ves1x93
dvb_ttpci dvb_core saa7146_vv saa7146 videobuf_dma_sg videobuf_core videodev v4l1_compat ttpci_eeprom
lirc_serial lirc_dev usbhid rtc uhci_hcd 8139too i2c_piix4 i2c_core usbcore evdev
Pid: 4249, comm: modprobe Not tainted (2.6.27-gentoo #3)
EIP: 0060:[<e084d4ef>] EFLAGS: 00010296 CPU: 0
EIP is at i2c_transfer+0x1f/0x80 [i2c_core]
EAX: 00000000 EBX: ffffffa1 ECX: 00000002 EDX: d6c71e3c
ESI: d80cd050 EDI: d8093c00 EBP: d6c71e20 ESP: d6c71e0c
DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:21 -02:00
Suresh Siddha d522af581c V4L/DVB (9356): [PATCH] saa7134: fix resource map sanity check conflict
Impact: driver could possibly stomp on resources outside of its scope

{mchehab@redhat.com: I got two versions of the same patch (identical,
except for whitespacing). One authored by Andy Burns and another
authored by Suresh Siddha. Due to that, I'm applying the one that has
less CodingStyle errors. I'm also adding both comments and the SOB's for
both patches, since they are both interesting}

Suresh Siddha commented:

  Alexey Fisher reported:

  > resource map sanity check conflict: 0xcfeff800 0xcff007ff 0xcfe00000
  > 0xcfefffff PCI Bus 0000:01

  BAR base is located in the middle of the 4K page and the hardcoded
  size argument makes the request span two pages causing the conflict.

  Fix the hard coded size argument in ioremap().

Andy Burns commented:

  I have already sent this patch on the linux-dvb list, but it didn't get
  much attention, so re-sending direct, I hope you all don't mind.

  While attempting to run mythtv in a xen domU, I encountered problems
  loading the driver for my saa7134 card, with an error from ioremap().

  This error was due to the driver allocating an incorrectly sized mmio
  area, which was trapped by xen's permission checks, but this would go
  un-noticed on a kernel without xen.

  My card has a 1K sized mmio area, I've had information that other cards
  have 2K areas, perhaps others have different sizes, yet the driver
  always attempts to map 4K.  I realise that the granularity of mapping is
  the page size, which typically would be 4K, but unless the card's base
  address happens to fall on a 4K boundary (mine does not) then the
  base+4K will end up spanning two pages, and this is when the error
  occurs under xen.

  My patch uses the pci_resource_len macro to determine the size required
  for the user's particular card, instead of the hardcoded 4K value. I've
  tested with a couple of printk() inside ioremap() that the start address
  and size do get rounded to the closest page boundary.

  With this patch I am able to successfully load the saa7134 driver and
  run mythtv under xen with my card, subject to correct pollirq settings
  in case of shared IRQ, I am still seeing occasional DMA panics, which I
  think are related to swiotlb handling by dom0/domU, usually the panic
  occurs when changing mux, once tuned to a mux, 12 hour continuous
  recordings are possible without errors.

Reported-by: Alexey Fisher <bug-track@fisher-privat.net>
Tested-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andy Burns <andy@burns.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:21 -02:00
Jonathan Corbet 74084d33cb V4L/DVB (9355): de-BKL cafe_ccic.c
Remove lock_kernel() call from cafe_ccic.c

Commit d56dc61265 added lock_kernel()
calls to cafe_ccic.c.  But that driver was written with proper locking
and does not need the BKL, so take it back out.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:20 -02:00
Gregor Jasny c7f09db685 V4L/DVB (9352): Add some missing compat32 ioctls
This patch adds the missing compat ioctls that are needed to
operate Skype in combination with libv4l and a MJPEG only camera.

If you think it's trivial enough please submit it to -stable, too.

Signed-off-by: Gregor Jasny <gjasny@web.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:20 -02:00