1. 03 Jan, 2020 18 commits
    • Bodo Eggert's avatar
      media: serial_ir: change "ignoring spike" to debug level · a04930b7
      Bodo Eggert authored
      At least on my system with a self-made IR receiver, my kernel log is filled
      with:
      
      serial_ir serial_ir.0: ignoring spike: 1 1 1419988034627194ns 1419956080709377ns
      
      These messages happen at random and do not prevent the receiver from
      working. Also I cannot change the features of the IC, therefore they are not
      useful. Probably they are not useful at all.
      
      However they fill the console, they accumulate and fill the dmesg log, by
      doing this, they prevent me from seeing important message.
      Signed-off-by: default avatarBodo Eggert <7eggert@gmx.de>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      a04930b7
    • James Hogan's avatar
      media: MAINTAINERS: Orphan img-ir driver · 31f715dd
      James Hogan authored
      I haven't been active for 18 months, and don't have the hardware set up
      to test the img-ir driver, so mark it as orphaned and remove myself as
      maintainer.
      
      I used to test this driver using a Minimorph board with Meta based
      TZ1090 SoC, but the Meta arch port is long gone from the kernel. The
      only remaining platform in-tree using this driver is the Imagination
      Pistachio SoC, and the only Pistachio based board with DTS in-tree (MIPS
      Creator Ci40) doesn't bring the IR out.
      
      However I presume the IP persists under the guardianship of Sondrel, and
      its possible current & future SoCs/boards may continue to use this IP.
      Signed-off-by: default avatarJames Hogan <jhogan@kernel.org>
      Cc: James Hartley <james.hartley@sondrel.com>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      31f715dd
    • David J. Fiddes's avatar
      media: rtl28xxu: Add support for PROlectrix DV107669 DVB-T dongle · 3fbe1584
      David J. Fiddes authored
      This adds support for the PROlectrix DV107669 DVT-T dongle which
      uses an RTL2832 and FC0012 tuner.
      
      Tests:
       - Verified correct operation of DVB-T reception with VLC across
         several UK multiplexes
      Signed-off-by: default avatarDavid J. Fiddes <D.J@fiddes.net>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      3fbe1584
    • Daniel W. S. Almeida's avatar
      media: dvb_dummy_fe: Add blank line after declaration · 8b9aac1a
      Daniel W. S. Almeida authored
      Fix checkpatch.pl error by adding a blank line
      Signed-off-by: default avatarDaniel W. S. Almeida <dwlsalmeida@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      8b9aac1a
    • Daniel W. S. Almeida's avatar
      media: dvb_dummy_fe: place EXPORT_SYMBOL below corresponding function · 17a529d0
      Daniel W. S. Almeida authored
      dvb_dummy_fe.c had all its EXPORT_SYMBOL macros located at the end of the
      file. Now these are located directly below the symbol they are exporting
      for increased readability.
      Suggested-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarDaniel W. S. Almeida <dwlsalmeida@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      17a529d0
    • Sean Young's avatar
      media: rc: ensure lirc is initialized before registering input device · 080d89f5
      Sean Young authored
      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 <8b> 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 <8b> 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: default avatarNick French <nickfrench@gmail.com>
      Reported-by: default avatarNick French <nickfrench@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      080d89f5
    • Sean Young's avatar
      media: cxusb: use dev_dbg() rather than hand-rolled debug · c376d665
      Sean Young authored
      This solves the following compiler warnings:
      
      drivers/media/usb/dvb-usb/cxusb.c: In function ‘cxusb_gpio_tuner’:
      drivers/media/usb/dvb-usb/cxusb.c:128:35: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
        128 |   deb_info("gpio_write failed.\n");
            |                                   ^
      drivers/media/usb/dvb-usb/cxusb.c: In function ‘cxusb_bluebird_gpio_rw’:
      drivers/media/usb/dvb-usb/cxusb.c:145:44: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
        145 |   deb_info("bluebird_gpio_write failed.\n");
            |                                            ^
      drivers/media/usb/dvb-usb/cxusb.c: In function ‘cxusb_i2c_xfer’:
      drivers/media/usb/dvb-usb/cxusb.c:251:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
        251 |     deb_i2c("i2c read may have failed\n");
            |                                          ^
      drivers/media/usb/dvb-usb/cxusb.c:274:43: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
        274 |     deb_i2c("i2c write may have failed\n");
            |                                           ^
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      c376d665
    • Sean Young's avatar
      media: vp7045: do not read uninitialized values if usb transfer fails · 26cff637
      Sean Young authored
      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: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      26cff637
    • Sean Young's avatar
      media: af9005: uninitialized variable printked · 51d0c99b
      Sean Young authored
      If usb_bulk_msg() fails, actual_length can be uninitialized.
      
      Reported-by: syzbot+9d42b7773d2fecd983ab@syzkaller.appspotmail.com
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      51d0c99b
    • Sean Young's avatar
      media: digitv: don't continue if remote control state can't be read · eecc70d2
      Sean Young authored
      This results in an uninitialized variable read.
      
      Reported-by: syzbot+6bf9606ee955b646c0e1@syzkaller.appspotmail.com
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      eecc70d2
    • Arnd Bergmann's avatar
      media: v4l2-core: fix compat v4l2_buffer handling for time64 ABI · 342027c5
      Arnd Bergmann authored
      Add support for the four new variants of ioctl commands for 64-bit time_t
      in v4l2_buffer.
      
      The existing v4l2_buffer32 structure for the traditional format gets
      changed to match the new v4l2_buffer format, and the old layout is
      now called v4l2_buffer32_time32. Neither of these matches the native
      64-bit architecture format of v4l2_buffer, so both require special
      handling in compat code.
      
      Duplicating the existing handlers for the new types is a safe conversion
      for now, but unfortunately this may turn into a maintenance burden
      later. A larger-scale rework of the compat code might be a better
      alternative, but is out of scope of the y2038 work.
      
      Note: x32 support for v4l2_buffer32 has always been broken and remains
      so after this change, fixing it would have required even more duplication,
      and apparently nobody has cared so far.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      [hverkuil-cisco@xs4all.nl: remove spurious newline]
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      342027c5
    • Arnd Bergmann's avatar
      media: v4l2-core: fix compat VIDIOC_DQEVENT for time64 ABI · 9983b2da
      Arnd Bergmann authored
      The native code supports the variant of struct v4l2_event for 64-bit
      time_t, so add the compat version as well.
      
      Here, a new incompatibility arises: while almost all 32-bit architectures
      now use the same layout as 64-bit architectures and the commands can
      simply be passed through, on x86 the internal alignment of v4l2_event
      is different because of the 64-bit member in v4l2_event_ctrl.
      
      To handle all architectures, this now requires defining four different
      versions of the structure to cover all possible combinations. The compat
      handling for VIDIOC_DQEVENT32 and VIDIOC_DQEVENT32_TIME32 is now inside
      of an #ifdef so it does not get used on architectures other than x86.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      9983b2da
    • Arnd Bergmann's avatar
      media: v4l2-core: fix v4l2_buffer handling for time64 ABI · 577c89b0
      Arnd Bergmann authored
      The v4l2_buffer structure contains a 'struct timeval' member that is
      defined by the user space C library, creating an ABI incompatibility
      when that gets updated to a 64-bit time_t.
      
      As in v4l2_event, handle this with a special case in video_put_user()
      and video_get_user() to replace the memcpy there.
      
      Since the structure also contains a pointer, there are now two
      native versions (on 32-bit systems) as well as two compat versions
      (on 64-bit systems), which unfortunately complicates the compat
      handler quite a bit.
      
      Duplicating the existing handlers for the new types is a safe
      conversion for now, but unfortunately this may turn into a
      maintenance burden later. A larger-scale rework of the
      compat code might be a better alternative, but is out of scope
      of the y2038 work.
      
      Sparc64 needs a special case because of their special suseconds_t
      definition.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      577c89b0
    • Arnd Bergmann's avatar
      media: v4l2-core: fix VIDIOC_DQEVENT for time64 ABI · 1a6c0b36
      Arnd Bergmann authored
      The v4l2_event structure contains a 'struct timespec' member that is
      defined by the user space C library, creating an ABI incompatibility
      when that gets updated to a 64-bit time_t.
      
      While passing a 32-bit time_t here would be sufficient for CLOCK_MONOTONIC
      timestamps, simply redefining the structure to use the kernel's
      __kernel_old_timespec would not work for any library that uses a copy
      of the linux/videodev2.h header file rather than including the copy from
      the latest kernel headers.
      
      This means the kernel has to be changed to handle both versions of the
      structure layout on a 32-bit architecture. The easiest way to do this
      is during the copy from/to user space.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      1a6c0b36
    • Arnd Bergmann's avatar
      media: v4l2-core: split out data copy from video_usercopy · c8ef1a60
      Arnd Bergmann authored
      The copy-in/out portions of video_usercopy() are about to
      get more complex, so turn then into separate functions as
      a cleanup first.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      c8ef1a60
    • Arnd Bergmann's avatar
      media: v4l2-core: compat: ignore native command codes · 4a873f3f
      Arnd Bergmann authored
      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: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      4a873f3f
    • Arnd Bergmann's avatar
      media: v4l2: abstract timeval handling in v4l2_buffer · 77cdffcb
      Arnd Bergmann authored
      As a preparation for adding 64-bit time_t support in the uapi,
      change the drivers to no longer care about the format of the
      timestamp field in struct v4l2_buffer.
      
      The v4l2_timeval_to_ns() function is no longer needed in the
      kernel after this, but there is userspace code relying on
      it to be part of the uapi header.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      [hverkuil-cisco@xs4all.nl: replace spaces by tabs]
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      77cdffcb
    • Arnd Bergmann's avatar
      media: documentation: fix video_event description · 71e37d2e
      Arnd Bergmann authored
      The type for the timestamp in video_event was changed to
      'long' a long time ago, change the documentation to match.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      71e37d2e
  2. 16 Dec, 2019 22 commits