summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-08Revert "MLK-20957-1 mmc: sdhci-esdhc-imx: correct the fix of ERR004536"Philippe Schenker
This reverts commit b2d44eb43568cadda6326c5e3b13ff018fdf1af0.
2019-05-08Revert "MLK-16262: Input: snvs_pwrkey - move devm_request_irq to the end of ↵Philippe Schenker
probe function" This reverts commit 98d6bd67e3fc191dba8895807e6d90cf33813984. The same fix will be applied later with a commit from linux-stable.
2019-04-18MLK-21374 mmc: cqhci: clear pending interrupt and haltPeng Fan
On i.MX8MM, we are running Dual Linux OS, with 1st Linux using SD Card as rootfs storage, 2nd Linux using eMMC as rootfs storage. We let the the 1st linux configure power/clock for the 2nd Linux. When the 2nd Linux is booting into rootfs stage, we let the 1st Linux to destroy the 2nd linux, then restart the 1st linux, we met SDHCI dump as following, after we clear the pending interrupt and halt CQCTL, issue gone. [ 1.334594] mmc2: Got command interrupt 0x00000001 even though no command operation was in progress. [ 1.334595] mmc2: sdhci: ============ SDHCI REGISTER DUMP =========== [ 1.334599] mmc2: sdhci: Sys addr: 0xa05dcc00 | Version: 0x00000002 [ 1.340819] lib80211: common routines for IEEE802.11 drivers [ 1.345538] mmc2: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000000 [ 1.345541] mmc2: sdhci: Argument: 0x00018000 | Trn mode: 0x00000033 [ 1.345543] mmc2: sdhci: Present: 0x01f88008 | Host ctl: 0x00000031 [ 1.345547] mmc2: sdhci: Power: 0x00000002 | Blk gap: 0x00000080 [ 1.357903] mmc2: sdhci: Wake-up: 0x00000008 | Clock: 0x0000003f [ 1.357905] mmc2: sdhci: Timeout: 0x0000008f | Int stat: 0x00000000 [ 1.357908] mmc2: sdhci: Int enab: 0x107f100b | Sig enab: 0x107f100b [ 1.357911] mmc2: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000502 [ 1.370268] mmc2: sdhci: Caps: 0x07eb0000 | Caps_1: 0x0000b400 [ 1.370270] mmc2: sdhci: Cmd: 0x00000d1a | Max curr: 0x00ffffff [ 1.370273] mmc2: sdhci: Resp[0]: 0x00000b00 | Resp[1]: 0xffffffff [ 1.370276] mmc2: sdhci: Resp[2]: 0x328f5903 | Resp[3]: 0x00d00f00 [ 1.382132] mmc2: sdhci: Host ctl2: 0x00000000 [ 1.382135] mmc2: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0xa2040208 [ 2.060932] mmc2: Unexpected interrupt 0x00004000. [ 2.065538] mmc2: sdhci: ============ SDHCI REGISTER DUMP =========== [ 2.071720] mmc2: sdhci: Sys addr: 0x00000000 | Version: 0x00000002 [ 2.077902] mmc2: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000001 [ 2.084083] mmc2: sdhci: Argument: 0x00000000 | Trn mode: 0x00000000 [ 2.090264] mmc2: sdhci: Present: 0x01f88009 | Host ctl: 0x00000011 [ 2.096446] mmc2: sdhci: Power: 0x00000002 | Blk gap: 0x00000080 [ 2.102627] mmc2: sdhci: Wake-up: 0x00000008 | Clock: 0x000010ff [ 2.108809] mmc2: sdhci: Timeout: 0x0000008f | Int stat: 0x00004000 [ 2.114990] mmc2: sdhci: Int enab: 0x007f1003 | Sig enab: 0x007f1003 [ 2.121171] mmc2: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000502 [ 2.127353] mmc2: sdhci: Caps: 0x07eb0000 | Caps_1: 0x0000b400 [ 2.133534] mmc2: sdhci: Cmd: 0x0000371a | Max curr: 0x00ffffff [ 2.139715] mmc2: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0xffffffff [ 2.145896] mmc2: sdhci: Resp[2]: 0x328f5903 | Resp[3]: 0x00d00f00 [ 2.152077] mmc2: sdhci: Host ctl2: 0x00000000 [ 2.156342] mmc2: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000 Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
2019-04-15MLK-21312: drm/panel: rm67191: Add support for suspend/resumeRobert Chiras
The 'reset' pin used by this panel driver is shared with the touchscreen driver, which is causing issues during suspend/resume process. In order to better handle this gpio pin, release its resource during suspend and acquire it again in resume. Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-04-14MLK-21447: ASoC: fsl_rpmsg_i2s: underrun in m4 for msg delayedShengjiu Wang
With small buffer size, the resume will be triggered after suspend immediately, if we reserve the period done message to be sent with the next command, one period time later, it will cause underrun in m4 side, for ALSA thought the appl_ptr is updated, but the command won't be sent to M4 immediately, M4 don't have enough data to play. In this patch, we check that if the left size in the buffer is less that one period, the work queue will be triggered to send the period done message immediately. Fixes: 348d47695622 ("MLK-21307: ASoC: fsl_rpmsg_i2s: optimize the message sent to m4") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit 3dfecae40765329c0b7de1157f97ade24ecfce6d)
2019-04-12MLK-21380 video: fbdev: mxsfb: fix resume timing for overlay fbFancy Fang
The overlay fb can only be enabled when the LCDIF is not in running, otherwise overlay display may look like image shift. So during the system resume procedure, the overlay fb should be resumed before mxsfb unblank. Signed-off-by: Fancy Fang <chen.fang@nxp.com> (cherry picked from commit f39662a3a38a2da082d55a006e634766cc85e347)
2019-04-12MLK-21445 serial: fsl_lpuart: do HW reset for communication portFugang Duan
Do HW reset for communication port after the port is registered if the UART controller support the feature. Do partition reset with LPUART's power on, LPUART registers will keep the previous status, like on i.MX8QM platform, which is not expected action, so reset the HW is required. Currently, only i.MX7ULP and i.MX8QM LPUART controllers include global register that support HW reset. Tested-by: Robin Gong <yibin.gong@nxp.com> Tested-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Fugang Duan <fugang.duan@nxp.com> (cherry picked from commit c2bc1f62ec28981462c9cb5ceac17134931ca19f)
2019-04-12MLK-21443: dmaengine: fsl-edma-v3: clear pending irq before request irqRobin Gong
edma interrupt maybe happened during reboot or watchdog reset, meanwhile gic never power down on i.mx8QM/QXP, thus the unexpect irq will come in once edma driver request irq at probe phase. Unfortunately, at that time that edma channel's power domain which power-up by customer driver such as audio/uart driver may not be ready, so kernel panic triggered once touch such edma registers which still not power up in interrupt handler. Move request irq from probe to alloc dma channel so that edma channel's power domain has already been powered, besides, clear meaningless interrupt before request irq. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Acked-by: Fugang Duan <fugang.duan@nxp.com> (cherry picked from commit 0a0d8f8b944094342fda18f23f3ac13b8a73871d)
2019-04-12MLK-21307: ASoC: fsl_rpmsg_i2s: optimize the message sent to m4Shengjiu Wang
M4 complain that there are two much period done message sent to m4, that M4 don't have enough time to handle these messages. The solution for this issue is to reduce the number of period done message. We allocate a specific memory for period done message, every time there is period done coming, it will be writed to this memory, not write it directly to the work queue, that queue will not be overflow, and the old period done message will be overwrited. In the rpmsg_i2s_work, we first check if there is period done message, then send it first, after that, send the command in queue. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> (cherry picked from commit caabdfa176453cc7c8d6521f7865a670a7265a18)
2019-04-12MLK-21440-4: ASoC: imx-cs42888: remove snd_soc_find_daiShengjiu Wang
Previously we add snd_soc_find_dai to check if the codec is probed or not, but this bring kernel dump issue when CONFIG_LOCKDEP=y. [ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150 [ 2.831827] Modules linked in: [ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-00007-g524e1b1f0b3f #18 [ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT) [ 2.847811] task: ffff8000624f0000 task.stack: ffff000008078000 [ 2.853745] PC is at snd_soc_find_dai+0x144/0x150 [ 2.858462] LR is at snd_soc_find_dai+0x140/0x150 ... [ 3.469675] Call trace: [ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80) [ 3.478590] ba40: 0000000000000000 00000000ffffffff 0000000000000000 0000000000000002 [ 3.4864333.596564] [<ffff00000883f2a8>] bus_add_driver+0x110/0x230 [ 3.602149] [<ffff0000088412e8>] driver_register+0x68/0x100 [ 3.607735] [<ffff0000088426dc>] __platform_driver_register+0x54/0x60 [ 3.614191] [<ffff0000097e4cc8>] imx_rpmsg_driver_init+0x20/0x28 [ 3.620213] [<ffff0000080844c4>] do_one_initcall+0x44/0x130 [ 3.625801] [<ffff000009760ef8>] kernel_init_freeable+0x1e0/0x280 [ 3.631909] [<ffff00000908c3f8>] kernel_init+0x18/0x110 [ 3.637148] [<ffff000008085a4c>] ret_from_fork+0x10/0x1c So we could't resolve the warning "snd_soc_register_card failed (-517)". Fixes: 2bf5f9704785 ("MLK-19854-1: ASoC: imx-cs42888: fix error when m4 image is not loaded") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit 58ffdf239288cfa6904640fc8432c182cf56589b)
2019-04-12MLK-21440-3: ASoC: imx-wm8960: remove snd_soc_find_daiShengjiu Wang
Previously we add snd_soc_find_dai to check if the codec is probed or not, but this bring kernel dump issue when CONFIG_LOCKDEP=y. [ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150 [ 2.831827] Modules linked in: [ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-00007-g524e1b1f0b3f #18 [ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT) [ 2.847811] task: ffff8000624f0000 task.stack: ffff000008078000 [ 2.853745] PC is at snd_soc_find_dai+0x144/0x150 [ 2.858462] LR is at snd_soc_find_dai+0x140/0x150 ... [ 3.469675] Call trace: [ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80) [ 3.478590] ba40: 0000000000000000 00000000ffffffff 0000000000000000 0000000000000002 [ 3.4864333.596564] [<ffff00000883f2a8>] bus_add_driver+0x110/0x230 [ 3.602149] [<ffff0000088412e8>] driver_register+0x68/0x100 [ 3.607735] [<ffff0000088426dc>] __platform_driver_register+0x54/0x60 [ 3.614191] [<ffff0000097e4cc8>] imx_rpmsg_driver_init+0x20/0x28 [ 3.620213] [<ffff0000080844c4>] do_one_initcall+0x44/0x130 [ 3.625801] [<ffff000009760ef8>] kernel_init_freeable+0x1e0/0x280 [ 3.631909] [<ffff00000908c3f8>] kernel_init+0x18/0x110 [ 3.637148] [<ffff000008085a4c>] ret_from_fork+0x10/0x1c So we could't resolve the warning "snd_soc_register_card failed (-517)". Fixes: a52c88bc3932 ("MLK-19854-1: ASoC: imx-wm8960: fix error when m4 image is not loaded") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit f5d9013702e172a243da74a42941a62283bbe4a8)
2019-04-12MLK-21440-2: ASoC: imx-rpmsg: Remove snd_soc_find_daiShengjiu Wang
Previously we add snd_soc_find_dai to check if the codec is probed or not, but this bring kernel dump issue when CONFIG_LOCKDEP=y. [ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150 [ 2.831827] Modules linked in: [ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-00007-g524e1b1f0b3f #18 [ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT) [ 2.847811] task: ffff8000624f0000 task.stack: ffff000008078000 [ 2.853745] PC is at snd_soc_find_dai+0x144/0x150 [ 2.858462] LR is at snd_soc_find_dai+0x140/0x150 ... [ 3.469675] Call trace: [ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80) [ 3.478590] ba40: 0000000000000000 00000000ffffffff 0000000000000000 0000000000000002 [ 3.4864333.596564] [<ffff00000883f2a8>] bus_add_driver+0x110/0x230 [ 3.602149] [<ffff0000088412e8>] driver_register+0x68/0x100 [ 3.607735] [<ffff0000088426dc>] __platform_driver_register+0x54/0x60 [ 3.614191] [<ffff0000097e4cc8>] imx_rpmsg_driver_init+0x20/0x28 [ 3.620213] [<ffff0000080844c4>] do_one_initcall+0x44/0x130 [ 3.625801] [<ffff000009760ef8>] kernel_init_freeable+0x1e0/0x280 [ 3.631909] [<ffff00000908c3f8>] kernel_init+0x18/0x110 [ 3.637148] [<ffff000008085a4c>] ret_from_fork+0x10/0x1c So we could't resolve the warning "snd_soc_register_card failed (-517)". Fixes: 75632b22a332 ("MLK-20247: ASoC: imx-rpmsg: fix error when m4 image is not loaded") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit bbc1868d1c3ec448301d76606e7199f74aa35581)
2019-04-12MLK-21440-1: ASoC: fsl_rpmsg_i2s: init spin lockShengjiu Wang
With CONFIG_LOCKDEP=y, there will kernel dump [ 55.305563] INFO: trying to register non-static key. [ 55.310540] the code is fine but needs lockdep annotation. [ 55.316027] turning off the locking correctness validator. [ 55.321520] CPU: 0 PID: 32 Comm: kworker/0:1 Tainted: G W 4.14.78-00007-g524e1b1f0b3f #18 [ 55.330827] Hardware name: FSL i.MX8MM EVK board (DT) [ 55.335892] Workqueue: events rpmsg_work_handler [ 55.340515] Call trace: [ 55.342971] [<ffff00000808c438>] dump_backtrace+0x0/0x270 [ 55.348375] [<ffff00000808c6cc>] show_stack+0x24/0x30 [ 55.353433] [<ffff000009078f38>] dump_stack+0xb8/0xf0 [ 55.358490] [<ffff000008150404>] register_lock_class+0x364/0x548 [ 55.364501] [<ffff000008153544>] __lock_acquire+0x7c/0x18a8 [ 55.370077] [<ffff0000081555e8>] lock_acquire+0xc8/0x290 [ 55.375394] [<ffff00000909422c>] _raw_spin_lock_irqsave+0x54/0x70 [ 55.381493] [<ffff000008d80888>] i2s_rpmsg_cb+0xe8/0x1b0 [ 55.386810] [<ffff000008d01dc4>] rpmsg_recv_done+0x144/0x210 [ 55.392476] [<ffff000008713f44>] vring_interrupt+0x44/0x78 [ 55.397966] [<ffff000008d025d4>] imx_mu_rpmsg_callback+0x6c/0x80 [ 55.403977] [<ffff000008111f44>] notifier_call_chain+0x5c/0x98 [ 55.409813] [<ffff0000081124f8>] __blocking_notifier_call_chain+0x58/0xa0 [ 55.416605] [<ffff00000811257c>] blocking_notifier_call_chain+0x3c/0x50 [ 55.423223] [<ffff000008d029a0>] rpmsg_work_handler+0x88/0xe8 [ 55.428974] [<ffff000008108380>] process_one_work+0x290/0x738 [ 55.434723] [<ffff000008108880>] worker_thread+0x58/0x460 [ 55.440127] [<ffff000008110084>] kthread+0x104/0x130 [ 55.445096] [<ffff000008085a4c>] ret_from_fork+0x10/0x1c The reason is that the spin lock is not initilized. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit 0e98ac55f17f6505f92c515c3c04581039e21865)
2019-04-11MLK-21313 spi: lpspi: add missing complete in abort func at dma modeClark Wang
Add the missing complete operations for dma_completion to fix the problem of blocking at the wait_for_completion_interruptible() function in some situations. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit a19a00c51df5c3ead4d64ea3136f5bce60b2e6af)
2019-04-10MLK-21424 can: flexcan: fix normal CAN can't receive remote frame after ↵Joakim Zhang
setting fd mode The variable "is_canfd" will stay true after the following sequence: root@imx8qxpmek:~# ip link set can0 type can bitrate 1000000 dbitrate 4000000 fd on root@imx8qxpmek:~# ip link set can0 up root@imx8qxpmek:~# ip link set can0 down root@imx8qxpmek:~# ip link set can0 type can bitrate 1000000 It will use alloc_canfd_skb() to allocate skb for normal CAN when "is_canfd" is true, which will affect the receive of remote frame. Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2019-04-10MGS-4656 [#imx-1381] fix the wrong device check for imx8 gpu subsystemXianzhong
should check imx8-gpu instead of imx8x-gpu string for i.mx8 gpu sub-system Signed-off-by: Xianzhong <xianzhong.li@nxp.com> (cherry picked from commit ce6483c43465651469c75b0e5093bdc749866f84)
2019-04-10MLK-21368 staging: typec: tcpci: disable irq when system suspendLi Jun
Disable typec irq when suspend to avoid the threaded irq to access some resource(e.g. i2c over rpmsg) but those resource is not available at later phrase, also use IRQ_DISABLE_UNLAZY flag to mask the irq on irq chip level when irq happens. Suggested-by: Anson Huang <anson.huang@nxp.com> Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> (cherry picked from commit 61869f787fb0ee2f00d0fe9443cb8b487e16e5ec)
2019-04-10MLK-21355 staging: typec: tcpm: use freezable workqueue for event handlingLi Jun
While system suspend, the typec event handling required service maybe is not available(suspended), so we need freeze those event handling by using freezable workqueue, e.g while tcpm is handling PD message but system suspend started. Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> (cherry picked from commit 270d4df94b7c2c773a171fe012fb8ce89196964f)
2019-04-10MLK-21407 gpu: imx: dpu: tcon: Assign tcon idLiu Ying
We should assign dedicated id for every tcon instance. This makes us be able to figure out bewteen master and slave tcon. Only side-by-side display mode is likely impacted. Based on tests, no functional change is observed before or after this patch is applied. Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit e181d9e56b096bbdc919f65b223d1bde413df1bb)
2019-03-29MLK-21292 ARM64: dts: imx8mm: introduce inamte linuxPeng Fan
Introduce inmate linux support for jailhouse, we need to benchmark inmate OS, so choose linux. The clock/pin are preconfigured by 1st root cell linux. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Ye Li <ye.li@nxp.com>
2019-03-29MGS-4652 [#imx-1379] fix coverity dereference issueXianzhong
CID: 5781508 device pointer should not be used before null check Signed-off-by: Xianzhong <xianzhong.li@nxp.com> (cherry picked from commit 17942905375a282ed9896c3cc778a246c321f5f0)
2019-03-29MGS-4645-2 [#imx-1373] fix command object race condition riskXianzhong
Vulkan driver has problem to commit command without device mutex, command object has race condition risk without mutex protection. move _ProcessUserCommandBufferList into command mutex region. Signed-off-by: Xianzhong <xianzhong.li@nxp.com> (cherry picked from commit 10120a64fd9342c8effd21eb62bc51f88f1493cb)
2019-03-29MLK-21279 drm/bridge: it6263: Staticize it6263_mode_valid()Liu Ying
It is only used in this file, so staticize it. Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit e293f8671509ed54c83a51b40da53da3bdf216f5)
2019-03-28MLK-21278 drm/imx: dpu: crtc: Staticize dpu_crtc_get_aux_dpu_crtc()Liu Ying
It isn't used out side of the file for now. Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit 13a0d5c3b15e42834b872b0da904f874ff717500)
2019-03-28MLK-21269 drm/imx: dpu: crtc: Wait for FG moving after tcon mode switch for ↵Liu Ying
non-PC cases Due to TKT320590, we are asked to turn TCON into operation mode later after the first dumb frame is generated by DPU. This makes DPR/PRG be able to evade the frame. However, it turns out we have to set the TCON into operation mode first and then wait for Framegen frame counter moving, otherwise, the display pipeline cannot be setup correctly sometimes(If pixel combiner is used, one of the two display streams is likely broken). This is a mysterious issue. So, we've already taken a workaround for the cases where pixel combiner is used. It appears that the similar issue is likely to happen for cases where pixel combiner is unused. That is to say, if pixel combiner is unused and prefetch engine is used, the first atomic flush after the enablement is likely to fail - content shadow load irq doesn't come. The sequence which the patch takes is the same to the one taken by the previous workaround. Based on tests, it is valid for cases with or without pixel combiner. Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit b6126aa9697c77896d2085997eec2a6995509f4b)
2019-03-28MLK-20208-4 mxc IPUv3: disp: Avoid division by zero in ipu_init_sync_panel()Liu Ying
To avoid potential division by zero in ipu_init_sync_panel(), let's check the rounded_pixel_clk rate prior to that. Detected by CoverityScan, CID#56278 ("Division or modulo by zero") Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit 1523150b71f1aa0610f61ea47a9f3bdbcda92522)
2019-03-28MLK-20208-3 mxc IPUv3: disp: Avoid division by zero in ipu_init_async_panel()Liu Ying
To avoid potential division by zero in ipu_init_async_panel(), let's check the di_clk rate prior to that. Detected by CoverityScan, CID#56264 ("Division or modulo by zero") Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit d7777247e6ba4ca9fcc313bef6672060859fed19)
2019-03-28MLK-20208-2 mxc IPUv3: device: Avoid potential out of bounds array accessLiu Ying
To avoid potential out of bounds array access on tbl->used[][], let's check the tsk->ipu_id prior to that. Based on the context, this is what we can do to make the coverity happy. Detected by CoverityScan, CID#17689 ("Derefernece before null check") Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit f5dcf709c54da8e64eb84f1dd7a4452ad8d942cf)
2019-03-28MLK-20208-1 mxc IPUv3: device: Remove a piece of dead code in ipu_task_thread()Liu Ying
The check on !sp_tsk0 is unnecessary in ipu_task_thread(), because the beforehand "list_del(&sp_tsk0->node);" within the context implies sp_tsk0 is not null, otherwise, we'll dereference a null pointer earlier. Detected by CoverityScan, CID#17842 ("Logically dead code") Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit 9ad5edd076d61bc8bb3a558e523cc7b31f2c3043)
2019-03-27MLK-21144 ASoC: fsl: Fix crash with multiple open/closeDaniel Baluta
Because we are re-initializing the proxy at close it might happen that work is still pending which causes the following crash: [ 94.699835] Unable to handle kernel NULL pointer dereference at virtual address 00000008 [ 94.707923] Mem abort info: [ 94.710722] Exception class = DABT (current EL), IL = 32 bits [ 94.716637] SET = 0, FnV = 0 [ 94.719686] EA = 0, S1PTW = 0 [ 94.722822] Data abort info: [ 94.725698] ISV = 0, ISS = 0x00000005 [ 94.729530] CM = 0, WnR = 0 [ 94.732504] user pgtable: 4k pages, 48-bit VAs, pgd = ffff8008d9ba3000 [ 94.739035] [0000000000000008] *pgd=0000000938419003, *pud=0000000000000000 [ 94.746015] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 94.751589] Modules linked in: [ 94.754652] CPU: 0 PID: 2068 Comm: kworker/0:2 Not tainted 4.14.98-dirty #75 [ 94.761700] Hardware name: Freescale i.MX8QM MEK (DT) [ 94.766768] task: ffff8008f23ae200 task.stack: ffff000014378000 [ 94.772705] PC is at process_one_work+0x34/0x414 [ 94.777325] LR is at process_one_work+0x1e0/0x414 In order to fix this, we make sure that no work is pending before starting the re-initialization. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit 2c00c24be5f8b63636e3f9005e15a3de42058438)
2019-03-27MLK-20546-2: drm/imx/dcss: check status bit when handling interruptsLaurentiu Palcu
Double check that the DTG IRQ STATUS register bit is set when handling the vblank and CTXLD kick interrupts to make sure we avoid spurious interrupts and kick the CTXLD in a bad moment. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com> (cherry picked from commit cc56e4e07f623d0b831e0f8347f2f3198697ee20)
2019-03-27MLK-20546-1: drm/imx/dcss: fix crtc enable/disable completion signallingLaurentiu Palcu
Using one completion variable is not feasible as we can hit corner cases like enabling and then quickly disabling DCSS where we end up signaling that DTG was correctly disabled when, in fact, a VBLANK interrupt was received. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com> (cherry picked from commit 8073e87dce34548bea758c34d3b3557819c75551)
2019-03-27MLK-21249: drm/imx/hdp: do not set BT2020 colorimetry for 8bit color depthLaurentiu Palcu
Currently, we set the colorimetry to BT.2020 even if the color-depth is 8 bit. This is not according to HDMI specification. This patch makes sure we follow the specs. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com> CC: Sandor Yu <sandor.yu@nxp.com> Reviewed-by: Sandor Yu <sandor.yu@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com> (cherry picked from commit cdacfaadd5dccfdca5dd68640d8f08506f6a9114)
2019-03-27MLK-21150-4 drm/bridge: sec-dsim: a general way to compute PLL PMSFancy Fang
A fixed PLL PMS setting for attached panel is obviously not enough for any other mipi panel which needs a different PLL output clock frequency, and besides, for the CEA-861 standard display modes, the 'pll_pms' table also can not cover all the modes requirements. So a general way is created to solve this problem which can provide an optimum solution to output a PLL bit clock to match the request frequency in a maximum degree and also satisfy the input clock and intermediate clocks limit according to the PLL specification. Signed-off-by: Fancy Fang <chen.fang@nxp.com> (cherry picked from commit a73fdd5e48fe0df47685cfc197fe66edc1e28405)
2019-03-27MLK-21150-3 drm/bridge: sec-dsim: add a new property 'pref-rate'Fancy Fang
Add a new property 'pref-rate' support which can be used to assign a different clock frequency for the DPHY PLL reference clock in the dtb file. And if this property does not exist, the default clock frequency for the reference clock will be used. And according to the spec, the DPHY PLL reference clk frequency should be in [6MHz, 300MHz] range. Signed-off-by: Fancy Fang <chen.fang@nxp.com> (cherry picked from commit a9fafe8108505f8a1580af898ff5fa9c26d03680)
2019-03-27MLK-21150-2 drm/bridge: sec-dsim: refine hblank word count computeFancy Fang
When there is no existing horizontal blanking word counts in 'dsim_hblank_par' tables, these data requires to be computed according to the 'hfp', 'hbp' and 'hsa' timings which are in pixel unit. So the pixel unit data requires to be converted to word count unit data correctly to match the PLL output clk frequency. Signed-off-by: Fancy Fang <chen.fang@nxp.com> (cherry picked from commit af9ab0d4362d9298978e2ac62033f65ea1cc09ed)
2019-03-27MLK-21150-1 drm/bridge: sec-dsim: change uint64_t clk fields to uint32_tFancy Fang
Change the 'bit_clk' and 'pix_clk' fields of struct sec_mipi_dsim and the 'bit_clk' field of struct dsim_pll_pms from 'uint64_t' type to 'uint32_t' type, since first, these two fields are in KHz unit, and so 32 bit unsigned integer is enough to hold the data values, and second, use 32 bit integer can simplify related clocks compute. Signed-off-by: Fancy Fang <chen.fang@nxp.com> (cherry picked from commit 3e62c748a531ca5eacbf6a616d3a979be5222b9c)
2019-03-25MLK-21247 rpmsg: imx: do not check the remote ready flag in suspend modeRichard Zhu
Since, the partition reset irq would be triggered anytime. Do not read the status of the MU if master side is in suspend mode. Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> (cherry picked from commit 117dbcb1ce258587f8d162c0b3219f32d6de6fbc)
2019-03-23MLK-20367 drm/bridge: sec-dsim: Fix potential arithmetic overflowOliver Brown
Coverity reported potential arithmetic overflow of a 32-bit multiply operation. Adding a cast to promote the mulitply opertion to use 64 bits. Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2019-03-23MLK-20217 drm/imx: imx-tve: Fix potential divide by zeroOliver Brown
Coverity reported a potential divide by zero. Adding a check to prevent a divide by zero. Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2019-03-23MLK-20195-2 hdp: fix dead code errorOliver Brown
Fixed a dead code error reported by Coverity. CID 1826265: Logically dead code Signed-off-by: Oliver Brown <oliver.brown@nxp.com> (cherry picked from commit 4b25b038a2278b0782e144ec3e3907fbcbc138c1)
2019-03-23MLK-20195-1 hdp: fix uninitialized variablesOliver Brown
Fixed two issues resported by Coverity: CID 343354: Uninitialized scalar variable CID 343355: Uninitialized scalar variable Signed-off-by: Oliver Brown <oliver.brown@nxp.com> (cherry picked from commit abc359e835dca5942d9dc101bfdc55f243e01d65)
2019-03-23MLK-20209 hdmi rx: fixed unsigned compare against less than zeroOliver Brown
Fixed CID 3411368, Unsigned compared against 0. Removed comparison with no effect. Signed-off-by: Oliver Brown <oliver.brown@nxp.com> (cherry picked from commit 7a90cb82d00109cdd00eea67fbf9d75b6efe6172)
2019-03-23MLK-20209 hdmi: fixed unsigned compare against less than zeroOliver Brown
Fixed CID 17375, Unsigned compared against 0. Removed code with no effect. Signed-off-by: Oliver Brown <oliver.brown@nxp.com> (cherry picked from commit b86debc52acd4131515f62130f52c2d0f48cdbfe)
2019-03-23MLK-20370 IPU: mxc_vout: fix the potential uninitalized variable usageOliver Brown
Fix Covertity CID 18110 Uninitialized scalar variable Signed-off-by: Oliver Brown <oliver.brown@nxp.com> (cherry picked from commit 0f2a05c5cef95dabdbdd1e78531cd42aec24876a)
2019-03-23MLK-21244 rpmsg: imx: move pm ops to noirq phraseAnson Huang
Some rpmsg user may require rpmsg resume before the user start handle its irq, e.g the typec controller use a GPIO as irq and use rpmsg to get event status, so move imx rpmsg power management ops to noirq phrase. Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com> Tested-by: Clark Wang <xiaoning.wang@nxp.com> Signed-off-by: Anson Huang <anson.huang@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2019-03-22MLK-21227: drm: imx: hdp: imx8: Change link rate messageOliver Brown
Changing error message "Link rate is too high - forcing link to lower rate" to a debug message "Lowering DP link rate from <old rate> to <new rate>". Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2019-03-22MLK-21232 drm/imx: dpu: crtc: Wait for FrameGen secondary syncup for non-PC ↵Liu Ying
cases Although the hardware spec doesn't mention the additional operation to wait for FrameGen secondary syncup for non-PC cases(FrameGen non-sync mode) when we enable a display, it turns out it helps avoid content stream(i.e., extdst0 or extdst1) shadow load done event missing issue when the first page flip ocurrs after the display enablement. Black/blanked display is observed when the issue happens, which means the video signal is likely totally off. Adding this waiting operation also aligns to the cases where PC is used. Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit cfedc1269f35054c79d7fd2e2a914e97a4c1a47a)
2019-03-22MLK-21231 gpu: imx: dpu: framegen: Wait for 100ms at most for secondary syncupLiu Ying
Another coming patch will wait for framegen secondary channel syncup for non-sync mode cases. It appears that waiting for 50ms for video modes like 1920x1080p@24 and 1920x1080p@30 is not enough. So, this patch increases the timeout value to 100ms. Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit 5357bce465db659d69a5026882a899f2077ee078)
2019-03-22MLK-21073 usb: cdns3: core: fix the oops when the interrupt occurs during ↵Peter Chen
suspend When the interrupt occurs during the USB is entering suspend, the cdns->lpm flag may not be updated well, the below oops may occur. We treat above interrupt as wakeup interrupt, it should be handled after lpm flag is set. irq 120: nobody cared (try booting with the "irqpoll" option) CPU: 0 PID: 107 Comm: kworker/0:1 Tainted: G O 4.14.78 #1 Hardware name: Freescale i.MX8QM MEK (DT) Workqueue: pm pm_runtime_work Call trace: [<ffff000008083230>] el1_irq+0xb0/0x124 [<ffff000009028fcc>] _raw_spin_unlock_irqrestore+0x18/0x48 [<ffff000008147a6c>] __irq_put_desc_unlock+0x1c/0x44 [<ffff000008149e4c>] enable_irq+0x54/0x90 [<ffff0000089cb08c>] cdns3_enter_suspend+0x30c/0x3ac [<ffff0000089cb274>] cdns3_runtime_suspend+0x40/0x78 [<ffff000008796cd8>] pm_generic_runtime_suspend+0x28/0x48 [<ffff0000087a7400>] genpd_runtime_suspend+0x90/0x21c [<ffff00000879a14c>] __rpm_callback+0x130/0x264 [<ffff00000879a2a4>] rpm_callback+0x24/0x78 [<ffff000008798ec8>] rpm_suspend+0x10c/0x668 [<ffff0000087996b4>] rpm_idle+0x1c0/0x390 [<ffff00000879aa6c>] pm_runtime_work+0x94/0xe0 [<ffff0000080fac88>] process_one_work+0x140/0x3f8 [<ffff0000080fb078>] worker_thread+0x138/0x3e4 [<ffff0000081014e0>] kthread+0x104/0x130 [<ffff00000808552c>] ret_from_fork+0x10/0x18 Signed-off-by: Peter Chen <peter.chen@nxp.com>