29 May, 2020

1 commit

  • If user change mode from 2592x1944@8 to 1080P@30, ov5640 driver
    will report error which can't support 1080P@8. It means driver
    can't update frame rate immediately. So remove mode info checking
    during find mode. Driver will check the info before start streaming
    that resolution and frame rate have updated.

    Signed-off-by: Guoniu.zhou
    (cherry picked from commit 6dd746e4d51692921babf4eaa1c275d619699aa9)

    Guoniu.zhou
     

29 Apr, 2020

1 commit


25 Mar, 2020

1 commit


11 Mar, 2020

1 commit


08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

05 Mar, 2020

1 commit

  • Ring buffer will flush if set the error when overflow. The ring
    buffer in our case is always full as our source is from file,
    not tuner. So we need disable flush and send data to ring buffer
    again if ring buffer full. Please revert the patch if use real
    tuner.

    Signed-off-by: Bing Song
    Reviewed-by: Jian Li
    Reviewed-by: Zhou Peng

    Bing Song
     

24 Feb, 2020

8 commits

  • [ Upstream commit 1dd2e8f942574e2be18374ebb81751082d8d467c ]

    This device does not function correctly in raw mode in kernel
    versions validating buffer sizes in bulk mode. It erroneously
    announces 16 bits per pixel instead of 12 for NV12 format, so it
    needs this quirk to fix computed frame size and avoid legitimate
    frames getting discarded.

    [Move info and div variables to local scope]

    Signed-off-by: Sergey Zakharchenko
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Sergey Zakharchenko
     
  • [ Upstream commit dc4cac67e13515835ed8081d510aa507aacb013b ]

    The AVerMedia CE310B is a simple composite + S-Video + stereo audio
    capture card, and uses only the CX23888 to perform all of these
    functions.

    I've tested both video inputs and the audio interface and confirmed that
    they're all working. However, there are some issues:

    * Sometimes when I switch inputs the video signal turns black and can't
    be recovered until the system is rebooted. I haven't been able to
    determine the cause of this behavior, nor have I found a solution to
    fix it or any workarounds other than rebooting.
    * The card sometimes seems to have trouble syncing to the video signal,
    and some of the VBI data appears as noise at the top of the frame, but
    I assume that to be a result of my very noisy RF environment and the
    card's unshielded input traces rather than a configuration issue.

    Signed-off-by: Forest Crossman
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Forest Crossman
     
  • [ Upstream commit bb6d42061a05d71dd73f620582d9e09c8fbf7f5b ]

    The driver may sleep while holding a spinlock.
    The function call path (from bottom to top) in Linux 4.19 is:

    drivers/media/platform/sti/bdisp/bdisp-hw.c, 385:
    msleep in bdisp_hw_reset
    drivers/media/platform/sti/bdisp/bdisp-v4l2.c, 341:
    bdisp_hw_reset in bdisp_device_run
    drivers/media/platform/sti/bdisp/bdisp-v4l2.c, 317:
    _raw_spin_lock_irqsave in bdisp_device_run

    To fix this bug, msleep() is replaced with udelay().

    This bug is found by a static analysis tool STCheck written by myself.

    Signed-off-by: Jia-Ju Bai
    Reviewed-by: Fabien Dessenne
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Jia-Ju Bai
     
  • [ Upstream commit 1948dcf0f928b8bcdca57ca3fba8545ba380fc29 ]

    The Allwinner camera sensor interface has a different definition of
    [HV]sync. While the timing diagram uses the names HSYNC and VSYNC,
    the note following the diagram and register names use HREF and VREF.
    Combined they imply the hardware uses either [HV]REF or inverted
    [HV]SYNC. There are also registers to set horizontal skip lengths
    in pixels and vertical skip lengths in lines, also known as back
    porches.

    Fix the polarity handling by using the opposite polarity flag for
    the checks. Also rename `[hv]sync_pol` to `[hv]ref_pol` to better
    match the hardware register description.

    Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")
    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Chen-Yu Tsai
     
  • [ Upstream commit cf9e6d5dbdd56ef2aa72f28c806711c4293c8848 ]

    The CLK_POL field specifies whether data is sampled on the falling or
    rising edge of PCLK, not whether the data lines are active high or low.
    Evidence of this can be found in the timing diagram labeled "horizontal
    size setting and pixel clock timing".

    Fix the setting by checking the correct flag, V4L2_MBUS_PCLK_SAMPLE_RISING.
    While at it, reorder the three polarity flag checks so HSYNC and VSYNC
    are grouped together.

    Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")
    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Chen-Yu Tsai
     
  • [ Upstream commit 249b286171fa9c358e8d5c825b48c4ebea97c498 ]

    On Allwinner SoCs, some high memory bandwidth devices do DMA directly
    over the memory bus (called MBUS), instead of the system bus. These
    devices include the CSI camera sensor interface, video (codec) engine,
    display subsystem, etc.. The memory bus has a different addressing
    scheme without the DRAM starting offset.

    Deal with this using the "interconnects" property from the device tree,
    or if that is not available, set dev->dma_pfn_offset to PHYS_PFN_OFFSET.

    Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")
    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Chen-Yu Tsai
     
  • [ Upstream commit 1451d5ae351d938a0ab1677498c893f17b9ee21d ]

    This driver supports both the mt9v032 (color) and the mt9v022 (mono)
    sensors. Depending on which sensor is used, the format from the sensor is
    different. The format.code inside the dev struct holds this information.
    The enum mbus and enum frame sizes need to take into account both type of
    sensors, not just the color one. To solve this, use the format.code in
    these functions instead of the hardcoded bayer color format (which is only
    used for mt9v032).

    [Sakari Ailus: rewrapped commit message]

    Suggested-by: Wenyou Yang
    Signed-off-by: Eugen Hristev
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Eugen Hristev
     
  • [ Upstream commit 2e3df204f9af42a47823ee955c08950373417420 ]

    The variable _rate is by ov5640_compute_sys_clk() which returns
    zero if the PLL exceeds 1GHz. Unfortunately, the check to see
    if the max PLL1 output is checking 'rate' and not '_rate' and
    'rate' does not ever appear to be 0.

    This patch changes the check against the returned value of
    '_rate' to determine if the PLL1 output exceeds 1GHz.

    Fixes: aa2882481cad ("media: ov5640: Adjust the clock based on the expected rate")
    Signed-off-by: Adam Ford
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Adam Ford
     

