1. 05 5月, 2018 17 次提交
  2. 04 5月, 2018 13 次提交
    • M
      media: lgdt330x: convert it to the new I2C binding way · 23ba635d
      Mauro Carvalho Chehab 提交于
      Convert the driver to allow its usage with the new I2C
      binding way.
      
      Please notice that this patch doesn't convert the
      callers to bind to it using the new way.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      23ba635d
    • M
      media: em28xx: fix a regression with HVR-950 · 509f8965
      Mauro Carvalho Chehab 提交于
      Commit be7fd3c3 ("media: em28xx: Hauppauge DualHD second tuner
      functionality") removed the logic with sets the alternate for the DVB
      device. Without setting the right alternate, the device won't be
      able to submit URBs, and userspace fails with -EMSGSIZE:
      
      	ERROR     DMX_SET_PES_FILTER failed (PID = 0x2000): 90 Message too long
      
      Tested with Hauppauge HVR-950 model A1C0.
      
      Fixes: be7fd3c3 ("media: em28xx: Hauppauge DualHD second tuner functionality")
      
      Cc: Brad Love <brad@nextdimension.cc>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      509f8965
    • M
      media: cx231xx: get rid of videobuf-dvb dependency · b2c20f2f
      Mauro Carvalho Chehab 提交于
      This driver doesn't use videobuf-dvb. So, stop adding an
      unused struct and unused header on it.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      b2c20f2f
    • M
      media: dvb-usb-v2: stop using coherent memory for URBs · 1a0c10ed
      Mauro Carvalho Chehab 提交于
      There's no need to use coherent buffers there. So, let the
      DVB core do the allocation. That should give some performance
      gain outside x86.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      1a0c10ed
    • M
      media: dvbsky: fix driver unregister logic · 14f4eaed
      Mauro Carvalho Chehab 提交于
      There's a user-after-free there, if the frontend is attached
      via the new I2C way:
      
      [  112.539806] usbcore: deregistering interface driver dvb_usb_dvbsky
      [  112.568489] ==================================================================
      [  112.568600] BUG: KASAN: use-after-free in dvb_unregister_frontend+0x18/0xb0 [dvb_core]
      [  112.568610] Read of size 8 at addr ffff8803a6f61530 by task rmmod/2246
      
      [  112.568622] CPU: 0 PID: 2246 Comm: rmmod Not tainted 4.16.0-rc4+ #103
      [  112.568624] Hardware name:  /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
      [  112.568625] Call Trace:
      [  112.568631]  dump_stack+0x5c/0x7c
      [  112.568636]  print_address_description+0x6a/0x270
      [  112.568640]  kasan_report+0x258/0x380
      [  112.568657]  ? dvb_unregister_frontend+0x18/0xb0 [dvb_core]
      [  112.568673]  dvb_unregister_frontend+0x18/0xb0 [dvb_core]
      [  112.568681]  dvb_usbv2_exit+0x156/0x4a0 [dvb_usb_v2]
      [  112.568689]  dvb_usbv2_disconnect+0xa0/0x140 [dvb_usb_v2]
      [  112.568694]  usb_unbind_interface+0xd8/0x3f0
      [  112.568700]  device_release_driver_internal+0x1ce/0x2f0
      [  112.568705]  driver_detach+0x66/0xc0
      [  112.568709]  bus_remove_driver+0x86/0x150
      [  112.568713]  usb_deregister+0x90/0x180
      [  112.568718]  SyS_delete_module+0x293/0x330
      [  112.568721]  ? free_module+0x330/0x330
      [  112.568725]  ? _cond_resched+0x16/0x50
      [  112.568729]  ? task_work_run+0x7d/0xd0
      [  112.568732]  ? mem_cgroup_handle_over_high+0x1c/0xc0
      [  112.568736]  ? free_module+0x330/0x330
      [  112.568740]  do_syscall_64+0xe7/0x250
      [  112.568744]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
      [  112.568747] RIP: 0033:0x7facafa272a7
      [  112.568749] RSP: 002b:00007fffdea14cc8 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      [  112.568753] RAX: ffffffffffffffda RBX: 00007fffdea14d28 RCX: 00007facafa272a7
      [  112.568755] RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005599557337c8
      [  112.568756] RBP: 0000559955733760 R08: 000000000000000a R09: 0000000000000000
      [  112.568758] R10: 00007facafaa0280 R11: 0000000000000206 R12: 00007fffdea14ef0
      [  112.568761] R13: 00007fffdea16eac R14: 0000559955733260 R15: 0000559955733760
      
      [  112.568808] Allocated by task 638:
      [  112.568816]  kasan_kmalloc+0xa0/0xd0
      [  112.568820]  kmem_cache_alloc_trace+0x114/0x230
      [  112.568826]  m88ds3103_probe+0x9a/0x643 [m88ds3103]
      [  112.568830]  i2c_device_probe+0x2e9/0x3c0
      [  112.568833]  driver_probe_device+0x46e/0x6a0
      [  112.568836]  bus_for_each_drv+0xd6/0x130
      [  112.568838]  __device_attach+0x166/0x1f0
      [  112.568841]  bus_probe_device+0xea/0x110
      [  112.568844]  device_add+0x6a3/0x9f0
      [  112.568847]  i2c_new_device+0x28f/0x5c0
      [  112.568861]  dvb_module_probe+0x91/0x110 [dvb_core]
      [  112.568867]  dvbsky_s960c_attach+0x1c4/0x460 [dvb_usb_dvbsky]
      [  112.568873]  dvb_usbv2_probe+0x1191/0x1950 [dvb_usb_v2]
      [  112.568877]  usb_probe_interface+0x1b3/0x430
      [  112.568880]  driver_probe_device+0x46e/0x6a0
      [  112.568882]  __driver_attach+0xeb/0x110
      [  112.568885]  bus_for_each_dev+0xe4/0x140
      [  112.568888]  bus_add_driver+0x249/0x380
      [  112.568891]  driver_register+0xc6/0x170
      [  112.568893]  usb_register_driver+0xec/0x200
      [  112.568896]  do_one_initcall+0x8f/0x1ee
      [  112.568900]  do_init_module+0xde/0x320
      [  112.568902]  load_module+0x3ed0/0x4850
      [  112.568905]  SYSC_finit_module+0x192/0x1c0
      [  112.568908]  do_syscall_64+0xe7/0x250
      [  112.568911]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
      
      [  112.568916] Freed by task 2246:
      [  112.568923]  __kasan_slab_free+0x136/0x180
      [  112.568925]  kfree+0xa5/0x1e0
      [  112.568931]  m88ds3103_remove+0x42/0x60 [m88ds3103]
      [  112.568934]  i2c_device_remove+0x72/0xd0
      [  112.568937]  device_release_driver_internal+0x1ce/0x2f0
      [  112.568940]  bus_remove_device+0x197/0x270
      [  112.568942]  device_del+0x239/0x550
      [  112.568945]  device_unregister+0x16/0x70
      [  112.568949]  dvbsky_exit+0x4c/0x70 [dvb_usb_dvbsky]
      [  112.568955]  dvb_usbv2_disconnect+0x98/0x140 [dvb_usb_v2]
      [  112.568958]  usb_unbind_interface+0xd8/0x3f0
      [  112.568961]  device_release_driver_internal+0x1ce/0x2f0
      [  112.568964]  driver_detach+0x66/0xc0
      [  112.568967]  bus_remove_driver+0x86/0x150
      [  112.568970]  usb_deregister+0x90/0x180
      [  112.568973]  SyS_delete_module+0x293/0x330
      [  112.568976]  do_syscall_64+0xe7/0x250
      [  112.568979]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
      
      [  112.568985] The buggy address belongs to the object at ffff8803a6f61100
                      which belongs to the cache kmalloc-2048 of size 2048
      [  112.568998] The buggy address is located 1072 bytes inside of
                      2048-byte region [ffff8803a6f61100, ffff8803a6f61900)
      [  112.569008] The buggy address belongs to the page:
      [  112.569015] page:ffffea000e9bd800 count:1 mapcount:0 mapping:0000000000000000 index:0x0 compound_mapcount: 0
      [  112.569025] flags: 0x17ffe000008100(slab|head)
      [  112.569034] raw: 0017ffe000008100 0000000000000000 0000000000000000 00000001000f000f
      [  112.569044] raw: ffffea000ee2d000 0000000500000005 ffff880407002a80 0000000000000000
      [  112.569053] page dumped because: kasan: bad access detected
      
      [  112.569062] Memory state around the buggy address:
      [  112.569070]  ffff8803a6f61400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [  112.569079]  ffff8803a6f61480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [  112.569088] >ffff8803a6f61500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [  112.569095]                                      ^
      [  112.569103]  ffff8803a6f61580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [  112.569112]  ffff8803a6f61600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [  112.569119] ==================================================================
      [  112.569127] Disabling lock debugging due to kernel taint
      [  112.571161] dvb_usb_v2: 'DVBSky S960CI:2-2' successfully deinitialized and disconnected
      
      Fix it by letting the dvb-usb-v2 core to know that the frontend
      was already removed.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      14f4eaed
    • M
      media: dvbsky: use the new dvb_module_probe() API · 2c7e3ca8
      Mauro Carvalho Chehab 提交于
      Instead of repeating countless times a complex logic, use
      the new dvb_module_probe()/dvb_module_release(), simplifying
      the module.
      
      That reduced about 15% at the module's size:
      
         text	   data	    bss	    dec	    hex	filename
         7083	   1108	     12	   8203	   200b	old/drivers/media/usb/dvb-usb-v2/dvbsky.o
         5817	   1108	     12	   6937	   1b19	new/drivers/media/usb/dvb-usb-v2/dvbsky.o
      
      Tested with a DVBSky S960C DVB-S2 tuner (0572:960c)
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      2c7e3ca8
    • M
      media: em28xx: Don't use ops->resume if NULL · fd901b6e
      Mauro Carvalho Chehab 提交于
      Changeset  be7fd3c3 ("media: em28xx: Hauppauge DualHD
      second tuner functionality") introduced a potential NULL pointer
      dereference, as pointed by Coverity:
      
      CID 1434731 (#1 of 1): Dereference after null check (FORWARD_NULL)16. var_deref_op: Dereferencing null pointer ops->resume.
      
      var_compare_op: Comparing ops->resume to null implies that ops->resume might be null.
      1174                if (ops->resume)
      1175                        ops->resume(dev);
      1176                if (dev->dev_next)
      1177                        ops->resume(dev->dev_next);
      
      Fixes: be7fd3c3 ("media: em28xx: Hauppauge DualHD second tuner functionality")
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      fd901b6e
    • H
      media: usbtv: Use the constant for supported standards · 15b4c54e
      Hugo Grostabussiat 提交于
      Use the USBTV_TV_STD define instead of repeating ourselves.
      Signed-off-by: NHugo Grostabussiat <bonstra@bonstra.fr.eu.org>
      Signed-off-by: NHans Verkuil <hansverk@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      15b4c54e
    • H
      media: usbtv: Enforce standard for color decoding · bed6d27b
      Hugo Grostabussiat 提交于
      Depending on the chosen standard, configure the decoder to use the
      appropriate color encoding standard (PAL-like, NTSC-like or SECAM).
      
      Until now, the decoder was not configured for a specific color standard,
      making it autodetect the color encoding.
      
      While this may sound fine, it potentially causes the wrong image tuning
      parameters to be applied (e.g. tuning parameters for NTSC are applied to
      a PAL source), and may confuse users about what the actual standard is
      in use.
      
      This commit explicitly configures the color standard the decoder will
      use, making it visually obvious if a wrong standard was chosen.
      Signed-off-by: NHugo Grostabussiat <bonstra@bonstra.fr.eu.org>
      Signed-off-by: NHans Verkuil <hansverk@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      bed6d27b
    • H
      media: usbtv: Keep norm parameter specific · a8b48e22
      Hugo Grostabussiat 提交于
      The user-supplied norm value gets overwritten by the generic .norm
      member from the norm_params. That way, we lose the specific norm the
      user may want to set.
      
      For instance, if the user specifies V4L2_STD_PAL_60, the value actually
      used will be V4L2_STD_525_60, which in the end will be as if the user
      had specified V4L2_STD_NTSC, since this is always the first bitfield we
      match the norm value against before configuring the hardware.
      
      The norm_params array is only there to match a norm with an output
      resolution. The norm value itself should not be changed.
      Signed-off-by: NHugo Grostabussiat <bonstra@bonstra.fr.eu.org>
      Signed-off-by: NHans Verkuil <hansverk@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      a8b48e22
    • H
      media: usbtv: Use V4L2 defines to select capture resolution · 8c42d276
      Hugo Grostabussiat 提交于
      Make use of the V4L2_STD_525_60 and V4L2_STD_625_50 defines to
      determine the vertical resolution to use when capturing.
      
      V4L2_STD_525_60 (resp. V4L2_STD_625_50) is the set of standards using
      525 (resp. 625) lines per frame, independently of the color encoding.
      Signed-off-by: NHugo Grostabussiat <bonstra@bonstra.fr.eu.org>
      Signed-off-by: NHans Verkuil <hansverk@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      8c42d276
    • H
      media: usbtv: Add SECAM support · c41e20d9
      Hugo Grostabussiat 提交于
      Add support for the SECAM norm, using the "AVSECAM" decoder configuration
      sequence found in Windows driver's .INF file.
      
      For reference, the "AVSECAM" sequence in the .INF file is:
      0x04,0x73,0xDC,0x72,0xA2,0x90,0x35,0x01,0x30,0x04,0x08,0x2D,0x28,0x08,
      0x02,0x69,0x16,0x35,0x21,0x16,0x36
      Signed-off-by: NHugo Grostabussiat <bonstra@bonstra.fr.eu.org>
      Signed-off-by: NHans Verkuil <hansverk@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      c41e20d9
    • H
      media: usbtv: Use same decoder sequence as Windows driver · 5c909be0
      Hugo Grostabussiat 提交于
      Re-format the register {address, value} pairs so they follow the same
      order as the decoder configuration sequences in the Windows driver's .INF
      file.
      
      For instance, for PAL, the "AVPAL" sequence in the .INF file is:
      0x04,0x68,0xD3,0x72,0xA2,0xB0,0x15,0x01,0x2C,0x10,0x20,0x2e,0x08,0x02,
      0x02,0x59,0x16,0x35,0x17,0x16,0x36
      Signed-off-by: NHugo Grostabussiat <bonstra@bonstra.fr.eu.org>
      Signed-off-by: NHans Verkuil <hansverk@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      5c909be0
  3. 20 4月, 2018 1 次提交
  4. 04 4月, 2018 2 次提交
  5. 23 3月, 2018 6 次提交
  6. 22 3月, 2018 1 次提交