summaryrefslogtreecommitdiffstats
path: root/drivers/media
AgeCommit message (Collapse)AuthorFilesLines
2020-01-09media: dvb-frontends: ts2020: convert to use i2c_new_client_device()Wolfram Sang1-2/+2
Use the newer API returning an ERRPTR and use the new helper to bail out. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-09media: dvb-frontends: m88ds3103: convert to use i2c_new_client_device()Wolfram Sang1-2/+2
Use the newer API returning an ERRPTR and use the new helper to bail out. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-09media: dvb-frontends: lgdt330x: convert to use i2c_new_client_device()Wolfram Sang1-2/+2
Use the newer API returning an ERRPTR and use the new helper to bail out. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-09media: dvb-frontends: cxd2820r_core: convert to use i2c_new_client_device()Wolfram Sang1-2/+2
Use the newer API returning an ERRPTR and use the new helper to bail out. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-09media: dvb-core: dvbdev: convert to use i2c_new_client_device()Wolfram Sang1-2/+2
Use the newer API returning an ERRPTR and use the new helper to bail out. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-09media: v4l2-core: fix uninitialized structure fields being returned to userspaceColin Ian King1-1/+1
In the case where v4l2_event_dequeue fails the structure ev is not being filled and this garbage data from the stack is being copied to the ev32 structure and being copied back to userspace on the VIDIOC_DQEVENT_TIME32 ioctl. Fix this by ensuring the ev structure is zero'd to ensure uninitialized data is not leaked back. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 1a6c0b36dd19 ("media: v4l2-core: fix VIDIOC_DQEVENT for time64 ABI") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-09media: mtk-vcodec: use v4l2_m2m_buffer where appropriateAlexandre Courbot5-45/+52
Despite using M2M in both the decoder and encoder, this driver used vb2_v4l2_buffer as its base buffer structure, and placed a list_head right after the buffer declaration in order to match the layout of a v4l2_m2m_buffer. This is very dangerous as it means the driver will break should the layout of v4l2_m2m_buffer change. Fix this by directly using v4l2_m2m_buffer and updating the sites that accessed the buffer accordingly. Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: fix checkpatch warning] Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-09media: davinci/vpfe_capture.c: Avoid BUG_ON for register failureAditya Pakki1-15/+16
In vpfe_register_ccdc_device(), failure to allocate dev->hw_ops fields calls BUG_ON(). This patch returns the error to callers instead of crashing. The issue was identified by a static analysis tool, written by us. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: cec: remove unused functionsHans Verkuil3-56/+4
Remove several functions that are no longer used now that the conversion of cec drivers to cec_notifier_conn_(un)register() and cec_notifier_cec_adap_(un)register() is complete. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: sti: bdisp: fix a possible sleep-in-atomic-context bug in ↵Jia-Ju Bai1-3/+3
bdisp_device_run() 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 <baijiaju1990@gmail.com> Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: pvrusb2: Remove unneeded semicolon and add newlineMa Feng1-2/+2
Fixes coccicheck warning: drivers/media/usb/pvrusb2/pvrusb2-encoder.c:288:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ma Feng <mafeng.ma@huawei.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: pci: ivtv: convert to i2c_new_scanned_deviceWolfram Sang2-4/+4
Move from the deprecated i2c_new_probed_device() to the new i2c_new_scanned_device(). Make use of the new ERRPTR if suitable. Change the legacy function to simply return void because the retval was never used anywhere. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: pci: cx18: convert to i2c_new_scanned_deviceWolfram Sang1-1/+1
Move from the deprecated i2c_new_probed_device() to the new i2c_new_scanned_device(). Make use of the new ERRPTR if suitable. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: pci: bt8xx: convert to i2c_new_scanned_deviceWolfram Sang1-3/+3
Move from the deprecated i2c_new_probed_device() to the new i2c_new_scanned_device(). Make use of the new ERRPTR if suitable. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: pci: cx88: convert to i2c_new_scanned_deviceWolfram Sang1-1/+1
Here, this only means to update a comment in the driver. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: pci: cx23885: convert to i2c_new_scanned_deviceWolfram Sang1-2/+2
Move from the deprecated i2c_new_probed_device() to the new i2c_new_scanned_device(). Make use of the new ERRPTR if suitable. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: saa7146: Avoid using BUG_ON as an assertionAditya Pakki1-2/+4
In video_begin and video_end, saa7146_format_by_fourcc can return NULL and is checked via BUG_ON. However, by returning the error to the callers upstream, we can avoid the crash and handle it via recovery code. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: cx231xx: replace BUG_ON with recovery codeAditya Pakki1-1/+2
In cx231xx_i2c_register, if dev->cx231xx_send_usb_command is NULL, the code crashes. However, the callers in cx231xx-core are able to handle the error without crashing. This patch fixes this issue. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: v4l2-core: only zero-out ioctl-read buffersArnd Bergmann1-4/+4
The memset() got moved out of the check for _IOC_NONE, so passing a made-up command number with a size but no direction would allow clearing data on user-provided pointers. Move video_get_user() back into the _IOC_NONE check where it belongs. Reported-by: syzbot+54fd8cca4b7226c94b8e@syzkaller.appspotmail.com Fixes: 6c625c01c7a6 ("media: v4l2-core: split out data copy from video_usercopy") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: rc: ir-hix5hd2: add hi3796cv300-ir supportShawn Guo1-18/+61
The IR device on Hi3796CV300 SoC is mostly same as hix5hd2, except the following two things. - IR_CLK offset is 0x60 instead of 0x48. - It needs to set an extra bit in IR_ENABLE register to enable IR. The following changes are made to deal with them. - Define a SoC specific data to accommodate IR_CLK offset and the flag telling requirement of extra enable bit. - Create function hix5hd2_ir_enable() to handle IR enabling. The original hix5hd2_ir_enable() is all about managing IR clock, so gets renamed to hix5hd2_ir_clk_enable(). - Device table hix5hd2_ir_table[] gets moved forward, as it's being used by hix5hd2_ir_probe() now. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dvb-core: Fix receiving invalid EIT-sectionsJohann Friedrichs1-0/+1
Resetting buf without resetting pusi_seen at a channel-switch can lead to copying the rest of a section to the start of buf, but treating it as a complete section, when the next pusi arrives. EIT-sections starting without valid header were randomly received during an EIT-scan on a transponder. Signed-off-by: Johann Friedrichs <johann.friedrichs@web.de> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: au8522: improve formattingDaniel W. S. Almeida1-1/+1
This patch fixes the following scripts/checkpatch.pl errors: ERROR: space required before the open parenthesis '(' + switch(input) { Suggested-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: as102: improve formattingDaniel W. S. Almeida1-1/+2
This patch fixes the following scripts/checkpatch.pl error: ERROR: open brace '{' following function definitions go on the next line +static int as102_fe_get_tune_settings(struct dvb_frontend *fe, + struct dvb_frontend_tune_settings *settings) { Suggested-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dvb_dummy_fe: change printk to pr_warnDaniel W. S. Almeida1-3/+3
Replaces printk with pr_err to fix warnings from checkpatch.pl Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dvb_dummy_fe: Add blank line after declarationDaniel W. S. Almeida1-0/+1
Fix checkpatch.pl error by adding a blank line Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION, AVOID_EXTERN and long linesDaniel W. S. Almeida2-31/+57
Change foo* bar to foo *bar to avoid ERROR: POINTER_LOCATION in checkpatch ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength) ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength) ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr) ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr) ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_sleep(struct dvb_frontend* fe) ERROR: "foo* bar" should be "foo *bar" +static int dvb_dummy_fe_init(struct dvb_frontend* fe) ERROR: "foo* bar" should be "foo *bar" +static void dvb_dummy_fe_release(struct dvb_frontend* fe) ERROR: "foo* bar" should be "foo *bar" + struct dvb_dummy_fe_state* state = fe->demodulator_priv; ERROR: "foo* bar" should be "foo *bar" +struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void) ERROR: "foo* bar" should be "foo *bar" + struct dvb_dummy_fe_state* state = NULL; ERROR: "foo* bar" should be "foo *bar" + struct dvb_dummy_fe_state* state = NULL; ERROR: "foo* bar" should be "foo *bar" + struct dvb_dummy_fe_state* state = NULL; remove 'extern' keyword from declaration Fix CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files by removing it. Fix long lines Break long lines into smaller ones to improve readability. WARNING: line over 80 characters + memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops)); WARNING: line over 80 characters + memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops)); WARNING: line over 80 characters + memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops)); WARNING: line over 80 characters + FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | WARNING: line over 80 characters + FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO | WARNING: line over 80 characters + FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | WARNING: line over 80 characters + .symbol_rate_min = (57840000 / 2) / 6 Suggested-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dib0090: incorrect format specifier detected by clangSean Young1-1/+2
drivers/media/dvb-frontends/dib0090.c:1751:67: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("BB Offset Cal, BBreg=%hd,Offset=%hd,Value Set=%hd\n", state->dc->addr, state->adc_diff, state->step); ~~~ ^~~~~~~~~~~~~~~ %hhu drivers/media/dvb-frontends/dib0090.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0090.c:1751:101: warning: format specifies type 'short' but the argument has type 's8' (aka 'signed char') [-Wformat] dprintk("BB Offset Cal, BBreg=%hd,Offset=%hd,Value Set=%hd\n", state->dc->addr, state->adc_diff, state->step); ~~~ ^~~~~~~~~~~ %hhd drivers/media/dvb-frontends/dib0090.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dib0070: incorrect format specifiers detected by clangSean Young1-8/+15
drivers/media/dvb-frontends/dib0070.c:192:52: warning: format specifies type 'short' but the argument has type 's8' (aka 'signed char') [-Wformat] dprintk("CAPTRIM=%hd; ADC = %hd (ADC) & %dmV\n", state->captrim, adc, (u32) adc*(u32)1800/(u32)1024); ~~~ ^~~~~~~~~~~~~~ %hhd drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:203:59: warning: format specifies type 'short' but the argument has type 's8' (aka 'signed char') [-Wformat] dprintk("CAPTRIM=%hd is closer to target (%hd/%hd)\n", state->captrim, adc, state->adc_diff); ~~~ ^~~~~~~~~~~~~~ %hhd drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:367:46: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("Tuning for Band: %hd (%d kHz)\n", band, freq); ~~~ ^~~~ %hhu drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:445:39: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("REFDIV: %hd, FREF: %d\n", REFDIV, FREF); ~~~ ^~~~~~ %hhu drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:447:57: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("Num: %hd, Den: %hd, SD: %hd\n", (u16) Rest, Den, (state->lo4 >> 12) & 0x1); ~~~ ^~~ %hhu drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:447:62: warning: format specifies type 'short' but the argument has type 'int' [-Wformat] dprintk("Num: %hd, Den: %hd, SD: %hd\n", (u16) Rest, Den, (state->lo4 >> 12) & 0x1); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~ %d drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:448:33: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("HFDIV code: %hd\n", state->current_tune_table_index->hfdiv); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %hhu drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:449:27: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("VCO = %hd\n", state->current_tune_table_index->vco_band); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %hhu drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ drivers/media/dvb-frontends/dib0070.c:450:40: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("VCOF: ((%hd*%d) << 1))\n", state->current_tune_table_index->vco_multi, freq); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %hhu drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk' __func__, ##arg); \ ^~~ Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dib7000p: incorrect format specifier detected by clangSean Young1-1/+1
drivers/media/dvb-frontends/dib7000p.c:918:37: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("SPLIT %p: %hd\n", demod, agc_split); ~~~ ^~~~~~~~~ %hhu Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: dib7000m: incorrect format specifier detected by clangSean Young1-1/+1
drivers/media/dvb-frontends/dib7000m.c:811:38: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat] dprintk("SPLIT %p: %hd\n", demod, agc_split); ~~~ ^~~~~~~~~ %hhu Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08Merge tag 'v5.5-rc5' into patchworkMauro Carvalho Chehab2-13/+13
Linux 5.5-rc5 * tag 'v5.5-rc5': (1006 commits) Linux 5.5-rc5 Documentation: riscv: add patch acceptance guidelines riscv: prefix IRQ_ macro names with an RV_ namespace clocksource: riscv: add notrace to riscv_sched_clock apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock hexagon: define ioremap_uc ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less ocfs2: call journal flush to mark journal as empty after journal recovery when mount mm/hugetlb: defer freeing of huge pages if in non-task context mm/gup: fix memory leak in __gup_benchmark_ioctl mm/oom: fix pgtables units mismatch in Killed process message fs/posix_acl.c: fix kernel-doc warnings hexagon: work around compiler crash hexagon: parenthesize registers in asm predicates fs/namespace.c: make to_mnt_ns() static fs/nsfs.c: include headers for missing declarations fs/direct-io.c: include fs/internal.h for missing prototype mm: move_pages: return valid node id in status if the page is already on the target node memcg: account security cred as well to kmemcg kcov: fix struct layout for kcov_remote_arg ...
2020-01-04Merge tag 'media/v5.5-3' of ↵Linus Torvalds2-17/+40
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - some fixes at CEC core to comply with HDMI 2.0 specs and fix some border cases - a fix at the transmission logic of the pulse8-cec driver - one alignment fix on a data struct at ipu3 when built with 32 bits * tag 'media/v5.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: intel-ipu3: Align struct ipu3_uapi_awb_fr_config_s to 32 bytes media: pulse8-cec: fix lost cec_transmit_attempt_done() call media: cec: check 'transmit_in_progress', not 'transmitting' media: cec: avoid decrementing transmit_queue_sz if it is 0 media: cec: CEC 2.0-only bcast messages were ignored
2020-01-04media: sun4i-csi: Add support for A10 CSI1 camera sensor interfaceChen-Yu Tsai2-5/+32
The A10/A20 Allwinner SoCs have two camera sensor interface blocks, named CSI0 and CSI1. The two have the same register layouts with slightly different features: - CSI0 has an image signal processor (ISP); CSI1 doesn't - CSI0 can support up to four separate channels under CCIR656; CSI1 can only support one - CSI0 can support up to 16-bit wide bus with YUV422; CSI1 can support up to 24-bit wide bus with YUV444 For now the driver doesn't support wide busses, nor CCIR656. So the only relevant difference is whether a clock needs to be taken and enabled for the ISP. Add structs to record the differences, tie them to the compatible strings, and deal with the ISP clock. Support for the new CSI1 hardware block is added as well. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: sun4i-csi: Deal with DRAM offsetChen-Yu Tsai1-0/+22
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 <wens@csie.org> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: sun4i-csi: Fix [HV]sync polarity handlingChen-Yu Tsai2-7/+15
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 <wens@csie.org> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: sun4i-csi: Fix data sampling polarity handlingChen-Yu Tsai1-1/+1
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 <wens@csie.org> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: i2c: mt9v032: fix enum mbus codes and frame sizesEugen Hristev1-2/+8
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 <wenyou.yang@microchip.com> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: ov5640: Fix check for PLL1 exceeding max allowed rateAdam Ford1-1/+1
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 <aford173@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: ov5640: Put max framerate into table and simplify checkAdam Ford1-17/+22
Currently the various modes are placed into a table, but when ov5640_find_mode is called, it has to double check whether or not the requested framerate is tolerated by the mode. The determination is based on checking hact, vact, and frame rate. Only 640x480 is allowed at 60fps and QSXGA is limited to 15fps, but as the number of permitted frame rates change, this will begin to add more and more complexity to the check. This patch simplifies the check by adding the max framerate allowed for each mode into the table of modes. It then compares the requested framerate to the max permitted in the mode's table. This reduces the number of comparisions to one down from three at run-time. Signed-off-by: Adam Ford <aford173@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: smiapp: Put the device again if starting streaming failsSakari Ailus1-1/+4
If there was an error in starting streaming, put the runtime usage count of the device. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: smiapp: Avoid maintaining power state informationSakari Ailus3-90/+113
Instead of keeping track of the power state ourselves, let runtime PM handle it. This also splits handling controls between side effect management and writing the new configuration to the sensor's registers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: omap3isp: Don't restart CCDC if we're about to stopSakari Ailus1-4/+8
The omap3isp driver set the new buffer and enabled the CCDC in a situation a new buffer was available but streaming was about to be stopped on the CCDC. This lead to frequent system crashes in case there were buffers queued when streming was being stopped. Fix this by first checking whether there's an intent to stop streaming and if there isn't, then set the new buffer and re-enable CCDC. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: omap3isp: Ignore failure of stopping streaming on external subdevSakari Ailus1-4/+4
The isp was marked to have failed to stop if stopping streaming on an external subdev failed. The return value from the external subdev should be ignored instead as it is not part of the ISP and thus the ISP does not need to be reset for that reason. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: dvb: add support for TerraTec TC2 Stick (193534)Tomasz Maciej Nowak1-5/+10
Seems to be a clone of Logilink VG0022A. Supports DVB-C, DVB-T and DVB-T2. Only terrestrial reception was tested on Polish and Czech multiplexes. Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: serial_ir: change "ignoring spike" to debug levelBodo Eggert1-1/+1
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: Bodo Eggert <7eggert@gmx.de> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: rtl28xxu: Add support for PROlectrix DV107669 DVB-T dongleDavid J. Fiddes1-0/+2
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: David J. Fiddes <D.J@fiddes.net> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: dvb_dummy_fe: Add blank line after declarationDaniel W. S. Almeida1-1/+2
Fix checkpatch.pl error by adding a blank line Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: dvb_dummy_fe: place EXPORT_SYMBOL below corresponding functionDaniel W. S. Almeida1-4/+3
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: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: rc: ensure lirc is initialized before registering input deviceSean Young1-11/+16
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: Nick French <nickfrench@gmail.com> Reported-by: Nick French <nickfrench@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: cxusb: use dev_dbg() rather than hand-rolled debugSean Young1-18/+15
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: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>