07 Jan, 2009

1 commit

  • Several subsystem open handlers dereference the fops_get() return value
    without checking it for nullness. This opens a race condition between the
    open handler and module unloading.

    A module can be marked as being unloaded (MODULE_STATE_GOING) before its
    exit function is called and gets the chance to unregister the driver.
    During that window open handlers can still be called, and fops_get() will
    fail in try_module_get() and return a NULL pointer.

    This change checks the fops_get() return value and returns -ENODEV if NULL.

    Reported-by: Alan Jenkins
    Signed-off-by: Laurent Pinchart
    Acked-by: Takashi Iwai
    Cc: Al Viro
    Cc: Dave Airlie
    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Laurent Pinchart
     

03 Jan, 2009

29 commits

  • The radio_release function of the BTTV driver is missing a call to
    v4l2_prio_close. As a result, after the radio device has been opened at
    least once (e.g., by HAL during bootup), v4l2_priority will never drop below
    V4L2_PRIORITY_INTERACTIVE again. With the following patch against 2.6.28,
    applications that run with V4L2_PRIORITY_BACKGROUND are able to open devices
    again. Previous Linux versions are affected as well.

    Signed-off-by: Udo Steinberg
    Signed-off-by: Mauro Carvalho Chehab

    Udo Steinberg
     
  • Signed-off-by: Kay Sievers
    Signed-off-by: Mauro Carvalho Chehab

    Kay Sievers
     
  • This code had calls to both usb_set_intfdata and dev_set_drvdata, doing the
    same thing.

    The semantic patch that lead to finding this problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @header@
    @@

    @same depends on header@
    position p;
    @@

    usb_set_intfdata@p(...) { ... }

    @depends on header@
    position _p!=same.p;
    identifier _f;
    struct usb_interface *intf;
    expression data;
    @@

    _f@_p(...) { dev, data);
    + usb_set_intfdata(intf, data);
    ...+> }

    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall
     
  • A user reported the following OOPS with his pcHDTV HD5500 card, which
    uses a cx88 PCI bridge with a LG-TDVS-H06xF frontend module, made up
    of a TUA6034 tuner, TDA988x IF demod, and LG DT3303 ATSC/QAM demod.

    Somehow, tuner-core gets loaded before the digital driver configures
    the tuner, and tuner-core somehow incorrectly sets the tuner type to
    LG NTSC (TAPE series) instead of LG TDVS-H06xF. This tuner type does
    not have the tuning stepsize defined, so an OOPS occurs during the
    digital tune function.

    We still dont know how the type gets set incorrectly in the first place.
    The user has a tainted kernel with a binary nividia module, which COULD
    have something to do with this, but it's hard to say for sure.

    Nevertheless, to avoid this division by zero, we should check that
    stepsize is defined. If stepsize is not defined, print an error and
    bail out on the tune request.

    cx8800 0000:05:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
    cx88[0]: subsystem: 7063:5500, board: pcHDTV HD5500 HDTV [card=47,autodetected], frontend(s): 1
    cx88[0]: TV tuner type 47, Radio tuner type -1
    tuner' 2-0043: chip found @ 0x86 (cx88[0])
    tda9887 2-0043: creating new instance
    tda9887 2-0043: tda988[5/6/7] found
    tuner' 2-0061: chip found @ 0xc2 (cx88[0])
    tuner-simple 2-0061: creating new instance
    tuner-simple 2-0061: type set to 47 (LG NTSC (TAPE series))
    cx88[0]/0: found at 0000:05:01.0, rev: 5, irq: 19, latency: 32, mmio: 0xea000000
    cx88[0]/0: registered device video1 [v4l2]
    cx88[0]/0: registered device vbi1
    cx88_audio 0000:05:01.1: PCI INT A -> GSI 19 (level, low) -> IRQ 19
    cx88[0]/1: CX88x/0: ALSA support for cx2388x boards
    cx88[0]/2: cx2388x 8802 Driver Manager
    cx88-mpeg driver manager 0000:05:01.2: PCI INT A -> GSI 19 (level, low) -> IRQ 19
    cx88[0]/2: found at 0000:05:01.2, rev: 5, irq: 19, latency: 32, mmio: 0xec000000
    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: 7063:5500, board: pcHDTV HD5500 HDTV [card=47]
    cx88[0]/2: cx2388x based DVB/ATSC card
    tuner-simple 2-0061: attaching existing instance
    tuner-simple 2-0061: type set to 64 (LG NTSC (TAPE series))
    tda9887 2-0043: attaching existing instance
    DVB: registering new adapter (cx88[0])
    DVB: registering adapter 0 frontend 0 (LG Electronics LGDT3303 VSB/QAM Frontend)...
    [snip]
    stepsize=0
    divide error: 0000 [1] SMP
    CPU 1
    Modules linked in: nls_utf8 fuse sco bridge stp bnep l2cap bluetooth sunrpc nf_conntrack_netbios_ns nf_conntrack_ftp ip6t_REJECT nf_conntrack_ipv6 ip6table_filter ip6_tables ipv6 cpufreq_ondemand acpi_cpufreq freq_table xfs lgdt330x dm_multipath cx88_dvb cx88_vp3054_i2c uinput tda9887 tda8290 snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_midi_emul tuner_simple tuner_types tuner msp3400 cx8800 cx88_alsa cx8802 snd_emu10k1 cx88xx snd_rawmidi snd_ac97_codec ir_common ac97_bus saa7115 snd_seq_dummy snd_seq_oss snd_seq_midi_event videobuf_dvb snd_seq dvb_core snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_device videobuf_dma_sg ppdev parport_pc snd_timer videobuf_core snd_page_alloc btcx_risc emu10k1_gp ivtv i2c_algo_bit cx2341x snd_util_mem snd_hwdep nvidia(P) gameport v4l2_common i2c_i801 snd soundcore parport videodev v4l1_compat v4l2_compat_ioctl32 tveeprom i2c_core pcspkr iTCO_wdt iTCO_vendor_support sky2 joydev floppy shpchp ata_generic pata_acpi pata_jmicron [last unloaded: microcode]
    Pid: 3553, comm: kdvb-ad-0-fe-0 Tainted: P 2.6.27.9-159.fc10.x86_64 #1
    RIP: 0010:[] [] simple_dvb_calc_regs+0xab/0x281 [tuner_simple]
    RSP: 0018:ffff8800605dfd30 EFLAGS: 00010246
    RAX: 000000000365c040 RBX: ffff8800605dfdb0 RCX: ffff88007acb8c10
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000246
    RBP: ffff8800605dfda0 R08: ffff8800605dfba0 R09: 0000000000000082
    R10: 00000010e73c9df1 R11: 0000000100000000 R12: ffff88007ac29c00
    R13: ffff88007ac29c00 R14: ffff88007acbb408 R15: ffffffffa09b6fb0
    FS: 0000000000000000(0000) GS:ffff88007f804880(0000) knlGS:0000000000000000
    CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
    CR2: 00000000004e8f40 CR3: 000000007114e000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process kdvb-ad-0-fe-0 (pid: 3553, threadinfo ffff8800605de000, task ffff88006fca0000)
    Stack: ffff8800605dfd40 00000000ffffffa1 ffff88007c055860 0000000000000001
    ffff8800605dfda0 ffff8800605dfda0 ffff88007acb8c10 ffffffffa004e48c
    8e01880000000390 ffff88007acb8c10 ffff88007ac29c00 0000000000000000
    Call Trace:
    [] ? i2c_transfer+0x80/0x8b [i2c_core]
    [] simple_dvb_set_params+0x3e/0x9b [tuner_simple]
    [] lgdt330x_set_parameters+0x188/0x1b9 [lgdt330x]
    [] dvb_frontend_swzigzag_autotune+0x18e/0x1b5 [dvb_core]
    [] dvb_frontend_swzigzag+0x1bc/0x21e [dvb_core]
    [] dvb_frontend_thread+0x528/0x62b [dvb_core]
    [] ? autoremove_wake_function+0x0/0x38
    [] ? dvb_frontend_thread+0x0/0x62b [dvb_core]
    [] kthread+0x49/0x76
    [] child_rip+0xa/0x11
    [] ? restore_args+0x0/0x30
    [] ? kthread+0x0/0x76
    [] ? child_rip+0x0/0x11

    Code: 48 8b 05 2a 4e 00 00 41 8b 77 1c 31 d2 0f b7 40 0a 89 f1 03 45 d0 d1 e9 03 0d 23 4e 00 00 69 c0 24 f4 00 00 8d 04 01 48 8b 4d c0 f6 8a 55 d6 88 53 04 41 89 c4 c1 e8 08 88 43 01 8a 45 d7 44
    RIP [] simple_dvb_calc_regs+0xab/0x281 [tuner_simple]
    RSP

    Signed-off-by: Michael Krufky
    Signed-off-by: Mauro Carvalho Chehab

    Michael Krufky
     
  • The GPIO logic for LNA control on the Tiger r2 devices was inverted.
    This patch corrects the problem.

    Signed-off-by: Michael Krufky
    Signed-off-by: Mauro Carvalho Chehab

    Michael Krufky
     
  • negative gpio values signify inverted polarity

    Signed-off-by: Michael Krufky
    Signed-off-by: Mauro Carvalho Chehab

    Michael Krufky
     
  • Report to userspace that cx24116 and stv0899 drivers support DVB-S2.

    Signed-off by: Klaus Schmidinger

    Acked-by: Steven Toth
    Signed-off-by: Mauro Carvalho Chehab

    Klaus Schmidinger
     
  • Some devices require different setups on struct_audio. Due to that, we
    may need to change some fields at dev.adev during device probe. So, this
    patch moves the dynamic memory allocation of adev at em28xx-alsa to the
    dynamic allocation of struct em28xx dev that happens during device
    probe.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • This patch fixes autodetection for Avermedia AVerTV GO 007 FM Plus (M15C)
    (PCI ID 1461:f31d).

    Signed-off-by: Pham Thanh Nam
    Signed-off-by: Mauro Carvalho Chehab

    Pham Thanh Nam
     
  • em2710 uses the same chip ID as em2820 (0x12).

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Signed-off-by: Mark Lord
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    [tobias.lorenz@gmx.net: Code beautifications and documentation added]
    Signed-off-by: Tobias Lorenz
    Signed-off-by: Mauro Carvalho Chehab

    Mark Lord
     
  • This patch adds support for Avermedia AVer TV GO 007 FM Plus (M15C) on
    saa7134 driver (PCI ID 1461:f31d).

    Signed-off-by: Pham Thanh Nam
    Signed-off-by: Mauro Carvalho Chehab

    Pham Thanh Nam
     
  • Add support for radio driver TEA5764 from NXP.
    This chip is connected in pxa I2C bus in EZX phones
    from Motorola, the chip is used in phone model A1200.
    This driver is for OpenEZX project (www.openezx.org)
    Tested with A1200 phone, openezx kernel and fm-tools

    [mchehab@redhat.com: Fixed CodingStyle and solved some merge conflicts]
    Signed-off-by: Fabio Belavenuto
    Signed-off-by: Mauro Carvalho Chehab

    Fabio Belavenuto
     
  • Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov
    Signed-off-by: Mauro Carvalho Chehab

    Dmitri Belimov
     
  • Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov
    Signed-off-by: Mauro Carvalho Chehab

    Dmitri Belimov
     
  • Fix I2C bridge error in zl10353 if no tunner attached to internal I2C
    bus of zl10353 chip.

    When set enable bridge from internal I2C bus to the main I2C bus
    (saa7134) the main I2C bus stopped very hardly. No any communication. In
    our next board we solder additional resistors to internal I2C bus.

    Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov
    Signed-off-by: Mauro Carvalho Chehab

    Dmitri Belimov
     
  • Since ttusb_dec.c relies on pci_alloc_consistent and
    pci_free_consistent, make it depend on PCI in Kconfig.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Mauro Carvalho Chehab

    Mike Frysinger
     
  • Since dvb-ttusb-budget.c relies on pci_alloc_consistent and
    pci_free_consistent, make it depend on PCI in Kconfig.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Mauro Carvalho Chehab

    Mike Frysinger
     
  • Unsigned cx23417_mailbox cannot be negative

    Signed-off-by: Roel Kluin
    Signed-off-by: Mauro Carvalho Chehab

    roel kluin
     
  • Add missed MODULE check to eliminate inapropriate
    declaration being choosed which causes a build error.

    Signed-off-by: Cyrill Gorcunov
    Signed-off-by: Mauro Carvalho Chehab

    Cyrill Gorcunov
     
  • Since the i2c driver ID will be removed in the near future we have to
    modify the v4l2 debugging API to use the driver name instead of driver ID.

    Note that this API is not used in applications other than v4l2-dbg.cpp
    as it is for debugging and testing only.

    Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged
    with a warning that it is deprecated and will be removed in 2.6.30.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • This rename prevents conflicts with the older compat_ioctl32 module.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Since internal to v4l2 the ioctl prototype is the same regardless of it
    being called through .ioctl or .unlocked_ioctl, we need to convert it all
    to the long return type of unlocked_ioctl.

    Thanks to Jean-Francois Moine for posting an initial patch for this and
    thus bringing it to our attention.

    Cc: Jean-Francois Moine
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Add CONFIG_COMPAT check in Makefile.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Introduce a struct v4l2_file_operations for v4l2 drivers.

    Remove the unnecessary inode argument.

    Move compat32 handling (and llseek) into the v4l2-dev core: this is now
    handled in the v4l2 core and no longer in the drivers themselves.

    Note that this changeset reverts an earlier patch that changed the return
    type of__video_ioctl2 from int to long. This change will be reinstated
    later in a much improved version.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