15 Feb, 2020

1 commit

  • commit 0d962e061abcf1b9105f88fb850158b5887fbca3 upstream.

    Enclose multiple macro parameters in parentheses in order to
    make such macros safer and fix the Clang warning below:

    drivers/media/i2c/adv748x/adv748x-afe.c:452:12: warning: operator '?:'
    has lower precedence than '|'; '|' will be evaluated first
    [-Wbitwise-conditional-parentheses]

    ret = sdp_clrset(state, ADV748X_SDP_FRP, ADV748X_SDP_FRP_MASK, enable
    ? ctrl->val - 1 : 0);

    Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver")
    Reported-by: Dmitry Vyukov
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kieran Bingham
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

11 Feb, 2020

5 commits

  • commit 080d89f522e2baddb4fbbd1af4b67b5f92537ef8 upstream.

    Once rc_open is called on the input device, lirc events can be delivered.
    Ensure lirc is ready to do so else we might get this:

    Registered IR keymap rc-hauppauge
    rc rc0: Hauppauge WinTV PVR-350 as
    /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/i2c-0/0-0018/rc/rc0
    input: Hauppauge WinTV PVR-350 as
    /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/i2c-0/0-0018/rc/rc0/input9
    BUG: kernel NULL pointer dereference, address: 0000000000000038
    PGD 0 P4D 0
    Oops: 0000 [#1] SMP PTI
    CPU: 1 PID: 17 Comm: kworker/1:0 Not tainted 5.3.11-300.fc31.x86_64 #1
    Hardware name: /DG43NB, BIOS NBG4310H.86A.0096.2009.0903.1845 09/03/2009
    Workqueue: events ir_work [ir_kbd_i2c]
    RIP: 0010:ir_lirc_scancode_event+0x3d/0xb0
    Code: a6 b4 07 00 00 49 81 c6 b8 07 00 00 55 53 e8 ba a7 9d ff 4c 89
    e7 49 89 45 00 e8 5e 7a 25 00 49 8b 1e 48 89 c5 4c 39 f3 74 58 43
    38 8b 53 40 89 c1 2b 4b 3c 39 ca 72 41 21 d0 49 8b 7d 00 49
    RSP: 0018:ffffaae2000b3d88 EFLAGS: 00010017
    RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000000019
    RDX: 0000000000000001 RSI: 006e801b1f26ce6a RDI: ffff9e39797c37b4
    RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000001
    R10: 0000000000000001 R11: 0000000000000001 R12: ffff9e39797c37b4
    R13: ffffaae2000b3db8 R14: ffff9e39797c37b8 R15: ffff9e39797c33d8
    FS: 0000000000000000(0000) GS:ffff9e397b680000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000038 CR3: 0000000035844000 CR4: 00000000000006e0
    Call Trace:
    ir_do_keydown+0x8e/0x2b0
    rc_keydown+0x52/0xc0
    ir_work+0xb8/0x130 [ir_kbd_i2c]
    process_one_work+0x19d/0x340
    worker_thread+0x50/0x3b0
    kthread+0xfb/0x130
    ? process_one_work+0x340/0x340
    ? kthread_park+0x80/0x80
    ret_from_fork+0x35/0x40
    Modules linked in: rc_hauppauge tuner msp3400 saa7127 saa7115 ivtv(+)
    tveeprom cx2341x v4l2_common videodev mc i2c_algo_bit ir_kbd_i2c
    ip_tables firewire_ohci e1000e serio_raw firewire_core ata_generic
    crc_itu_t pata_acpi pata_jmicron fuse
    CR2: 0000000000000038
    ---[ end trace c67c2697a99fa74b ]---
    RIP: 0010:ir_lirc_scancode_event+0x3d/0xb0
    Code: a6 b4 07 00 00 49 81 c6 b8 07 00 00 55 53 e8 ba a7 9d ff 4c 89
    e7 49 89 45 00 e8 5e 7a 25 00 49 8b 1e 48 89 c5 4c 39 f3 74 58 43
    38 8b 53 40 89 c1 2b 4b 3c 39 ca 72 41 21 d0 49 8b 7d 00 49
    RSP: 0018:ffffaae2000b3d88 EFLAGS: 00010017
    RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000000019
    RDX: 0000000000000001 RSI: 006e801b1f26ce6a RDI: ffff9e39797c37b4
    RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000001
    R10: 0000000000000001 R11: 0000000000000001 R12: ffff9e39797c37b4
    R13: ffffaae2000b3db8 R14: ffff9e39797c37b8 R15: ffff9e39797c33d8
    FS: 0000000000000000(0000) GS:ffff9e397b680000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000038 CR3: 0000000035844000 CR4: 00000000000006e0
    rc rc0: lirc_dev: driver ir_kbd_i2c registered at minor = 0, scancode
    receiver, no transmitter
    tuner-simple 0-0061: creating new instance
    tuner-simple 0-0061: type set to 2 (Philips NTSC (FI1236,FM1236 and
    compatibles))
    ivtv0: Registered device video0 for encoder MPG (4096 kB)
    ivtv0: Registered device video32 for encoder YUV (2048 kB)
    ivtv0: Registered device vbi0 for encoder VBI (1024 kB)
    ivtv0: Registered device video24 for encoder PCM (320 kB)
    ivtv0: Registered device radio0 for encoder radio
    ivtv0: Registered device video16 for decoder MPG (1024 kB)
    ivtv0: Registered device vbi8 for decoder VBI (64 kB)
    ivtv0: Registered device vbi16 for decoder VOUT
    ivtv0: Registered device video48 for decoder YUV (1024 kB)

    Cc: stable@vger.kernel.org
    Tested-by: Nick French
    Reported-by: Nick French
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Sean Young
     
  • commit 1b257870a78b0a9ce98fdfb052c58542022ffb5b upstream.

    Make sure to use the current alternate setting, which need not be the
    first one by index, when verifying the endpoint descriptors and
    initialising the URBs.

    Failing to do so could cause the driver to misbehave or trigger a WARN()
    in usb_submit_urb() that kernels with panic_on_warn set would choke on.

    Fixes: 26ff63137c45 ("[media] Add support for the IguanaWorks USB IR Transceiver")
    Fixes: ab1cbdf159be ("media: iguanair: add sanity checks")
    Cc: stable # 3.6
    Cc: Oliver Neukum
    Signed-off-by: Johan Hovold
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit 4a873f3fa5d6ca52e446d306dd7194dd86a09422 upstream.

    The do_video_ioctl() compat handler converts the compat command
    codes into the native ones before processing further, but this
    causes problems for 32-bit user applications that pass a command
    code that matches a 64-bit native number, which will then be
    handled the same way.

    Specifically, this breaks VIDIOC_DQEVENT_TIME from user space
    applications with 64-bit time_t, as the structure layout is
    the same as the native 64-bit layout on many architectures
    (x86 being the notable exception).

    Change the handler to use the converted command code only for
    passing into the native ioctl handler, not for deciding on the
    conversion, in order to make the compat behavior match the
    native behavior.

    Actual support for the 64-bit time_t version of VIDIOC_DQEVENT_TIME
    and other commands still needs to be added in a separate patch.

    Cc: stable@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 3c7470b6f68434acae459482ab920d1e3fabd1c7 upstream.

    After DMA is complete, and the device and CPU caches are synchronized,
    it's still required to mark the CPU pages as dirty, if the data was
    coming from the device. However, this driver was just issuing a bare
    put_page() call, without any set_page_dirty*() call.

    Fix the problem, by calling set_page_dirty_lock() if the CPU pages were
    potentially receiving data from the device.

    Link: http://lkml.kernel.org/r/20200107224558.2362728-11-jhubbard@nvidia.com
    Signed-off-by: John Hubbard
    Reviewed-by: Christoph Hellwig
    Acked-by: Hans Verkuil
    Cc: Mauro Carvalho Chehab
    Cc:
    Cc: Alex Williamson
    Cc: Aneesh Kumar K.V
    Cc: Björn Töpel
    Cc: Daniel Vetter
    Cc: Dan Williams
    Cc: Ira Weiny
    Cc: Jan Kara
    Cc: Jason Gunthorpe
    Cc: Jason Gunthorpe
    Cc: Jens Axboe
    Cc: Jerome Glisse
    Cc: Jonathan Corbet
    Cc: Kirill A. Shutemov
    Cc: Leon Romanovsky
    Cc: Mike Rapoport
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    John Hubbard
     
  • commit 68035c80e129c4cfec659aac4180354530b26527 upstream.

    Way back in 2017, fuzzing the 4.14-rc2 USB stack with syzkaller kicked
    up the following WARNING from the UVC chain scanning code:

    | list_add double add: new=ffff880069084010, prev=ffff880069084010,
    | next=ffff880067d22298.
    | ------------[ cut here ]------------
    | WARNING: CPU: 1 PID: 1846 at lib/list_debug.c:31 __list_add_valid+0xbd/0xf0
    | Modules linked in:
    | CPU: 1 PID: 1846 Comm: kworker/1:2 Not tainted
    | 4.14.0-rc2-42613-g1488251d1a98 #238
    | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    | Workqueue: usb_hub_wq hub_event
    | task: ffff88006b01ca40 task.stack: ffff880064358000
    | RIP: 0010:__list_add_valid+0xbd/0xf0 lib/list_debug.c:29
    | RSP: 0018:ffff88006435ddd0 EFLAGS: 00010286
    | RAX: 0000000000000058 RBX: ffff880067d22298 RCX: 0000000000000000
    | RDX: 0000000000000058 RSI: ffffffff85a58800 RDI: ffffed000c86bbac
    | RBP: ffff88006435dde8 R08: 1ffff1000c86ba52 R09: 0000000000000000
    | R10: 0000000000000002 R11: 0000000000000000 R12: ffff880069084010
    | R13: ffff880067d22298 R14: ffff880069084010 R15: ffff880067d222a0
    | FS: 0000000000000000(0000) GS:ffff88006c900000(0000) knlGS:0000000000000000
    | CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    | CR2: 0000000020004ff2 CR3: 000000006b447000 CR4: 00000000000006e0
    | Call Trace:
    | __list_add ./include/linux/list.h:59
    | list_add_tail+0x8c/0x1b0 ./include/linux/list.h:92
    | uvc_scan_chain_forward.isra.8+0x373/0x416
    | drivers/media/usb/uvc/uvc_driver.c:1471
    | uvc_scan_chain drivers/media/usb/uvc/uvc_driver.c:1585
    | uvc_scan_device drivers/media/usb/uvc/uvc_driver.c:1769
    | uvc_probe+0x77f2/0x8f00 drivers/media/usb/uvc/uvc_driver.c:2104

    Looking into the output from usbmon, the interesting part is the
    following data packet:

    ffff880069c63e00 30710169 C Ci:1:002:0 0 143 = 09028f00 01030080
    00090403 00000e01 00000924 03000103 7c003328 010204db

    If we drop the lead configuration and interface descriptors, we're left
    with an output terminal descriptor describing a generic display:

    /* Output terminal descriptor */
    buf[0] 09
    buf[1] 24
    buf[2] 03 /* UVC_VC_OUTPUT_TERMINAL */
    buf[3] 00 /* ID */
    buf[4] 01 /* type == 0x0301 (UVC_OTT_DISPLAY) */
    buf[5] 03
    buf[6] 7c
    buf[7] 00 /* source ID refers to self! */
    buf[8] 33

    The problem with this descriptor is that it is self-referential: the
    source ID of 0 matches itself! This causes the 'struct uvc_entity'
    representing the display to be added to its chain list twice during
    'uvc_scan_chain()': once via 'uvc_scan_chain_entity()' when it is
    processed directly from the 'dev->entities' list and then again
    immediately afterwards when trying to follow the source ID in
    'uvc_scan_chain_forward()'

    Add a check before adding an entity to a chain list to ensure that the
    entity is not already part of a chain.

    Link: https://lore.kernel.org/linux-media/CAAeHK+z+Si69jUR+N-SjN9q4O+o5KFiNManqEa-PjUta7EOb7A@mail.gmail.com/

    Cc:
    Fixes: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver")
    Reported-by: Andrey Konovalov
    Signed-off-by: Will Deacon
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Will Deacon
     

06 Feb, 2020

5 commits

  • commit 569bc8d6a6a50acb5fcf07fb10b8d2d461fdbf93 upstream.

    This fixes a syzbot failure since actlen could be uninitialized,
    but it was still used.

    Syzbot link:

    https://syzkaller.appspot.com/bug?extid=6bf9606ee955b646c0e1

    Reported-and-tested-by: syzbot+6bf9606ee955b646c0e1@syzkaller.appspotmail.com

    Signed-off-by: Hans Verkuil
    Acked-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Hans Verkuil
     
  • commit de89d0864f66c2a1b75becfdd6bf3793c07ce870 upstream.

    Allocate gspca_dev->usb_buf with kzalloc instead of kmalloc to
    ensure it is property zeroed. This fixes various syzbot errors
    about uninitialized data.

    Syzbot links:

    https://syzkaller.appspot.com/bug?extid=32310fc2aea76898d074
    https://syzkaller.appspot.com/bug?extid=99706d6390be1ac542a2
    https://syzkaller.appspot.com/bug?extid=64437af5c781a7f0e08e

    Reported-and-tested-by: syzbot+32310fc2aea76898d074@syzkaller.appspotmail.com
    Reported-and-tested-by: syzbot+99706d6390be1ac542a2@syzkaller.appspotmail.com
    Reported-and-tested-by: syzbot+64437af5c781a7f0e08e@syzkaller.appspotmail.com

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Hans Verkuil
     
  • commit 26cff637121d8bb866ebd6515c430ac890e6ec80 upstream.

    It is not a fatal error if reading the mac address or the remote control
    decoder state fails.

    Reported-by: syzbot+ec869945d3dde5f33b43@syzkaller.appspotmail.com
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Sean Young
     
  • commit 51d0c99b391f0cac61ad7b827c26f549ee55672c upstream.

    If usb_bulk_msg() fails, actual_length can be uninitialized.

    Reported-by: syzbot+9d42b7773d2fecd983ab@syzkaller.appspotmail.com
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Sean Young
     
  • commit eecc70d22ae51225de1ef629c1159f7116476b2e upstream.

    This results in an uninitialized variable read.

    Reported-by: syzbot+6bf9606ee955b646c0e1@syzkaller.appspotmail.com
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Sean Young
     

01 Feb, 2020

1 commit

  • [ Upstream commit 14494583336880640654300c76d0f5df3360d85f ]

    Adds USB ID for the eyeTV Geniatech T2 lite to the dvbsky driver.
    This is a Geniatech T230C based stick without IR and a different USB ID.

    Signed-off-by: Thomas Voegtle
    Tested-by: Jan Pieter van Woerkom
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Thomas Voegtle
     

29 Jan, 2020

1 commit

  • commit ee8951e56c0f960b9621636603a822811cef3158 upstream.

    v4l2_vbi_format, v4l2_sliced_vbi_format and v4l2_sdr_format
    have a reserved array at the end that should be zeroed by drivers
    as per the V4L2 spec. Older drivers often do not do this, so just
    handle this in the core.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Hans Verkuil
     

18 Jan, 2020

9 commits

  • commit c3df30a01da4955e04fa068c503cd784b31dad92 upstream.

    In the implementation of aspeed_video_probe() the allocated memory for
    video should be released if either devm_ioremap_resource()
    or aspeed_video_init() or aspeed_video_setup_video() fails. Replace
    kzalloc() with devm_kzalloc to avoid explicit release for video.

    Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver")
    Signed-off-by: Navid Emamdoost
    Reviewed-by: Jae Hyun Yoo
    Reviewed-by: Eddie James
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Navid Emamdoost
     
  • commit a3fd80198de6ab98a205cf7fb148d88e9e1c44bb upstream.

    The BIT decoder picture run temporarily locks the bitstream mutex while
    the coda device mutex is locked, to refill the bitstream ring buffer.
    Consequently, the decoder start command, which locks both mutexes when
    flushing the bitstream ring buffer, must lock the coda device mutex
    first as well, to avoid an ABBA deadlock.

    Fixes: e7fd95849b3c ("media: coda: flush bitstream ring buffer on decoder restart")
    Signed-off-by: Philipp Zabel
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Philipp Zabel
     
  • commit 704c6c80fb471d1bb0ef0d61a94617d1d55743cd upstream.

    >From isp_video_release(), &isp->video_lock is held and subsequent
    vb2_fop_release() tries to lock vdev->lock which is same with the
    previous one. Replace vb2_fop_release() with _vb2_fop_release() to
    fix the recursive locking.

    Fixes: 1380f5754cb0 ("[media] videobuf2: Add missing lock held on vb2_fop_release")
    Signed-off-by: Seung-Woo Kim
    Reviewed-by: Sylwester Nawrocki
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Seung-Woo Kim
     
  • commit 2eca8e4c1df4864b937752c3aa2f7925114f4806 upstream.

    The 2nd parameter of 'find_first_zero_bit()' is a number of bits, not of
    bytes. So use 'csi2rx->max_lanes' instead of 'sizeof(lanes_used)'.

    Fixes: 1fc3b37f34f6 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver")
    Signed-off-by: Christophe JAILLET
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Christophe JAILLET
     
  • commit a0862a40364e2f87109317e31c51c9d7bc89e33f upstream.

    While refactoring code the return statement became corrupted, fix it by
    returning the correct return code.

    Reported-by: Kieran Bingham
    Fixes: 897e371389e77514 ("media: rcar-vin: simplify how formats are set and reset"
    Signed-off-by: Niklas Söderlund
    Reviewed-by: Laurent Pinchart
    Reviewed-by: Kieran Bingham
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Niklas Söderlund
     
  • commit 5439fa9263cb293e41168bc03711ec18c4f11cba upstream.

    It is not clear what pixel format is actually configured in hardware on
    reset. MEDIA_BUS_FMT_YUYV8_2X8, assumed on device probe since the
    driver was intiially submitted, is for sure not the one.

    Fix it by explicitly applying a known, driver default frame format just
    after initial device reset.

    Fixes: 2f6e2404799a ("[media] SoC Camera: add driver for OV6650 sensor")
    Signed-off-by: Janusz Krzysztofik
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Janusz Krzysztofik
     
  • commit 39034bb0c26b76a2c3abc54aa28c185f18b40c2f upstream.

    Commit da298c6d98d5 ("[media] v4l2: replace video op g_mbus_fmt by pad
    op get_fmt") converted a former ov6650_g_fmt() video operation callback
    to an ov6650_get_fmt() pad operation callback. However, the converted
    function disregards a format->which flag that pad operations should
    obey and always returns active frame format settings.

    That can be fixed by always responding to V4L2_SUBDEV_FORMAT_TRY with
    -EINVAL, or providing the response from a pad config argument, likely
    updated by a former user call to V4L2_SUBDEV_FORMAT_TRY .set_fmt().
    Since implementation of the latter is trivial, go for it.

    Fixes: da298c6d98d5 ("[media] v4l2: replace video op g_mbus_fmt by pad op get_fmt")
    Signed-off-by: Janusz Krzysztofik
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Janusz Krzysztofik
     
  • commit 1c6a2b63095154bbf9e8f38d79487a728331bf65 upstream.

    User arguments passed to .get/set_fmt() pad operation callbacks may
    contain unsupported values. The driver takes control over frame size
    and pixel code as well as colorspace and field attributes but has never
    cared for remainig format attributes, i.e., ycbcr_enc, quantization
    and xfer_func, introduced by commit 11ff030c7365 ("[media]
    v4l2-mediabus: improve colorspace support"). Fix it.

    Set up a static v4l2_mbus_framefmt structure with attributes
    initialized to reasonable defaults and use it for updating content of
    user provided arguments. In case of V4L2_SUBDEV_FORMAT_ACTIVE,
    postpone frame size update, now performed from inside ov6650_s_fmt()
    helper, util the user argument is first updated in ov6650_set_fmt() with
    default frame format content. For V4L2_SUBDEV_FORMAT_TRY, don't copy
    all attributes to pad config, only those handled by the driver, then
    fill the response with the default frame format updated with resulting
    pad config format code and frame size.

    Fixes: 11ff030c7365 ("[media] v4l2-mediabus: improve colorspace support")
    Signed-off-by: Janusz Krzysztofik
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Janusz Krzysztofik
     
  • commit 12500731895ef09afc5b66b86b76c0884fb9c7bf upstream.

    Since its initial submission, the driver selects V4L2_COLORSPACE_JPEG
    for supported formats other than V4L2_MBUS_FMT_SBGGR8_1X8. According
    to v4l2-compliance test program, V4L2_COLORSPACE_JPEG applies
    exclusively to V4L2_PIX_FMT_JPEG. Since the sensor does not support
    JPEG format, fix it to always select V4L2_COLORSPACE_SRGB.

    Fixes: 2f6e2404799a ("[media] SoC Camera: add driver for OV6650 sensor")
    Signed-off-by: Janusz Krzysztofik
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Janusz Krzysztofik
     

09 Jan, 2020

4 commits

  • commit 2289adbfa559050d2a38bcd9caac1c18b800e928 upstream.

    In af9005_identify_state when returning -EIO the allocated buffer should
    be released. Replace the "return -EIO" with assignment into ret and move
    deb_info() under a check.

    Fixes: af4e067e1dcf ("V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech")
    Signed-off-by: Navid Emamdoost
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Navid Emamdoost
     
  • commit 74a96b51a36de4d86660fbc56b05d86668162d6b upstream.

    An earlier commit hard coded a return 0 to function flexcop_usb_i2c_req
    even though the an -EIO was intended to be returned in the case where
    ret != buflen. Fix this by replacing the return 0 with the return of
    ret to return the error return code.

    Addresses-Coverity: ("Unused value")

    Fixes: b430eaba0be5 ("[media] flexcop-usb: don't use stack for DMA")
    Signed-off-by: Colin Ian King
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     
  • commit ac479b51f3f4aaa852b5d3f00ecfb9290230cf64 upstream.

    Currently wait_event_interruptible_timeout is called in cec_thread_func()
    when adap->transmitting is set. But if the adapter is unconfigured
    while transmitting, then adap->transmitting is set to NULL. But the
    hardware is still actually transmitting the message, and that's
    indicated by adap->transmit_in_progress and we should wait until that
    is finished or times out before transmitting new messages.

    As the original commit says: adap->transmitting is the userspace view,
    adap->transmit_in_progress reflects the hardware state.

    However, if adap->transmitting is NULL and adap->transmit_in_progress
    is true, then wait_event_interruptible is called (no timeout), which
    can get stuck indefinitely if the CEC driver is flaky and never marks
    the transmit-in-progress as 'done'.

    So test against transmit_in_progress when deciding whether to use
    the timeout variant or not, instead of testing against adap->transmitting.

    Signed-off-by: Hans Verkuil
    Fixes: 32804fcb612b ("media: cec: keep track of outstanding transmits")
    Cc: # for v4.19 and up
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Hans Verkuil
     
  • commit 95c29d46ab2a517e4c26d0a07300edca6768db17 upstream.

    WARN if transmit_queue_sz is 0 but do not decrement it.
    The CEC adapter will become unresponsive if it goes below
    0 since then it thinks there are 4 billion messages in the
    queue.

    Obviously this should not happen, but a driver bug could
    cause this.

    Signed-off-by: Hans Verkuil
    Cc: # for v4.12 and up
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Hans Verkuil