summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/dvb-usb-v2
AgeCommit message (Collapse)AuthorFilesLines
2019-03-19media: dvb: Add support for the Avermedia TD310Jose Alberto Reguero2-6/+26
This patch add support for Avermedia TD310 usb stick. Signed-off-by: Jose Alberto Reguero <jose.alberto.reguero@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-19media: dvb: init i2c already in it930x_frontend_attachAndreas Kemnade1-42/+42
i2c bus is already needed when the frontend is probed, so init it already in it930x_frontend_attach. That prevents errors like: si2168: probe of 6-0067 failed with error -5 Signed-off-by: Andreas Kemnade <andreas@kemnade.info> Signed-off-by: Jose Alberto Reguero <jose.alberto.reguero@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-19media: dvbsky: Avoid leaking dvb frontendStefan Brüns1-8/+10
Commit 14f4eaeddabc ("media: dvbsky: fix driver unregister logic") fixed a use-after-free by removing the reference to the frontend after deleting the backing i2c device. This has the unfortunate side effect the frontend device is never freed in the dvb core leaving a dangling device, leading to errors when the dvb core tries to register the frontend after e.g. a replug as reported here: https://www.spinics.net/lists/linux-media/msg138181.html media: dvbsky: issues with DVBSky T680CI === [ 561.119145] sp2 8-0040: CIMaX SP2 successfully attached [ 561.119161] usb 2-3: DVB: registering adapter 0 frontend 0 (Silicon Labs Si2168)... [ 561.119174] sysfs: cannot create duplicate filename '/class/dvb/ dvb0.frontend0' === The use after free happened as dvb_usbv2_disconnect calls in this order: - dvb_usb_device::props->exit(...) - dvb_usbv2_adapter_frontend_exit(...) + if (fe) dvb_unregister_frontend(fe) + dvb_usb_device::props->frontend_detach(...) Moving the release of the i2c device from exit() to frontend_detach() avoids the dangling pointer access and allows the core to unregister the frontend. This was originally reported for a DVBSky T680CI, but it also affects the MyGica T230C. As all supported devices structure the registration/ unregistration identically, apply the change for all device types. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-01media: usb: fix several typosMauro Carvalho Chehab3-7/+7
Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: lmedm04: Move interrupt buffer to priv buffer.Malcolm Priestley1-19/+9
Interrupt is always present throughout life time of driver and there is no dma element move this buffer to private area of driver. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07media: lmedm04: Add missing usb_free_urb to free interrupt urb.Malcolm Priestley1-0/+1
The interrupt urb is killed but never freed add the function Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-05media: lmedm04: use dvb_usbv2_generic_rw_lockedMalcolm Priestley1-30/+12
Use dvb-usb-v2 generic usb function for bulk transfers and simplify logic. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-05media: lmedm04: Move usb buffer to lme2510_state.Malcolm Priestley1-32/+3
lme2510_state exists for the entire duration of driver. Move usb_buffer to lme2510_state removing the need for lme2510_exit_int for removing the buffer. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-05media: rtl28xxu: add support for Sony CXD2837ER slave demodNikita Gerasimov3-3/+42
Since 2018 some new revisions of RTL2832P based devices having Sony CXD2837ER as a slave demodulator instead of Panasonic MN88473. CXD2837ER handled in DVB_CXD2841ER module but it's has a lack of control. So slave demod has to be reseted by GPIO0 before detecting to woke up CXD2837ER. Signed-off-by: Nikita Gerasimov <nikitych@yandex.ru> Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: usb: Use kmemdup instead of duplicating its function.zhong jiang1-2/+1
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: dvb: Use WARM definition from identify_state()Victor Toso1-4/+2
Device should be either COLD or WARM. This change only make usage of the existing definition. Signed-off-by: Victor Toso <me@victortoso.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: dvb-usb-v2: Fix incorrect use of transfer_flags URB_FREE_BUFFERMalcolm Priestley1-3/+2
commit 1a0c10ed7bb1 ("media: dvb-usb-v2: stop using coherent memory for URBs") incorrectly adds URB_FREE_BUFFER after every urb transfer. It cannot use this flag because it reconfigures the URBs accordingly to suit connected devices. In doing a call to usb_free_urb is made and invertedly frees the buffers. The stream buffer should remain constant while driver is up. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> CC: stable@vger.kernel.org # v4.18+ Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-10-05Revert "media: dvbsky: use just one mutex for serializing device R/W ops"Mauro Carvalho Chehab1-6/+10
As pointed at: https://bugzilla.kernel.org/show_bug.cgi?id=199323 This patch causes a bad effect on RPi. I suspect that the root cause is at the USB out of tree RPi driver, with uses high priority interrupts instead of normal ones. Anyway, as this patch is mostly a cleanup, better to revert it. This reverts commit 7d95fb746c4eece67308f1642a666ea1ebdbd2cc. Cc: stable@vger.kernel.org # For Kernel 4.18 Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-10-04media: rc: Remove init_ir_raw_event and DEFINE_IR_RAW_EVENT macrosSean Young1-3/+1
This can be done with c99 initializers, which makes the code cleaner and more transparent. It does require gcc 4.6, because of this bug in earlier versions: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 Since commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6"), this is the case. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-17media: mxl111sf: declare its own padsMauro Carvalho Chehab2-6/+12
As we don't need anymore to share pad numbers with similar drivers, use its own pad definition instead of a global model. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-17media: v4l2: taint pads with the signal types for consumer devicesMauro Carvalho Chehab1-0/+2
Consumer devices are provided with a wide different range of types supported by the same driver, allowing different configutations. In order to make easier to setup media controller links, "taint" pads with the signal type it carries. While here, get rid of DEMOD_PAD_VBI_OUT, as the signal it carries is actually the same as the normal video output. The difference happens at the video/VBI interface: - for VBI, only the hidden lines are streamed; - for video, the stream is usually cropped to hide the vbi lines. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-11media: use strscpy() instead of strlcpy()Mauro Carvalho Chehab7-15/+15
The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-29media: af9035: prevent buffer overflow on writeJozef Balga1-2/+4
When less than 3 bytes are written to the device, memcpy is called with negative array size which leads to buffer overflow and kernel panic. This patch adds a condition and returns -EOPNOTSUPP instead. Fixes bugzilla issue 64871 [mchehab+samsung@kernel.org: fix a merge conflict and changed the condition to match the patch's comment, e. g. len == 3 could also be valid] Signed-off-by: Jozef Balga <jozef.balga@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-08media: rtl28xxu: be sure that it won't go past the array sizeMauro Carvalho Chehab1-1/+1
smatch warns that the RC query code could go past the array size: drivers/media/usb/dvb-usb-v2/rtl28xxu.c:1757 rtl2832u_rc_query() error: buffer overflow 'buf' 128 <= 130 drivers/media/usb/dvb-usb-v2/rtl28xxu.c:1758 rtl2832u_rc_query() error: buffer overflow 'buf' 128 <= 130 The driver logic gets the length of the IR RX buffer with: ret = rtl28xxu_rd_reg(d, IR_RX_BC, &buf[0]); ... len = buf[0]; In thesis, this could range between 0 and 255 [1]. While this should never happen in practice, due to hardware limits, smatch is right when it complains about that, as there's nothing at the logic that would prevent it. So, if for whatever reason, buf[0] gets filled by rtl28xx read functions with a value bigger than 128, it will go past the array. So, add an explicit check. [1] I've no idea why smatch thinks that the maximum value is 130. I double-checked the code several times. Was unable to find any reason for assuming 130. Perhaps smatch is not properly parsing u8 here? Fixes: b5cbaa43a676 ("[media] rtl28xx: initial support for rtl2832u") Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-03media: dvb-usb-v2: fix spelling mistake: "completition" -> "completion"Colin Ian King1-2/+2
Trivial fix to spelling mistake in dev_dbg and dev_err messages Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-02media: dvb: represent min/max/step/tolerance freqs in HzMauro Carvalho Chehab1-3/+3
Right now, satellite frontend drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers. However, the main problem is that universal frontends capable of handling both satellite and non-satelite delivery systems are appearing. We end by needing to hack the drivers in order to support such hybrid frontends. So, convert everything to specify frontend frequencies in Hz. Tested-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-02media: dvb: convert tuner_info frequencies to HzMauro Carvalho Chehab1-3/+3
Right now, satellite tuner drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers. However, the main problem is that universal tuners capable of handling both satellite and non-satelite delivery systems are appearing. We end by needing to hack the drivers in order to support such hybrid tuners. So, convert everything to specify tuner frequencies in Hz. Plese notice that a similar patch is also needed for frontends. Tested-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Acked-by: Michael Büsch <m@bues.ch> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: dvb-usb/friio, dvb-usb-v2/gl861: decompose friio and merge with gl861Akihiro Tsukada3-1/+476
Friio device contains "gl861" bridge and "tc90522" demod, for which the separate drivers are already in the kernel. But friio driver was monolithic and did not use them, practically copying those features. This patch decomposes friio driver into sub drivers and re-uses existing ones, thus reduces some code. It adds some features to gl861, to support the friio-specific init/config of the devices and implement i2c communications to the tuner via demod with USB vendor requests. [mchehab+samsung@kernel.org: fix merge conflicts] Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: gl861: fix probe of dvb_usb_gl861Mika Båtsman1-11/+10
Probe of dvb_usb_gl861 was working at least with v4.4. Noticed the issue with v4.13 but according to similar issues the problem started with v4.9. [ 15.288065] transfer buffer not dma capable [ 15.288090] WARNING: CPU: 2 PID: 493 at drivers/usb/core/hcd.c:1595 usb_hcd_map_urb_for_dma+0x4e2/0x640 ...CUT... [ 15.288791] dvb_usb_gl861: probe of 3-7:1.0 failed with error -5 Tested with MSI Mega Sky 580 DVB-T Tuner [GL861] [mchehab+samsung@kernel.org: rebased on the top of upstream] Cc: stable@vger.kernel.org Signed-off-by: Mika Båtsman <mika.batsman@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-06-15media: dvb: point to the location of the old README.dvb-usb fileMauro Carvalho Chehab6-6/+6
This file got renamed, but the references still point to the old place. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Jonathan Corbet <corbet@lwn.net>
2018-06-15media: dvb: fix location of get_dvb_firmware scriptMauro Carvalho Chehab1-1/+1
This script was moved out of Documentation/dvb, but the links weren't updated. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Jonathan Corbet <corbet@lwn.net>
2018-06-15docs: Fix some broken referencesMauro Carvalho Chehab1-1/+1
As we move stuff around, some doc references are broken. Fix some of them via this script: ./scripts/documentation-file-ref-check --fix Manually checked if the produced result is valid, removing a few false-positives. Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Stephen Boyd <sboyd@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Coly Li <colyli@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Jonathan Corbet <corbet@lwn.net>
2018-05-10media: dvbsky: use just one mutex for serializing device R/W opsMauro Carvalho Chehab1-10/+6
Right now, there are two mutexes serializing r/w ops: one "generic" and another one specifically for stream on/off. Clean it a little bit, getting rid of one of the mutexes. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-05media: dvb-usb-v2/gl861: ensure USB message buffers DMA'ableAkihiro Tsukada1-3/+17
i2c message buf might be on stack. Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-05media: dvb-usb-v2/gl861: use usleep_range() for short delayAkihiro Tsukada1-1/+1
As the kernel doc "timers-howto.txt" reads, short delay with msleep() can take much longer. In a case of raspbery-pi platform where CONFIG_HZ_100 was set, it actually affected the init of Friio devices since it issues lots of i2c transactions with short delay. Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: dvb-usb-v2: stop using coherent memory for URBsMauro Carvalho Chehab1-13/+4
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: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: dvbsky: fix driver unregister logicMauro Carvalho Chehab1-0/+3
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: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: dvbsky: use the new dvb_module_probe() APIMauro Carvalho Chehab1-279/+127
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: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-03-23media: dvb-usb-v2: fix a missing dependency of I2C_MUXMauro Carvalho Chehab1-1/+1
Now that af9015 requires I2C_MUX, all drivers that select it should also depend on it. drivers/media/dvb-frontends/af9013.o: In function `af9013_remove': >> drivers/media/dvb-frontends/af9013.c:1560: undefined reference to `i2c_mux_del_adapters' drivers/media/dvb-frontends/af9013.o: In function `af9013_probe': >> drivers/media/dvb-frontends/af9013.c:1488: undefined reference to `i2c_mux_alloc' >> drivers/media/dvb-frontends/af9013.c:1495: undefined reference to `i2c_mux_add_adapter' drivers/media/dvb-frontends/af9013.c:1544: undefined reference to `i2c_mux_del_adapters' Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: correct some coding style issuesAntti Palosaari1-84/+88
Correct coding style issues reported mostly by checkpatch.pl. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: convert to regmap apiAntti Palosaari3-97/+115
Use regmap for chip register access. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: dvb-usb-v2: add probe/disconnect callbacksAntti Palosaari2-4/+24
Add probe and disconnect callbacks that behaves similarly than ones used commonly on Linux driver model. We need those to get early / late access to driver in order to use normal probe time stuff, like regmap, extra bus adapters and so. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: enhance streaming configAntti Palosaari2-119/+115
Replace static stream settings by one which enables and disables stream interface when needed (TS streaming control). 1) Configure both TS IF and USB endpoints according to current use case 2) Disable streaming USB endpoints when streaming is stopped and enable when streaming is started. Reduces sleep power consumption slightly. 3) Reduce USB buffersize slightly, from 130848 to 98136 bytes Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: refactor copy firmware to slave demodAntti Palosaari1-44/+44
Small improvements. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: refactor firmware downloadAntti Palosaari1-22/+17
Small revise, no functional changes. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: use af9013 demod pid filtersAntti Palosaari1-31/+18
PID filters are moved to af9013 demod driver as those are property of demod. As pid filters are now implemented correctly by demod driver, we could enable pid filter support for possible slave demod too on dual tuner configuration. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: attach demod using i2c bindingAntti Palosaari2-66/+96
af9013 demod driver has i2c binding. Use it. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: af9015: fix loggingAntti Palosaari1-79/+81
Pass correct device to dev_* logging functions, which allows us to remove redundant KBUILD_MODNAME and __func__ parameters from log format. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-28media: move dvb kAPI headers to include/mediaMauro Carvalho Chehab6-10/+9
Except for DVB, all media kAPI headers are at include/media. Move the headers to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14media: dvbsky: MyGica T230C supportStefan Brüns1-0/+88
Mygica T230 DVB-T/T2/C USB stick support. It uses the same FX2/Si2168 bridge/demodulator combo as the other devices supported by the driver, but uses the Si2141 tuner. Several DVB-T (MPEG2) and DVB-T2 (H.265) channels were tested, as well as the included remote control. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-11media: mxl111sf: improve error handling logicMauro Carvalho Chehab1-2/+7
As reported by smatch: drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c:485 mxl111sf_demod_read_signal_strength() error: uninitialized symbol 'modulation'. The mxl111sf_demod_read_signal_strength() just ignores if something gets wrong while reading snr or modulation. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-11media: dvbsky: shut up a bogus warningMauro Carvalho Chehab1-2/+2
Smatch gives two bogus warnings on this driver: drivers/media/usb/dvb-usb-v2/dvbsky.c:336 dvbsky_s960_attach() error: uninitialized symbol 'i2c_adapter'. drivers/media/usb/dvb-usb-v2/dvbsky.c:459 dvbsky_s960c_attach() error: uninitialized symbol 'i2c_adapter'. Shut them up. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-11media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tunerMalcolm Priestley1-7/+6
When the tuner was split from m88rs2000 the attach function is in wrong place. Move to dm04_lme2510_tuner to trap errors on failure and removing a call to lme_coldreset. Prevents driver starting up without any tuner connected. Fixes to trap for ts2020 fail. LME2510(C): FE Found M88RS2000 ts2020: probe of 0-0060 failed with error -11 ... LME2510(C): TUN Found RS2000 tuner kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN Reported-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-11media: dvb-usb-v2: lmedm04: Improve logic checking of warm startMalcolm Priestley1-8/+18
Warm start has no check as whether a genuine device has connected and proceeds to next execution path. Check device should read 0x47 at offset of 2 on USB descriptor read and it is the amount requested of 6 bytes. Fix for kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access as Reported-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-11-15Merge tag 'media/v4.15-1' of ↵Linus Torvalds3-4/+2
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - Documentation for digital TV (both kAPI and uAPI) are now in sync with the implementation (except for legacy/deprecated ioctls). This is a major step, as there were always a gap there - New sensor driver: imx274 - New cec driver: cec-gpio - New platform driver for rockship rga and tegra CEC - New RC driver: tango-ir - Several cleanups at atomisp driver - Core improvements for RC, CEC, V4L2 async probing support and DVB - Lots of drivers cleanup, fixes and improvements. * tag 'media/v4.15-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (332 commits) dvb_frontend: don't use-after-free the frontend struct media: dib0700: fix invalid dvb_detach argument media: v4l2-ctrls: Don't validate BITMASK twice media: s5p-mfc: fix lockdep warning media: dvb-core: always call invoke_release() in fe_free() media: usb: dvb-usb-v2: dvb_usb_core: remove redundant code in dvb_usb_fe_sleep media: au0828: make const array addr_list static media: cx88: make const arrays default_addr_list and pvr2000_addr_list static media: drxd: make const array fastIncrDecLUT static media: usb: fix spelling mistake: "synchronuously" -> "synchronously" media: ddbridge: fix build warnings media: av7110: avoid 2038 overflow in debug print media: Don't do DMA on stack for firmware upload in the AS102 driver media: v4l: async: fix unregister for implicitly registered sub-device notifiers media: v4l: async: fix return of unitialized variable ret media: imx274: fix missing return assignment from call to imx274_mode_regs media: camss-vfe: always initialize reg at vfe_set_xbar_cfg() media: atomisp: make function calls cleaner media: atomisp: get rid of storage_class.h media: atomisp: get rid of wrong stddef.h include ...