31 Dec, 2008

2 commits

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (583 commits)
    V4L/DVB (10130): use USB API functions rather than constants
    V4L/DVB (10129): dvb: remove deprecated use of RW_LOCK_UNLOCKED in frontends
    V4L/DVB (10128): modify V4L documentation to be a valid XHTML
    V4L/DVB (10127): stv06xx: Avoid having y unitialized
    V4L/DVB (10125): em28xx: Don't do AC97 vendor detection for i2s audio devices
    V4L/DVB (10124): em28xx: expand output formats available
    V4L/DVB (10123): em28xx: fix reversed definitions of I2S audio modes
    V4L/DVB (10122): em28xx: don't load em28xx-alsa for em2870 based devices
    V4L/DVB (10121): em28xx: remove worthless Pinnacle PCTV HD Mini 80e device profile
    V4L/DVB (10120): em28xx: remove redundant Pinnacle Dazzle DVC 100 profile
    V4L/DVB (10119): em28xx: fix corrupted XCLK value
    V4L/DVB (10118): zoran: fix warning for a variable not used
    V4L/DVB (10116): af9013: Fix gcc false warnings
    V4L/DVB (10111a): usbvideo.h: remove an useless blank line
    V4L/DVB (10111): quickcam_messenger.c: fix a warning
    V4L/DVB (10110): v4l2-ioctl: Fix warnings when using .unlocked_ioctl = __video_ioctl2
    V4L/DVB (10109): anysee: Fix usage of an unitialized function
    V4L/DVB (10104): uvcvideo: Add support for video output devices
    V4L/DVB (10102): uvcvideo: Ignore interrupt endpoint for built-in iSight webcams.
    V4L/DVB (10101): uvcvideo: Fix bulk URB processing when the header is erroneous
    ...

    Linus Torvalds
     
  • * 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (407 commits)
    [ARM] pxafb: add support for overlay1 and overlay2 as framebuffer devices
    [ARM] pxafb: cleanup of the timing checking code
    [ARM] pxafb: cleanup of the color format manipulation code
    [ARM] pxafb: add palette format support for LCCR4_PAL_FOR_3
    [ARM] pxafb: add support for FBIOPAN_DISPLAY by dma braching
    [ARM] pxafb: allow pxafb_set_par() to start from arbitrary yoffset
    [ARM] pxafb: allow video memory size to be configurable
    [ARM] pxa: add document on the MFP design and how to use it
    [ARM] sa1100_wdt: don't assume CLOCK_TICK_RATE to be a constant
    [ARM] rtc-sa1100: don't assume CLOCK_TICK_RATE to be a constant
    [ARM] pxa/tavorevb: update board support (smartpanel LCD + keypad)
    [ARM] pxa: Update eseries defconfig
    [ARM] 5352/1: add w90p910-plat config file
    [ARM] s3c: S3C options should depend on PLAT_S3C
    [ARM] mv78xx0: implement GPIO and GPIO interrupt support
    [ARM] Kirkwood: implement GPIO and GPIO interrupt support
    [ARM] Orion: share GPIO IRQ handling code
    [ARM] Orion: share GPIO handling code
    [ARM] s3c: define __io using the typesafe version
    [ARM] S3C64XX: Ensure CPU_V6 is selected
    ...

    Linus Torvalds
     

30 Dec, 2008

8 commits

  • This set of patches introduces calls to the following set of functions:

    usb_endpoint_dir_in(epd)
    usb_endpoint_dir_out(epd)
    usb_endpoint_is_bulk_in(epd)
    usb_endpoint_is_bulk_out(epd)
    usb_endpoint_is_int_in(epd)
    usb_endpoint_is_int_out(epd)
    usb_endpoint_is_isoc_in(epd)
    usb_endpoint_is_isoc_out(epd)
    usb_endpoint_num(epd)
    usb_endpoint_type(epd)
    usb_endpoint_xfer_bulk(epd)
    usb_endpoint_xfer_control(epd)
    usb_endpoint_xfer_int(epd)
    usb_endpoint_xfer_isoc(epd)

    In some cases, introducing one of these functions is not possible, and it
    just replaces an explicit integer value by one of the following constants:

    USB_ENDPOINT_XFER_BULK
    USB_ENDPOINT_XFER_CONTROL
    USB_ENDPOINT_XFER_INT
    USB_ENDPOINT_XFER_ISOC

    An extract of the semantic patch that makes these changes is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r1@ struct usb_endpoint_descriptor *epd; @@

    - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
    - \(USB_ENDPOINT_XFER_CONTROL\|0\))
    + usb_endpoint_xfer_control(epd)

    @r5@ struct usb_endpoint_descriptor *epd; @@

    - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
    - \(USB_DIR_IN\|0x80\))
    + usb_endpoint_dir_in(epd)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall
     
  • Impact: clean up

    RW_LOCK_UNLOCKED is deprecated. This patch replaces it with the
    __RW_LOCK_UNLOCKED(lock) macro. This change was a little trickier than
    others due to the macro being used in another macro that fills an array.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Mauro Carvalho Chehab

    Steven Rostedt
     
  • As pointed by gcc:

    drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c: In function ‘hdcs_set_size’:
    drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c:301: warning: ‘y’ may be used uninitialized in this function

    Signed-off-by: Erik Andrén
    Signed-off-by: Mauro Carvalho Chehab

    Erik Andrén
     
  • The current code was trying to query the AC97 registers for the vendor
    information even if it was clearly not a AC97 audio device (resulting in errors
    in the dmesg output). This was due to a bug in the way we did the check.

    Signed-off-by: Devin Heitmueller
    Signed-off-by: Mauro Carvalho Chehab

    Devin Heitmueller
     
  • Add additional output formats, which will be useful for the Pinnacle PCTV
    Ultimate 880e integration with the saa7136.

    Thanks to Ray Lu from Empia for providing the em2860/em2880 datasheet.

    Signed-off-by: Devin Heitmueller
    Signed-off-by: Mauro Carvalho Chehab

    Devin Heitmueller
     
  • Noticed when doing the audio support for the Pinnacle PCTV HD Ultimate 808e
    that the modes were incorrect (the 808e uses I2S in 5 sample mode)

    Thanks for Ray Lu from Empia for providing the em2860/em2880 datasheet.

    Signed-off-by: Devin Heitmueller
    Signed-off-by: Mauro Carvalho Chehab

    Devin Heitmueller
     
  • Like the em2874, the em2870 does not have any analog support, so don't bother
    loading the em28xx-alsa module.

    Signed-off-by: Devin Heitmueller
    Signed-off-by: Mauro Carvalho Chehab

    Devin Heitmueller
     
  • The Pinnacle 80e cannot be supported since Micronas yanked their driver
    support for the drx-j chipset at the last minute. Remove the device profile
    since it cannot work without the drx driver and it being there is only likely
    to confuse people into thinking the device is supported but not working.

    Signed-off-by: Devin Heitmueller
    Signed-off-by: Mauro Carvalho Chehab

    Devin Heitmueller