linux.git
6 years agoMLK-21006 Driver: lpuart: Disable interrupts before request irq
Flynn xu [Fri, 1 Mar 2019 22:59:31 +0000 (17:59 -0500)]
MLK-21006 Driver: lpuart: Disable interrupts before request irq

Commit b311ef1d549b ("MLK-20989: Driver: lpuart: reset registers
before enable lpuart") breaks early console function, and the
commit already was reverted. The reworked patch is to fix the
issue correctly.

This patch has been tested on i.MX8QM/QXP.

change log:
V1 -> V2:
  1. Remove lock, since there is no race condition.

Suggested-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Flynn xu <flynn.xu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 161f0144934fe917123c79eae6a7539806d1e04e)

6 years agoMLK-20970: mtd: flexspi: add delay cell support for fspi
Han Xu [Fri, 22 Feb 2019 16:34:21 +0000 (10:34 -0600)]
MLK-20970: mtd: flexspi: add delay cell support for fspi

Add delay cell support for fspi to set calibrated value to DLL register
for different clock frequency.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 5b608b98697668bd11563febba89bd0eea1c1b26)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 75bd56659a626a2f013e7ec3e9019eede68bd315)

6 years agoMLK-20957-2 mmc: cqhci: clear the HALT bit in the first request when resume back
Haibo Chen [Fri, 22 Feb 2019 09:56:18 +0000 (17:56 +0800)]
MLK-20957-2 mmc: cqhci: clear the HALT bit in the first request when resume back

After system suspend, CQE is in cqhci_off state, which set the HALT bit, make
CQE in HALT state. If the SoC do not power down the USDHC module, then when
system resume back, this bit keep the same, still set. So need to clear this
bit when enable CQE for the first request after system resume back. If not,
imx8mm will stuck in the first CMDQ request after system resume back. On
imx8qxp and imx8qm, we do not find this issue because usdhc module lost power
during system suspend/resume, and all the register return to the default reset
value, and the reset value of bit HALT is 0.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 49d6f5d5cca3a66fa65568a50f75cbbac87ba312)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit bb7964bdf5dee51e82d8b7fff3e2454e3c9a57fc)

6 years agoMLK-20957-1 mmc: sdhci-esdhc-imx: correct the fix of ERR004536
Haibo Chen [Thu, 21 Feb 2019 06:38:04 +0000 (14:38 +0800)]
MLK-20957-1 mmc: sdhci-esdhc-imx: correct the fix of ERR004536

the commit 885c943ca13d ("ENGR00288842 mmc: sdhci-esdhc-imx: add
ADMA Length Mismatch errata fix") involve the fix of ERR004536.
But double confirm with IC, need to clear the bit 7 of register
0x6c rather than set this bit 7.
here is the function of bit 7 of 0x6c:
0: enable the new IC fix for ERR004536
1: do not use the IC fix, keep the same as before

Due to the reset value of this bit 7 is 0, and ROM code also do not
touch this bit 7, so this patch directly remove the operation of this
bit 7, make sure the fix of ERR004536 can work.

Note, for all versons of 6DQP 6DQ 6DL and 6SL, IC do not has this
hardware fix, so writing this bit has no effect and we keep using
ADMA as before which has been used for several years with the
consideration of no performance drop.

For other SoC like imx6SLL imx6SX imx6UL/imx6ULL imx7 imx8, IC already
contain this hareware fix, so must make sure the bit 7 of the register
0x6c is 0. If not, we meet the ADMA length mismatch error on imx8mm-evk
and imx8qxp-ddr3l-val board when enable CMDQ.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 2ea2f2b374545ff63a714fabc16c0d7c6b3b47b6)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 359538c2faf5d975072c9950e510d61d10815a69)

6 years agoMLK-20956 rtc: imx-rpmsg: do NOT overwrite rtc driver data
Anson Huang [Wed, 20 Feb 2019 03:10:26 +0000 (11:10 +0800)]
MLK-20956 rtc: imx-rpmsg: do NOT overwrite rtc driver data

Some test cases need to use RTC driver data, so do NOT
overwrite it using rpmsg data structure.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit da74fb3d328f037ecb1832a53f45cebdbda8f86f)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 776e5fa2eef90e50cbd90c904c7f880323e8bc33)

6 years agoMLK-20951 arm: imx: Update the mmdc io save/restore on imx7ulp
Jacky Bai [Mon, 18 Feb 2019 06:03:40 +0000 (14:03 +0800)]
MLK-20951 arm: imx: Update the mmdc io save/restore on imx7ulp

When system enters VLPS/VLLS mode, the IOMUXC config register
for MMDC related IO pads need to set to '0' to reduce the current
leakage for these IO pads.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit acf5535cf6603fd5a68cb86c88a685d5f70db8d5)

6 years agoMLK-20882: pxp: add VUY444 format support for PXP PS engine
Guoniu.Zhou [Mon, 11 Feb 2019 03:24:21 +0000 (11:24 +0800)]
MLK-20882: pxp: add VUY444 format support for PXP PS engine

VUY444 is supported by PXP HW but driver miss it. so add it

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 57e9b876954170cd0718eb8af8666573ebb26bb4)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 4e62c1fb7a8f1ef14ea35fe5d5294b17f18cebbe)

6 years agoMLK-20060-6 dts: lpspi: Prevent CS line error in slave mode
Clark Wang [Thu, 3 Jan 2019 09:54:11 +0000 (17:54 +0800)]
MLK-20060-6 dts: lpspi: Prevent CS line error in slave mode

Prevent cs line configuration error in slave mode.

If master mode uses cs-gpio configuration, it should be changed into
non-gpio for CS line in slave mode. Otherwise, slave will receive several
0xFF at the beginning of one transfer especially in dma mode.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <Fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 88ba1025094d53fdecd1b443ef1a85514a132f21)

6 years agoMLK-20368 i2c-imx: Coverity: fix divide by zero warning
Clark Wang [Tue, 15 Jan 2019 02:04:30 +0000 (10:04 +0800)]
MLK-20368 i2c-imx: Coverity: fix divide by zero warning

"i2c_clk_rate / 2" might be zero when the i2c_clk_rate gets the clock is
0 or 1, so add a judgment to avoid the denominator is equal to 0.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
[Arul: Add support to check return value everywhere in the driver]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit d382de595bffc0975ab7c0582e08dd4f7afc0c1a)

6 years agoMLK-20716 PCI: add quirk for cyw4356 to disable D3 mode
Andy Duan [Mon, 7 Jan 2019 10:45:41 +0000 (18:45 +0800)]
MLK-20716 PCI: add quirk for cyw4356 to disable D3 mode

Add quirk for cyw4356 to disable D3 mode because current firmware
still doesn't support D3 mode.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 22212c60d7fb067e28a2fed16914515e3d6d3950)

6 years agoMLK-20389 Changed OPTEE busfreq trace
Cedric Neveux [Fri, 16 Nov 2018 13:01:21 +0000 (14:01 +0100)]
MLK-20389 Changed OPTEE busfreq trace

   To be able to constat that busfreq is started/done vith
   OPTEE OS, changed the mach-imx/busfreq_optee.c pr_debug
   macro with printk(KERN_DEBUG ...)

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 8e416ebaada127eeb408cf2e2ffc41202933eebb)

6 years agoMLK-20582 Fix busfreq compilation CONFIG_OPTEE=n
Cedric Neveux [Thu, 13 Dec 2018 12:14:25 +0000 (13:14 +0100)]
MLK-20582 Fix busfreq compilation CONFIG_OPTEE=n

   Compilation error with busfreq optee when CONFIG_OPTEE=n

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit db9e345f9bd67048bcb17d9df306b35f64abbb14)

6 years agoMLK-20682 reset: gpio-reset: add suspend/resume callback
Andy Duan [Thu, 20 Dec 2018 09:08:20 +0000 (17:08 +0800)]
MLK-20682 reset: gpio-reset: add suspend/resume callback

The reset PIN may loss its state when system suspend due to GPIO
controller power off. Set pinctrl as "sleep" state to keep PIN
voltage during system suspend, and configurate pinctrl as "default"
state after system resume back. Because GPIO resume back earlier
than gpio-reset, then GPIO signal can control the PIN voltage again.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit ea5a9cdc1941afc36fd0f5a223ea762b85512130)

6 years agoMLK-20585-2 usb: cdns3: gadget: fix the KASAN issue
Peter Chen [Mon, 24 Dec 2018 06:59:50 +0000 (14:59 +0800)]
MLK-20585-2 usb: cdns3: gadget: fix the KASAN issue

BUG: KASAN: use-after-free in pending_setup_status_handler+0x4c/0x9c
Read of size 8 at addr ffff8008b2fb6130 by task kworker/0:1/4432

CPU: 0 PID: 4432 Comm: kworker/0:1 Not tainted 4.14.78-06631-gd2e1817-dirty #18
Hardware name: Freescale i.MX8QM MEK (DT)
Workqueue: events_freezable pending_setup_status_handler
Call trace:
[<ffff20000808dff8>] dump_backtrace+0x0/0x49c
[<ffff20000808e4a8>] show_stack+0x14/0x1c
[<ffff20000967b808>] dump_stack+0xa0/0xc8
[<ffff200008344f80>] print_address_description+0x124/0x2f8
[<ffff200008345404>] kasan_report+0x200/0x348
[<ffff200008343780>] __asan_load8+0x6c/0x84
[<ffff200008d897d8>] pending_setup_status_handler+0x4c/0x9c
[<ffff2000081236e4>] process_one_work+0x250/0x72c
[<ffff200008123c58>] worker_thread+0x98/0x69c
[<ffff20000812cd00>] kthread+0x170/0x1b0
[<ffff200008085cd8>] ret_from_fork+0x10/0x18

Allocated by task 4689:
 kasan_kmalloc.part.5+0x50/0x124
 kasan_kmalloc+0xc4/0xe4
 kmem_cache_alloc_trace+0x13c/0x298
 usb_ss_gadget_ep_alloc_request+0x48/0x50
 usb_ep_alloc_request+0x44/0x16c
 composite_dev_prepare+0x4c/0x1b8
 configfs_composite_bind+0x6c/0x694
 udc_bind_to_driver+0xcc/0x218
 usb_gadget_probe_driver+0x108/0x1b0
 gadget_dev_desc_UDC_store+0xf4/0x174
 configfs_write_file+0x184/0x25c
 vfs_write+0xf0/0x26c
 SyS_write+0x64/0xd4
 el0_svc_naked+0x34/0x38

Freed by task 3406:
 kasan_slab_free+0xb0/0x1c0
 kfree+0x7c/0x270
 usb_ss_gadget_ep_free_request+0x10/0x18
 usb_ep_free_request+0x44/0x158
 composite_dev_cleanup+0x188/0x230
 configfs_composite_unbind+0x48/0x80
 usb_gadget_remove_driver+0x84/0xf0
 usb_gadget_unregister_driver+0x10c/0x134
 gadget_dev_desc_UDC_store+0xa0/0x174
 configfs_write_file+0x184/0x25c
 vfs_write+0xf0/0x26c
 SyS_write+0x64/0xd4
 el0_svc_naked+0x34/0x38

The buggy address belongs to the object at ffff8008b2fb6100
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 48 bytes inside of
 128-byte region [ffff8008b2fb6100ffff8008b2fb6180)
The buggy address belongs to the page:
page:ffff7e0022cbed80 count:1 mapcount:0 mapping:          (null) index:0x0

Reported-by: Yang Tian <yang.tian@nxp.com>
Tested-by: Yang Tian <yang.tian@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 78d9001692cc77d1e0c60ada2e00b1d2afca92f0)

6 years agoMLK-20585-1 usb: cdns3: gadget: fix the KASAN issue
Peter Chen [Wed, 12 Dec 2018 09:15:46 +0000 (17:15 +0800)]
MLK-20585-1 usb: cdns3: gadget: fix the KASAN issue

BUG: KASAN: use-after-free in cdns3_gadget_remove+0x114/0x1d8
Read of size 8 at addr ffff80081f8817a0 by task swapper/0/1

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.78-05577-gbe1ecd23b99a-dirty #231
Hardware name: Freescale i.MX8QXP MEK (DT)
Call trace:
[<ffff20000808cd10>] dump_backtrace+0x0/0x510
[<ffff20000808d234>] show_stack+0x14/0x20
[<ffff200009471d84>] dump_stack+0xa4/0xc8
[<ffff2000082966c0>] print_address_description+0x60/0x250
[<ffff200008296bb8>] kasan_report+0x240/0x308
[<ffff2000082952e0>] __asan_load8+0x88/0xb0
[<ffff200008d089cc>] cdns3_gadget_remove+0x114/0x1d8
[<ffff200008d0220c>] cdns3_probe+0x634/0x940
[<ffff2000089ebf10>] platform_drv_probe+0x70/0xf0
[<ffff2000089e9060>] driver_probe_device+0x388/0x5f0
[<ffff2000089e9414>] __driver_attach+0x14c/0x150
[<ffff2000089e5dd8>] bus_for_each_dev+0xd8/0x138
[<ffff2000089e8560>] driver_attach+0x30/0x40
[<ffff2000089e7c38>] bus_add_driver+0x278/0x3a0
[<ffff2000089ea27c>] driver_register+0xb4/0x198
[<ffff2000089ebe0c>] __platform_driver_register+0x7c/0x88
[<ffff20000a0d78e8>] cdns3_driver_platform_register+0x1c/0x24
[<ffff200008083cc0>] do_one_initcall+0x90/0x1b8
[<ffff20000a071040>] kernel_init_freeable+0x238/0x2d8
[<ffff20000948c2a8>] kernel_init+0x10/0x118
[<ffff200008085450>] ret_from_fork+0x10/0x18

Allocated by task 1:
 kasan_kmalloc+0xd8/0x188
 __cdns3_gadget_init+0xb8/0x998
 cdns3_gadget_init+0xbc/0xd0
 cdns3_probe+0x718/0x940
 platform_drv_probe+0x70/0xf0
 driver_probe_device+0x388/0x5f0
 __driver_attach+0x14c/0x150
 bus_for_each_dev+0xd8/0x138
 driver_attach+0x30/0x40
 bus_add_driver+0x278/0x3a0
 driver_register+0xb4/0x198
 __platform_driver_register+0x7c/0x88
 cdns3_driver_platform_register+0x1c/0x24
 do_one_initcall+0x90/0x1b8
 kernel_init_freeable+0x238/0x2d8
 kernel_init+0x10/0x118
 ret_from_fork+0x10/0x18

Freed by task 1:
 kasan_slab_free+0x88/0x188
 kfree+0x70/0x1e0
 cdns3_gadget_release+0x60/0x80
 device_release+0x44/0xd8
 kobject_put+0xd8/0x280
 device_unregister+0x28/0x80
 cdns3_gadget_remove+0x100/0x1d8
 cdns3_probe+0x634/0x940
 platform_drv_probe+0x70/0xf0
 driver_probe_device+0x388/0x5f0
 __driver_attach+0x14c/0x150
 bus_for_each_dev+0xd8/0x138
 driver_attach+0x30/0x40
 bus_add_driver+0x278/0x3a0
 driver_register+0xb4/0x198
 __platform_driver_register+0x7c/0x88
 cdns3_driver_platform_register+0x1c/0x24
 do_one_initcall+0x90/0x1b8
 kernel_init_freeable+0x238/0x2d8
 kernel_init+0x10/0x118
 ret_from_fork+0x10/0x18

The buggy address belongs to the object at ffff80081f881100
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 1696 bytes inside of
 4096-byte region [ffff80081f881100ffff80081f882100)
The buggy address belongs to the page:
page:ffff7e00207e2000 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x1fffc00000008100(slab|head)
raw: 1fffc00000008100 0000000000000000 0000000000000000 0000000180070007
raw: dead000000000100 dead000000000200 ffff800822003200 0000000000000000
page dumped because: kasan: bad access detected

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 62683f2ada3da52981b7cf3775a9bab95de2b00f)

6 years agoMLK-20599-2 usb: cdns3: gadget: fix link test TD 7.37
Peter Chen [Wed, 19 Dec 2018 06:24:03 +0000 (14:24 +0800)]
MLK-20599-2 usb: cdns3: gadget: fix link test TD 7.37

USB3 device should accept LGO_U1 request after receiving SET_CONFIGURATION.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 4e1fc76ac36ebde235abe7dc0dc78a73ff9544b4)

6 years agoMLK-20599-1 usb: cdns3: gadget: fix link test TD 7.23
Peter Chen [Mon, 17 Dec 2018 06:57:10 +0000 (14:57 +0800)]
MLK-20599-1 usb: cdns3: gadget: fix link test TD 7.23

The USB compliance link test TD 7.23 requires the U1 exit time
is from 900ns to 1.2us, the current code is 744ns, the default
value is 1.104us, so changing it as default value.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit be0a22ce7192387b98a887d3ce4358e1db71b9f4)

6 years agoMLK-20371: video: fbdev: adv7535: Fix coverity issues
Robert Chiras [Thu, 20 Dec 2018 11:48:42 +0000 (13:48 +0200)]
MLK-20371: video: fbdev: adv7535: Fix coverity issues

Fix structurally dead code reported by coverity. Assign the return value
to ret, instead of returning it so there will be a proper clean up.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 0d0ca80d965144e38e9f860fbaab76547573c0b6)

6 years agoMLK-20295: fbdev/mxsfb: Fix coverity issues
Robert Chiras [Wed, 19 Dec 2018 11:11:32 +0000 (13:11 +0200)]
MLK-20295: fbdev/mxsfb: Fix coverity issues

Fixing two coverity issues:
1. Checking disp_videomode against 0, which will always be true, since
disp_videomode is a char array. So, fix it by checking it's first byte
instead.
2. Possible division by zero, if clk_get_rate returns 0 (which is
possible).

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit d2672125a376020dfc9aa87339be290d45b0d252)

6 years agoMLK-20201 clk: imx: Fix coverity issue of CID 17326/17327
Anson Huang [Wed, 19 Dec 2018 06:22:09 +0000 (14:22 +0800)]
MLK-20201 clk: imx: Fix coverity issue of CID 17326/17327

This patch fixes below coverity issues:

CID 17326/17327: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression div *
parent_rate with type unsigned long (32 bits, unsigned) is evaluated
using 32-bit arithmetic, and then used in a context that expects an
expression of type u64 (64 bits, unsigned).

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 4bb630c8543c9346a0c21b4e42ad3949e7c6185d)

6 years agoMLK-20598 dmaengine: imx-sdma: fix potential system hang
Robin Gong [Mon, 17 Dec 2018 14:34:13 +0000 (22:34 +0800)]
MLK-20598 dmaengine: imx-sdma: fix potential system hang

In multi audio play/stop case,sdma_alloc_chan_resources/
sdma_free_chan_resources will be called quickly, especially,dma done
interrupt comes after sdma_free_chan_resources, thus, system will be
hang in interrupt since it'll check sdma register but clocks have
already been disabled in sdma_free_chan_resources. To avoid it, enable
clock in isr.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 09b55a84522fbf404d6cd82b4640a93672c2aa27)

6 years agoMA-13763 [#imx-1237] Fix fence signal memory leakage issue.
Ivan.liu [Thu, 13 Dec 2018 03:15:21 +0000 (11:15 +0800)]
MA-13763 [#imx-1237] Fix fence signal memory leakage issue.

The signal id is missed when set to fence.
Then signal structure will not be freed at last.
Set correct signal id to fence to fix this issue.

Change-Id: I6a67dac0f6979183796cb8e9f2ac7aef6623ac00
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 2ce8ab2b7de5c6eb2f20421909839a747ed85d06)

6 years agoMLK-18076-2: ASoC: fsl_asrc: support S8 format for p2p
Shengjiu Wang [Fri, 14 Dec 2018 03:12:19 +0000 (11:12 +0800)]
MLK-18076-2: ASoC: fsl_asrc: support S8 format for p2p

support S8 format for p2p

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 52ec854864d4841d8f6798cfdf9cce8cf7ad4758)

6 years agoMLK-18076-1: ASoC: fsl_asrc_m2m: support input width with 8bit
Shengjiu Wang [Fri, 14 Dec 2018 03:10:42 +0000 (11:10 +0800)]
MLK-18076-1: ASoC: fsl_asrc_m2m: support input width with 8bit

support input data width with 8bit for m2m

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 532bb31b14c304afd65c300da5d2fcc4cf13549f)

6 years agoMLK-20541 cfg80211: fix phy index confliction with loadable test for multiple phys
Andy Duan [Fri, 7 Dec 2018 07:15:42 +0000 (15:15 +0800)]
MLK-20541 cfg80211: fix phy index confliction with loadable test for multiple phys

The commit ae97fd867aa3 ("MLK-19091 cfg80211: make phy index match
after wiphy dev is released") manage wiphy_counter matching between
creating and freeing wiphy device. Then for one wifi instance, the index
of attached phy is not changed during loadable test. But it ignores
multiple wifi cards loadable test case, that introduces the phy index
confliction. So the patch revert the commit.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 4bfe854b650f1e8bc46624d5f3b559f0112f327a)

6 years agoMLK-20204: drivers: crypto: dcp: Check we have input data for AES
Franck LENORMAND [Tue, 27 Nov 2018 13:18:13 +0000 (14:18 +0100)]
MLK-20204: drivers: crypto: dcp: Check we have input data for AES

If the input scatter gather table is wrongly built (no entries), the
code will try to copy memory which is not allowed.

Coverity Explanation:
drivers/crypto/mxs-dcp.c:388: CID 5233058 (#1 of 1):
  Type: Out-of-bounds access (OVERRUN)
  Classification: Unclassified
  Severity: Unspecified
  Action: Modeling Required
  Owner: nxa21133
  First detected on 2018-10-16.
drivers/crypto/mxs-dcp.c:297:
  1. alias: Assigning: "out_buf" = "sdcp->coh->aes_out_buf". "out_buf"
  now points to byte 0 of "sdcp->coh->aes_out_buf" (which consists of
  4096 bytes).
drivers/crypto/mxs-dcp.c:301:
  2. assignment: Assigning: "last_out_len" = "0U".
drivers/crypto/mxs-dcp.c:316:
  3. path: Condition "!rctx->ecb", taking true branch.
drivers/crypto/mxs-dcp.c:321:
  4. path: Falling through to end of if statement.
drivers/crypto/mxs-dcp.c:325:
  5. path: Condition "i < nents", taking false branch.
drivers/crypto/mxs-dcp.c:386:
  6. path: Condition "!rctx->ecb", taking true branch.
drivers/crypto/mxs-dcp.c:387:
  7. path: Condition "rctx->enc", taking true branch.
drivers/crypto/mxs-dcp.c:388:
  8. overrun-buffer-arg: Overrunning buffer pointed to by "out_buf +
  (last_out_len - 16U)" of 4096 bytes by passing it to a function which
  accesses it at byte offset 4294967295 using argument "16U".

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 26560456d04ec6fc147600ab5a92d06144c1da88)

6 years agoMLK-20425-2 ARM: dts: imx7ulp-evkb: add GOODIX 911 touch support
Haibo Chen [Wed, 21 Nov 2018 06:20:05 +0000 (14:20 +0800)]
MLK-20425-2 ARM: dts: imx7ulp-evkb: add GOODIX 911 touch support

Both the new MIPI panel (RK055IQH042 panel and RK055AHD042 panel)
use GOODIX 911 touch chip, so this patch add GOODIX 911 touch
support for imx7ulp-evkb board.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 06145aa96bc2b28fa109f3e64fd0c9475082f32e)

6 years agoMLK-20235 mmc: sdhci-of-esdhc: fix coverity uncheck return value issue.
Haibo Chen [Mon, 19 Nov 2018 08:31:49 +0000 (16:31 +0800)]
MLK-20235 mmc: sdhci-of-esdhc: fix coverity uncheck return value issue.

CID 4058489: Unchecked return value (CHECKED_RETURN)
2. check_return: Calling dma_set_mask_and_coherent without checking
return value.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 9df9165707c34b8c4efe0e89f97e93cca7a222a0)

6 years agoMLK-20388-2: mtd: fsl-quadspi: use ioremap_wc to handle qspi unaligned access
Han Xu [Thu, 15 Nov 2018 21:12:13 +0000 (15:12 -0600)]
MLK-20388-2: mtd: fsl-quadspi: use ioremap_wc to handle qspi unaligned access

Use ioremap_wc to handle unaligned qspi AHB read. Remove the previous
SW alignment handle for neat code.

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 07c7e72b0ed05beaf2c07d8e098e18c1e48ec634)

6 years agoMLK-20388-1: mtd: fsl-flexspi: use ioremap_wc to handle fspi unaligned access
Han Xu [Thu, 15 Nov 2018 21:09:00 +0000 (15:09 -0600)]
MLK-20388-1: mtd: fsl-flexspi: use ioremap_wc to handle fspi unaligned access

Use ioremap_wc to handle unaligned flexspi AHB read. Remove the previous
SW alignment handle for neat code.

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit c180c525fd7b834ea0e07be4ca79fb8986a214cf)

6 years agoRevert "PCI: imx6: Fix link training status detection in link up check"
Arulpandiyan Vadivel [Wed, 24 Apr 2019 13:39:51 +0000 (19:09 +0530)]
Revert "PCI: imx6: Fix link training status detection in link up check"

This reverts commit 2a031cab71cd9909fa659c96b6221d1fe33ad87f.

Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 91d66f481121b2eab56f5d829a0002f6bb47953e)

6 years agoMLK-21589 VPU Decoder: implement insert decode header of
Shijie Qin [Sun, 28 Apr 2019 10:44:59 +0000 (18:44 +0800)]
MLK-21589 VPU Decoder: implement insert decode header of
    RV format for Amphion decoder

    Insert sequence header, frame header and slice header for
    input buffer of RV format.
    Include rv8, rv9 and rv10, the header of rv9 and rv10 are
    the same.
    Extract an independent punction for copy buffer to ring
    stream buffer.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
6 years agoMLK-19341 brcmfmac: bcmsdh: add shutdown handler to avoid kernel panic on reboot
Fugang Duan [Tue, 30 Apr 2019 05:56:16 +0000 (13:56 +0800)]
MLK-19341 brcmfmac: bcmsdh: add shutdown handler to avoid kernel panic on reboot

When running wlan interface up/down stress test in background then run
reboot command, there have kernel panic as below message.
This issue is fixed by doing cleanup in shutdown handler.

Unable to handle kernel paging request at virtual address 7f0e9040
pgd = 86c20000
[7f0e9040] *pgd=86ecd811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1] PREEMPT SMP ARM
task: 8603c000 task.stack: 86040000
PC is at device_shutdown+0x198/0x204
LR is at _raw_spin_unlock_irq+0x28/0x54
pc : [<804ee520>]    lr : [<809a70dc>]    psr: 20030013
sp : 86041e60  ip : 00000000  fp : 80c5b7e4
r10: 80cb0b24  r9 : 80f7e020  r8 : 86b0b844
r7 : 80fdce84  r6 : 86b0b810  r5 : 80f34ef0  r4 : 86b0b81c
r3 : 7f0e9018  r2 : ffffffff  r1 : 00000002  r0 : 00000000
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 86c2006a  DAC: 00000051
Process systemd-shutdow (pid: 1, stack limit = 0x86040210)
Stack: (0x86041e60 to 0x86042000)
1e60: 00000000 00000000 80f0f704 aef99500 fee1dead 80107c44 86040000 00000000
1e80: 7eee5fd4 8014bb74 00000000 8014bdcc 00000000 00000000 00000000 8020464c
1ea0: 87336540 00000000 00000000 00000000 861b24e0 87336548 00000024 00000002
1ec0: 00000000 00000005 0000001e 80205c34 00000000 00000000 1c4a66cc 87336540
1ee0: 00000000 86041f08 86041f80 00000000 00000000 80205d5c 86041f04 86041f08
1f00: 00000000 00000000 00000001 00000000 00000024 86041f20 00000005 7eee521c
1f20: 7eee5350 00000004 7eee5f1c 00000010 7eee5364 00000005 7eee53f4 0000000a
1f40: 76ece6fc 00000001 86005b00 00000005 fffffffe fffffffe 86d1a000 fffff000
1f60: 80107c44 87336540 87336540 00000000 7eee5318 80205df0 00000000 00000004
1f80: 00000000 00000000 00000000 7eee53f4 7eee5318 00000000 00000000 00000000
1fa0: 00000058 80107a60 00000000 00000000 fee1dead 28121969 01234567 aef99500
1fc0: 00000000 00000000 00000000 00000058 00000000 ffffffff 00000000 7eee5fd4
1fe0: 004a0e18 7eee5c44 0048afa4 76d0b5e0 60030010 fee1dead 00000000 00000000
[<804ee520>] (device_shutdown) from [<8014bb74>] (kernel_restart+0xc/0x50)
[<8014bb74>] (kernel_restart) from [<8014bdcc>] (SyS_reboot+0xc8/0x1ac)
[<8014bdcc>] (SyS_reboot) from [<80107a60>] (ret_fast_syscall+0x0/0x54)
Code: eaffffb5 e5943040 e3530000 0afffff3 (e5933028)
---[ end trace cb8c3d96d6f26a91 ]---

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21611 brcmfmac: change message level for reading optional iovar data
Fugang Duan [Tue, 30 Apr 2019 02:15:36 +0000 (10:15 +0800)]
MLK-21611 brcmfmac: change message level for reading optional iovar data

Not all firmware set channel/ulp_sdioctrl, so change the error message
to debug level for reading chanspec/ulp_sdioctrl iovar data.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21071 brcmfmac: add PCIe shutdown handler to avoid system warning on reboot
Fugang Duan [Tue, 30 Apr 2019 01:41:07 +0000 (09:41 +0800)]
MLK-21071 brcmfmac: add PCIe shutdown handler to avoid system warning on reboot

If reboot command is issued when PCIe WLAN device is in connected
state, system kernel dump while booting as below log. This issue
is fixed by doing cleanup and disable PCIe interrupt in shutdown handler.

[    6.405135] irq 304: nobody cared (try booting with the "irqpoll" option)
[    6.425581] Call trace:
[    6.428034] [<ffff000008089c48>] dump_backtrace+0x0/0x3c8
[    6.433433] [<ffff00000808a024>] show_stack+0x14/0x20
[    6.438485] [<ffff000008d8bec0>] dump_stack+0x9c/0xbc
[    6.443538] [<ffff00000811e7e4>] __report_bad_irq+0x34/0xf0
[    6.449110] [<ffff00000811ec84>] note_interrupt+0x2ec/0x338
[    6.454682] [<ffff00000811bc2c>] handle_irq_event_percpu+0x44/0x58
[    6.460861] [<ffff00000811bc88>] handle_irq_event+0x48/0x78
[    6.466433] [<ffff00000811fa88>] handle_fasteoi_irq+0xa8/0x180
[    6.472265] [<ffff00000811ac1c>] generic_handle_irq+0x24/0x38
[    6.478009] [<ffff00000811b29c>] __handle_domain_irq+0x5c/0xb8
[    6.483841] [<ffff000008081960>] gic_handle_irq+0x78/0x174
[    6.489325] Exception stack(0xffff0000094f3d80 to 0xffff0000094f3ec0)
[    6.495765] 3d80: 0000000000000000 ffff000009502580 0000000000000709 ffff000008ac5b28
[    6.503593] 3da0: 0000000002222221 00ffffffffffffff 0000000008cd6205 00000000000000c0
[    6.511421] 3dc0: 00000032b5503510 ffff000008082000 0000000000001000 0000000000000000
[    6.519249] 3de0: 0000000034d5d91d 00008000b4a78000 ffff000009502580 0000000000000000
[    6.527077] 3e00: 0000000000000000 0000000000000000 0000000000000000 000000016cb15db1
[    6.534905] 3e20: 0000000000000001 ffff8000b900ce00 ffff8000b925e000 0000000000000001
[    6.542733] 3e40: 000000016c9c1569 ffff8000b925e000 ffff000009502580 0000000000000400
[    6.550561] 3e60: 00000000417b0018 ffff0000094f3ec0 ffff000008a308a8 ffff0000094f3ec0
[    6.558389] 3e80: ffff000008a307f4 0000000040000045 ffff8000b925e060 0000000000000001
[    6.566217] 3ea0: ffffffffffffffff ffff8000b925e000 ffff0000094f3ec0 ffff000008a307f4
[    6.574045] [<ffff000008083230>] el1_irq+0xb0/0x124
[    6.578925] [<ffff000008a307f4>] cpuidle_enter_state+0x134/0x228
[    6.584930] [<ffff000008a30920>] cpuidle_enter+0x18/0x20
[    6.590242] [<ffff00000810c75c>] call_cpuidle+0x1c/0x40
[    6.595465] [<ffff00000810c9ac>] do_idle+0x1a4/0x1e0
[    6.600428] [<ffff00000810cb84>] cpu_startup_entry+0x24/0x28
[    6.606088] [<ffff000008d9e798>] rest_init+0xd0/0xe0
[    6.611056] [<ffff0000093b0b70>] start_kernel+0x398/0x3ac

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21597 can: flexcan: fix deadlock when can't call flexcan_noirq_resume()
Joakim Zhang [Mon, 29 Apr 2019 05:11:36 +0000 (13:11 +0800)]
MLK-21597 can: flexcan: fix deadlock when can't call flexcan_noirq_resume()

There is a limitation about wakeup event mechanisim in driver:

Other devices may suspend failed after system calling flexcan_suspend()
and before calling flexcan_noirq_suspend(), the result is that
flexcan_noirq_resume() will not be called. This will leave flexcan in
stop mode, and with the current driver it can't recover from this even
with a soft reboot, it requires a hard reboot.

This patch is intends to fix the scenario.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21511 can: flexcan: clear fd related bit when "fd off"
Joakim Zhang [Sat, 20 Apr 2019 09:26:32 +0000 (17:26 +0800)]
MLK-21511 can: flexcan: clear fd related bit when "fd off"

Fd mode related bit in register will keep asserted when setting "fd off"
in userspace after once setting "fd on" before. Clear fd related bit
when "fd off" is more reasonble. Also clean the cbt and fdcbt register
bit before setting.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21510 can: flexcan: allocate skb in mailbox_read
Joakim Zhang [Sat, 20 Apr 2019 07:56:00 +0000 (15:56 +0800)]
MLK-21510 can: flexcan: allocate skb in mailbox_read

We allocate skb according to "fd on" or "fd off" before, this may not
reasonable. Such as, transfer normal frame when fd mode is on. Allcoating
skb based on "EDL" bit from mailbox ctrl field is more reasonable.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21600-2: ASoC: fsl_ssi: fix no sound issue with mono
Shengjiu Wang [Mon, 29 Apr 2019 06:29:08 +0000 (14:29 +0800)]
MLK-21600-2: ASoC: fsl_ssi: fix no sound issue with mono

Revert "MLK-14447: ASoC: fsl_ssi: Fix Capture and Playback with i2s mode"

This reverts commit 2076769ecbf8f30db7f69915eaed9498232f4ef0.

This patch is not needed and it removed setting of SSI_STCR_TXBIT0
that cause no sound issue with mono, so revert it.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-21600-1: ASoC: fsl_ssi: Revert fixed compilation errors
Shengjiu Wang [Mon, 29 Apr 2019 06:28:36 +0000 (14:28 +0800)]
MLK-21600-1: ASoC: fsl_ssi: Revert fixed compilation errors

Revert "ASoC-fsl_ssi: fixed compilation errors"

This reverts commit 918a3a34707202cdf2c36286dfe2546ebbc29aa0.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-21604 rpmsg: imx: fix the multi-core pingpong mess issue
Richard Zhu [Mon, 29 Apr 2019 07:48:24 +0000 (15:48 +0800)]
MLK-21604 rpmsg: imx: fix the multi-core pingpong mess issue

Do not use one global variable.
Pingpong maybe excuted on multiple rpmsg channels.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21509-4 drm/imx: dpu: crc: Add user-configurable CRC region(ROI) support
Liu Ying [Sat, 13 Apr 2019 07:59:39 +0000 (15:59 +0800)]
MLK-21509-4 drm/imx: dpu: crc: Add user-configurable CRC region(ROI) support

This patch adds user-configurable CRC region support.
The users may choose a region of interest(ROI) as the CRC source
(i.e., the CRC evaluation window) via the debugfs control node.
The ROI cannot exceed the display region as indicated by
drm_crtc_state->adjusted_mode.  The users may write a string in
the fashion of "roi:x1,y1,x2,y2" to the node to specify the ROI
within the display region.  The inclusive position at (x1, y1)
indicates the upper left of the region, while the exclusive
position at (x2, y2) indicates the lower right of the region.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21509-3 drm/imx: dpu: kms: Add auto control mode debugfs CRC support
Liu Ying [Thu, 11 Apr 2019 11:45:11 +0000 (19:45 +0800)]
MLK-21509-3 drm/imx: dpu: kms: Add auto control mode debugfs CRC support

This patch adds auto control mode debugfs CRC support based on
DPU Signature units.  The evaluation window is the same to the
display region as indicated by drm_crtc_state->adjusted_mode.
The CRC data count is three when single DPU display stream is used,
while six when the pixel combiner(dual DPU display streams) is used.
Each data shows the CRC value for the 8 most significant bits of
red/green/blue channel of the entire evaluation window, which reflects
how DPU Signature unit reports CRC values.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21509-2 gpu: imx: dpu: disengcfg: Add signature select support
Liu Ying [Fri, 12 Apr 2019 07:31:28 +0000 (15:31 +0800)]
MLK-21509-2 gpu: imx: dpu: disengcfg: Add signature select support

This patch adds helper disengcfg_sig_select() support so that
users may select different taps(FrameGen, GammaCor, Matrix or
Dither) to do signature computation.  Also, select FrameGen as
the default tap in _dpu_dec_init() and call it in dpu_dec_init().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21509-1 gpu: imx: dpu: common: Add signature unit support
Liu Ying [Mon, 8 Apr 2019 08:11:53 +0000 (16:11 +0800)]
MLK-21509-1 gpu: imx: dpu: common: Add signature unit support

This patch adds signature unit support in the dpu common driver.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21599 ARM64: Kconfig:FORCE_MAX_ZONEORDER default 14 if imx8
Jason Liu [Mon, 29 Apr 2019 06:05:44 +0000 (14:05 +0800)]
MLK-21599 ARM64: Kconfig:FORCE_MAX_ZONEORDER default 14 if imx8

This patch change MAX_ZONEORDER default to 14 on i.MX8 platforms
due to GPU/DISPLAY large continuous physical memory requires it

This also aligned with previous imx releases on imx6/7/8

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
6 years agoMLK-15041: PXP-V3: enable stroe engine block mode and fill function
Guoniu.Zhou [Mon, 5 Jun 2017 02:05:20 +0000 (10:05 +0800)]
MLK-15041: PXP-V3: enable stroe engine block mode and fill function

1. When pxp do rotation, fetch and store engine need block mode.
2. When use pxp store engine fill function, not only need config
store engine, but also need config fetch engine, otherwise, it
will not work.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 9424d5834a7a3466ad574896a187ab1b82c9c35f)

6 years agoMLK-21583 ARM: dts: imx7d-sdb: remove the property "wakeup-source"
Fugang Duan [Fri, 26 Apr 2019 09:30:58 +0000 (17:30 +0800)]
MLK-21583 ARM: dts: imx7d-sdb: remove the property "wakeup-source"

Current brcmfmac driver use oob-irq as wakeup source,
if oob-irq is enabled in dts file, then driver enable
the wowlan feature as system wakeup source.
Currently, sdio in-band wakeup feature is not supported,
so remove the property "wakeup-source".

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21582 ARM: dts: imx6: enable Murata 1MW M.2 card for imx6 legacy platforms
Fugang Duan [Thu, 28 Feb 2019 07:58:28 +0000 (15:58 +0800)]
MLK-21582 ARM: dts: imx6: enable Murata 1MW M.2 card for imx6 legacy platforms

Enable Murata 1MW M.2 card for i.MX6 legacy platforms. Plug in
Murata 1MW M.2 into SD slot by using Murata uSD-to-M.2 Adapter.

Below i.MX6 legacy platforms will be supported:
- i.MX6Q/QP/DL SDB, SD2 slot
- i.MX6SX SDB, SD2 slot
- i.MX6SLL EVK, SD3 slot
- i.MX6UL/ULL/ULZ EVK, SD1 slot

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21580 brcmfmac: add BRCMF_FEAT_WOWL check when set wowlan parameters
Fugang Duan [Thu, 25 Apr 2019 05:42:37 +0000 (13:42 +0800)]
MLK-21580 brcmfmac: add BRCMF_FEAT_WOWL check when set wowlan parameters

Only set wowlan parameters when the interface's BRCMF_FEAT_WOWL
flag is set.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21579 brcmfmac: bcmsdh: move the func->num check early in .brcmf_ops_sdio_suspend()
Fugang Duan [Wed, 24 Apr 2019 08:22:03 +0000 (16:22 +0800)]
MLK-21579 brcmfmac: bcmsdh: move the func->num check early in .brcmf_ops_sdio_suspend()

Move the func->num check early in .brcmf_ops_sdio_suspend() to
save suspend time.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21590 epdc: fix potential out of array boundary access
Robby Cai [Sun, 28 Apr 2019 08:28:47 +0000 (16:28 +0800)]
MLK-21590 epdc: fix potential out of array boundary access

The function mxc_epdc_fb_init_hw() could be called more than once when load
the firmware due to some reason. If this case happens, then for following codes,
the array fb_data->fw_str pointed to will be accessed out of bound. It probably
causes kernel crash, or makes fb_data->fw_str get a wrong value, then the driver
may be stuck during the process of loading the firmware.

        if (fb_data->cur_mode) {
                strcat(fb_data->fw_str, "imx/epdc/epdc_");
                strcat(fb_data->fw_str, fb_data->cur_mode->vmode->name);
                strcat(fb_data->fw_str, ".fw");
        }

This patch fixed that by using strcpy instread.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20223 video: epdc: Increase the time available for LUT cleanup
Bogdan Chircu [Tue, 27 Nov 2018 21:13:19 +0000 (13:13 -0800)]
MLK-20223 video: epdc: Increase the time available for LUT cleanup

The problem is that the kthread from submit workqueue aquires the queue_mutex
and blocks the kthread from interrupt workqueue. But the kthread from interrupt
workqueue is the one that should update the used_luts variable (on which the
kthread from submit workqueue keeps polling), but it doesn't have a chance to
do it (because it is blocked by mutex), even if the LUT complete interrupts are
triggered. So the fix is, after the polling to release the mutex so that the
kthread from interrupt workqueue can process the LUT complete interrupts and
update the used_luts variable accordingly.

Signed-off-by: Bogdan Chircu <bogdan-petru.chircu-mare@nxp.com>
Signed-off-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit bcaea8983ca3864bc5df5dc90b49ffe2d0fadf29)

6 years agoMLK-20231-2 video: epdc: restore QoS setting after resume
Robby Cai [Wed, 26 Dec 2018 13:55:46 +0000 (21:55 +0800)]
MLK-20231-2 video: epdc: restore QoS setting after resume

After suspend, the qos setting is lost. This patch restores it after resume.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 92a7e53664802a729b647516d9e578fa5897aa63)

6 years agoMLK-20231-1 ARM: dts: imx7d-sdb: add qos node
Robby Cai [Wed, 26 Dec 2018 13:53:34 +0000 (21:53 +0800)]
MLK-20231-1 ARM: dts: imx7d-sdb: add qos node

Add QoS node, which is needed to be set for EPDC.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit fa685e574276be9765e730f522ea99887133cc42)

6 years agoMLK-21574: VPU: implement crop through SELECTION api
ming_qian [Fri, 26 Apr 2019 08:54:38 +0000 (16:54 +0800)]
MLK-21574: VPU: implement crop through SELECTION api

implement g_selection and s_selection
g_crop will call g_selection and
s_crop will call s_selection

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21585 Revert patch to re-add support for capturemode in s_parm
Robby Cai [Fri, 26 Apr 2019 09:03:33 +0000 (17:03 +0800)]
MLK-21585 Revert patch to re-add support for capturemode in s_parm

This reverts commit 8a7c5594c02022ca5fa7fb603e11b3e1feb76ed5.

capturemode is needed for legacy support, added it back.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoTEE-349 RPC Busfreq High
Cedric Neveux [Mon, 17 Dec 2018 10:33:10 +0000 (11:33 +0100)]
TEE-349 RPC Busfreq High

   Call request/release busfreq HIGH each time a SMC
   is called.
   This ensure that OPTEE is running in HIGH frequency mode
   until no more SMC running

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 41604a3382306b78f1038524a1018647f3cf3f52)

6 years agoRevert "tee: add kernel internal client interface **not for mainline**"
Silvano di Ninno [Fri, 26 Apr 2019 07:21:06 +0000 (09:21 +0200)]
Revert "tee: add kernel internal client interface **not for mainline**"

This reverts commit 7da862fdfe2cff02361098e2dbabc93c4e92b8a1.

6 years agoRevert "tee: new ioctl to a register tee_shm from a dmabuf file descriptor"
Silvano di Ninno [Fri, 26 Apr 2019 07:20:52 +0000 (09:20 +0200)]
Revert "tee: new ioctl to a register tee_shm from a dmabuf file descriptor"

This reverts commit cf2ea7c7b563842ce6dfa3fc8c8fafdbdc5ef7c8.

6 years agoMLK-21553 drm/bridge: it6263: Do hotplug detect quickly in unforced case
Liu Ying [Thu, 25 Apr 2019 07:18:03 +0000 (15:18 +0800)]
MLK-21553 drm/bridge: it6263: Do hotplug detect quickly in unforced case

We should avoid expensive, destructive operations during automated hotplug
probing, otherwise, it could cause flickering on other running displays.
So, let's check the parameter 'force' of ->detect() and do the appropriate
detection accordingly.

Reported-by: Luo Danwei <danwei.luo@nxp.com>
Tested-by: Luo Danwei <danwei.luo@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21484-4: ASoC: fsl_sai: ensure clk not in use prior set_mclk_rate
Viorel Suman [Thu, 25 Apr 2019 12:03:56 +0000 (15:03 +0300)]
MLK-21484-4: ASoC: fsl_sai: ensure clk not in use prior set_mclk_rate

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
set_parent and set_rate. See commit 9461f7b33d11 ("clk: fix
CLK_SET_RATE_GATE with clock rate protection"). The current fsl_sai
implementation ensures the clock is not in use prior set_parent,
extend this for set_rate also by moving if (sai->mclk_streams == 0)
outside fsl_sai_set_mclk_rate(). Aside of this avoid changing rate and
parent for BUS clk.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoRevert "MLK-21484-3: ASoC: fsl_sai: ensure clk is unprepared before reparent"
Viorel Suman [Wed, 24 Apr 2019 11:03:02 +0000 (14:03 +0300)]
Revert "MLK-21484-3: ASoC: fsl_sai: ensure clk is unprepared before reparent"

SAI interface is able to hande both TX and RX simultaneously.
In case a rate change is required by a RX stream started while TX
is running - stopping and starting root clock will introduce a pop noise.

This reverts commit e146b5f34492cd046187b92eb4ae37f238557eb9.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-20898: mxc-jpeg: Jpeg encoder stuck after a number of frames
Mirela Rabulea [Tue, 23 Apr 2019 16:29:48 +0000 (19:29 +0300)]
MLK-20898: mxc-jpeg: Jpeg encoder stuck after a number of frames

Split mxc_jpeg_go_enc in two: mxc_jpeg_enc_mode_conf and
mxc_jpeg_enc_mode_go. This allows to separate the setting of
CONFIG & GO bits in the CAST IP MODE register, thus it's more
clear when the encoder will enter config state, and when
it will enter encode state. The mxc_jpeg_enc_mode_conf is
called at the beginning of the frame processing, while
mxc_jpeg_enc_mode_go is called after configuration phase
is finished for the respective frame (FRMDONE interrupt
received for it). All of this, to avoid unexpected CAST IP
internal state machine evolution for multiple frames, when
both CONFIG & GO are set, even if their corresponding
auto-clear bits are set.

Rename mxc_jpeg_go_dec to mxc_jpeg_dec_mode_go for consistency.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-21552-2: VPU Decoder: fix timestamp way be incorrect after abort
ming_qian [Thu, 25 Apr 2019 07:51:10 +0000 (15:51 +0800)]
MLK-21552-2: VPU Decoder: fix timestamp way be incorrect after abort

set tsm_sync_flag to true when start decode

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21552: VPU Decoder: fix timestamp way be incorrect after abort
ming_qian [Thu, 25 Apr 2019 07:10:39 +0000 (15:10 +0800)]
MLK-21552: VPU Decoder: fix timestamp way be incorrect after abort

when abort done is received,
the tsm_sync_flag should be set to true.
but the receive ts may be in another thread.
If there is no any lock to pretect,
some input timestamp may be received before do resync.
and after do resync, the timestamp may be incorrect.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years ago[i.MX845/VPU]:MLK-21235-2: multi instance encode process fail to resume encoding...
Zhou Peng [Thu, 25 Apr 2019 03:45:02 +0000 (11:45 +0800)]
[i.MX845/VPU]:MLK-21235-2: multi instance encode process fail to resume encoding during suspend..

Modify 32bits ioctl function
Check return value for both WaitEncReady() and EncRefreshRegs()

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 7cdc939c6d6df8b24dd3727de680c633562a213c)

6 years agoMLK-21523-2: VPU Decoder: add timestamp threshold
ming_qian [Thu, 25 Apr 2019 02:17:01 +0000 (10:17 +0800)]
MLK-21523-2: VPU Decoder: add timestamp threshold

the timestamp of output stream may be not monotone increasing
there are may be reoder.
driver should use the max timestamp that received
to calculate the timestamp delta.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21514: mtd: spi-nor: add prep/unprep for spi_nor_resume()
Han Xu [Wed, 24 Apr 2019 20:30:14 +0000 (15:30 -0500)]
MLK-21514: mtd: spi-nor: add prep/unprep for spi_nor_resume()

prep/unprep functions were not added in new spi_nor_resume function.

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-21543 media: mxc v4l2 capture: Fix v4l2_buffer offset = 0 via QUERYBUF
Robby Cai [Wed, 24 Apr 2019 07:09:53 +0000 (15:09 +0800)]
MLK-21543 media: mxc v4l2 capture: Fix v4l2_buffer offset = 0 via QUERYBUF

The commit 04f4e9e44fd4d2f2379e46e48f26101acb88dfdc fixed compilation warning
for memset, which just reveals the bug: in VIDIOC_QUERYBUF code section,
it judges buf->memory against V4L2_MEMORY_MMAP twice, but buf->memory is just
reset to 0 by memset after first judgement thus the second one comes wrong.
Consequently, it will provide an offset of 0 to usespace, obviously it's wrong.

This patch fixed it.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-21087-7:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Wed, 24 Apr 2019 07:38:17 +0000 (15:38 +0800)]
MLK-21087-7:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

when flag V4L2_NXP_BUF_FLAG_TIMESTAMP_INVALID is set,
don't skip the timestamp,
it may cause the consumed length incorrect
send TSM_TIMESTAMP_NONE to tsm in this case

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21523: VPU Decoder: add timestamp threshold
ming_qian [Wed, 24 Apr 2019 05:51:39 +0000 (13:51 +0800)]
MLK-21523: VPU Decoder: add timestamp threshold

add timestamp threshold
add bitstream low threshold
add bitstream high threshold
use the timestamp threshold or bitstream high threshold
to control the speed of input.
To avoid hang, you can set bitstream low threshold to a proper value.
When fifo low event is received, driver will copy data to stream buffer.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21525 drm/imx: dpu: kms: Disallow primary plane on-the-fly disablement
Liu Ying [Tue, 23 Apr 2019 11:25:24 +0000 (19:25 +0800)]
MLK-21525 drm/imx: dpu: kms: Disallow primary plane on-the-fly disablement

The below commit introduced in v4.16 reveals the fact that the DPU KMS
driver doesn't support primary plane on-the-fly disablement.  This may
cause display issue when we restart weston with 4kp60 display for i.MX8QM.
To support this, we need considerable driver change, but doesn't make
too much sense, because disabling primary plane on an active CRTC doesn't
often happen for real graphics update.  In order not to run into this problem,
we can explicitly disallow this use case in ->atomic_check().  This rejection
makes us fall back to disable CRTC when removing the primary plane's
framebuffer according to the below commit's rationale, which is the original
behavior of atomic_remove_fb().

commit 846c7dfc1193 ("drm/atomic: Try to preserve the crtc enabled state in drm_atomic_remove_fb, v2.")

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21524: VPU Decoder: tsm ignore invalid timestamp in some case
ming_qian [Tue, 23 Apr 2019 09:24:36 +0000 (17:24 +0800)]
MLK-21524: VPU Decoder: tsm ignore invalid timestamp in some case

If one frame is split into several buffers.
The timestamp of the first buffer is valid, others are invalid.
TSManagerGetLastTimeStamp() will try to get the last timestamp of frame.
it may get a invalid timestamp. and this will output some wrong timestamp.
so ignore these invalid timestamp

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21522: VPU Decoder: fix the api of tsm is not thread safe
ming_qian [Tue, 23 Apr 2019 07:42:07 +0000 (15:42 +0800)]
MLK-21522: VPU Decoder: fix the api of tsm is not thread safe

the api of tsm is not thread safe.
but in driver context, it's multithread.
add a lock to protect the api

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years ago[i.MX845/VPU]:MLK-21235: multi instance encode process fail to resume encoding during...
Zhou Peng [Tue, 23 Apr 2019 05:32:35 +0000 (13:32 +0800)]
[i.MX845/VPU]:MLK-21235: multi instance encode process fail to resume encoding during suspend resume test.100%

Add mirror registers to store HW registers before power off
Replace 'wait_event_interruptible' with 'wait_event_timeout' to avoid interrupted

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 789a419a5d4c0fed3eb0cbe83999bf8a65a980b4)

6 years agoMLK-21521 VPU Decoder: add new v4l2_s_contrl for contrl decode frame disable reorder
Shijie Qin [Tue, 23 Apr 2019 07:21:14 +0000 (15:21 +0800)]
MLK-21521 VPU Decoder: add new v4l2_s_contrl for contrl decode frame disable reorder

    #define V4L2_CID_USER_FRAME_DIS_REORDER (V4L2_CID_USER_BASE + 0x1300)

    cfg.ops = &vpu_custom_ctrl_ops;
    cfg.id = V4L2_CID_USER_FRAME_DIS_REORDER;
    cfg.name = "frame disable reoder ctrl";
    cfg.min = 0;
    cfg.max = 1;
    cfg.step = 1;
    cfg.def = 0;
    cfg.type = V4L2_CTRL_TYPE_BOOLEAN;

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
6 years agoMLK-21520-3 spi: lpspi: remove fsl_lpspi->chipselect
Clark Wang [Tue, 23 Apr 2019 07:43:29 +0000 (15:43 +0800)]
MLK-21520-3 spi: lpspi: remove fsl_lpspi->chipselect

Replace fsl_lpspi->chipselect by controller->cs_gpios. Clean up the
code.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21520-2 spi: lpspi: add multi SS support in PIO mode
Clark Wang [Tue, 23 Apr 2019 07:16:35 +0000 (15:16 +0800)]
MLK-21520-2 spi: lpspi: add multi SS support in PIO mode

Add "fsl,spi-num-chipselects" check to support multi SS function in PIO
mode.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21520-1 spi: lpspi: add NULL check when probe device
Clark Wang [Tue, 23 Apr 2019 07:11:58 +0000 (15:11 +0800)]
MLK-21520-1 spi: lpspi: add NULL check when probe device

Add a NULL check for device node and lpspi_platform_info when lpspi
device probe.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21503 rpmsg: imx: refine imx rpmsg codes
Richard Zhu [Fri, 19 Apr 2019 09:01:50 +0000 (17:01 +0800)]
MLK-21503 rpmsg: imx: refine imx rpmsg codes

No functions changes.
- Use the dynamic allocation, and remove the pre-defined static
  structure.
- Remove the vdev layer notify block codes.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
6 years agoMLK-21247 rpmsg: imx: do not check the remote ready flag in suspend mode
Richard Zhu [Mon, 25 Mar 2019 09:22:00 +0000 (17:22 +0800)]
MLK-21247 rpmsg: imx: do not check the remote ready flag in suspend mode

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)

6 years agoMLK-21244 rpmsg: imx: move pm ops to noirq phrase
Anson Huang [Sat, 23 Mar 2019 03:56:47 +0000 (11:56 +0800)]
MLK-21244 rpmsg: imx: move pm ops to noirq phrase

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>
6 years agoMLK-21087-6:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Mon, 22 Apr 2019 09:28:29 +0000 (17:28 +0800)]
MLK-21087-6:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

Some frames are not for display,
so the timestamp of these frames should be skipped.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21458: mxc-jpeg: Implement V4L2_ENC_CMD_STOP
Mirela Rabulea [Thu, 18 Apr 2019 17:02:24 +0000 (20:02 +0300)]
MLK-21458: mxc-jpeg: Implement V4L2_ENC_CMD_STOP

Implementation is similar with V4L2_DEC_CMD_STOP, but cannot unify them,
due to different structures.
Also added the other V4L2_*_CMD_* commands to the switch,
but as "not implemented" for now.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-21507 VPU Decoder: kernel panic if seek when video playing
Shijie Qin [Sat, 20 Apr 2019 07:17:57 +0000 (15:17 +0800)]
MLK-21507 VPU Decoder: kernel panic if seek when video playing

    The same buffer prepend to the list twice at
    'VID_API_EVENT_REL_FRAME_BUFF'event and vpu_buf_queue()
    cause list form a dead cycle.
    Add an verification before prepend to list at vpu_buf_queue().

Unable to handle kernel paging request at virtual address dead000000000100
[<ffff000008bce7f4>] wait_right_buffer+0x60/0xac
[<ffff000008bd28f0>] vpu_api_event_handler+0xc64/0x1990
[<ffff000008bd3704>] vpu_msg_instance_work+0xe8/0x12c
[<ffff0000080f8518>] process_one_work+0x140/0x3f8
[<ffff0000080f8908>] worker_thread+0x138/0x3e4
[<ffff0000080fed70>] kthread+0x104/0x130
[<ffff000008085064>] ret_from_fork+0x10/0x18

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
6 years agoMLK-21437-2 VPU Decoder: add new v4l2_s_ctrl for adjust vpu_frm_depth
Shijie Qin [Thu, 18 Apr 2019 06:29:49 +0000 (14:29 +0800)]
MLK-21437-2 VPU Decoder: add new v4l2_s_ctrl for adjust vpu_frm_depth
    the default value should be vpu_frm_depth when init

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
6 years agoMLK-21087-5:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Fri, 19 Apr 2019 05:31:52 +0000 (13:31 +0800)]
MLK-21087-5:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

For some format, scode is need to insert before or after frame data.
It may cause that the input frame length is not match with
the consumed frame length.

The scode can be calculated as part of input frame.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21087-4:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Thu, 18 Apr 2019 09:00:54 +0000 (17:00 +0800)]
MLK-21087-4:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

set tsm_use_consumed_length default to 1

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21442: VPU Decoder: could not handle timestamp with start offset
ming_qian [Thu, 18 Apr 2019 06:38:43 +0000 (14:38 +0800)]
MLK-21442: VPU Decoder: could not handle timestamp with start offset

add some nxp buf flags: CODECCONFIG and TIMESTAMP_INVALID
if TIMESTAMP_INVALID is enabled, drop the timestamp.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21087-3:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Thu, 18 Apr 2019 02:16:20 +0000 (10:16 +0800)]
MLK-21087-3:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

Lower the level of the log indicating invalid frame rate

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21484-3: ASoC: fsl_sai: ensure clk is unprepared before reparent
Viorel Suman [Thu, 18 Apr 2019 12:28:04 +0000 (15:28 +0300)]
MLK-21484-3: ASoC: fsl_sai: ensure clk is unprepared before reparent

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
reparent. Wrap clk set_parent and set_rate operations with
disable_unprepare and prepare_enable.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-21484-2: ASoC: fsl_spdif: ensure clk is unprepared before reparent
Viorel Suman [Thu, 18 Apr 2019 12:25:44 +0000 (15:25 +0300)]
MLK-21484-2: ASoC: fsl_spdif: ensure clk is unprepared before reparent

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
reparent. Wrap clk set_parent and set_rate operations with
disable_unprepare and prepare_enable.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-21484-1: ASoC: fsl_micfil: unprepare the clk before reparent
Viorel Suman [Thu, 18 Apr 2019 12:14:17 +0000 (15:14 +0300)]
MLK-21484-1: ASoC: fsl_micfil: unprepare the clk before reparent

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
reparent. Fix this by moving clk_disable_unprepare before clk_set_parent.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-21506-2: mtd: nand: raw: gpmi-nand: use runtime pm not en/disable clock
Han Xu [Fri, 19 Apr 2019 20:00:56 +0000 (15:00 -0500)]
MLK-21506-2: mtd: nand: raw: gpmi-nand: use runtime pm not en/disable clock

use the run-time pm rather than en/disable clock in chip select function.

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-21506-1: mtd: nand: raw: gpmi-nand: enable the macros for MX8
Han Xu [Fri, 19 Apr 2019 14:51:06 +0000 (09:51 -0500)]
MLK-21506-1: mtd: nand: raw: gpmi-nand: enable the macros for MX8

enable the macros for mx8 platforms

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-20917-2: mtd: flexspi: Improve the i.MX8MM fspi performance
Han Xu [Fri, 19 Apr 2019 18:39:55 +0000 (13:39 -0500)]
MLK-20917-2: mtd: flexspi: Improve the i.MX8MM fspi performance

- Implemented the SFDP lut to get the correct chip information
- Changed the default read mode from normal read to Quad DDR
- Enabled the AHB prefetch after chip probed
- Limited the highest clock rate for iMX8MM

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-18396-2: mtd: fsl-flexspi: enable FSPI on i.MX8MM
Han Xu [Fri, 19 Apr 2019 16:53:24 +0000 (11:53 -0500)]
MLK-18396-2: mtd: fsl-flexspi: enable FSPI on i.MX8MM

Enable FlexSPI driver on i.MX8MM EVK.

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-21496 usb: typec: tcpm: remove qos request when unregister port
Peter Chen [Fri, 19 Apr 2019 08:34:37 +0000 (16:34 +0800)]
MLK-21496 usb: typec: tcpm: remove qos request when unregister port

As the counter part of pm_qos_add_request(), we should do
pm_qos_remove_request() and release high bus when unregister tcpm
port, otherwise we will have below crash if tcpm register again.

[    4.229417] tcpm_register_port(5021): trace
[    4.233631] pm_qos_update_target(280): c=ffff000009685998
node=ffff80083a084fb0
[    4.240960] pm_qos_update_target(301): trace
[    4.245228] pm_qos_update_target(303): trace
[    4.249512] Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000000
[    4.258302] Mem abort info:
[    4.261089]   ESR = 0x96000044
[    4.264142]   Exception class = DABT (current EL), IL = 32 bits
[    4.270063]   SET = 0, FnV = 0
[    4.273115]   EA = 0, S1PTW = 0
[    4.276258] Data abort info:
[    4.279135]   ISV = 0, ISS = 0x00000044
[    4.282973]   CM = 0, WnR = 1
[    4.285938] [0000000000000000] user address but active_mm is swapper
[    4.292300] Internal error: Oops: 96000044 [#1] PREEMPT SMP
[    4.297876] Modules linked in:
[    4.300934] Process kworker/0:2 (pid: 860, stack limit =
0x(____ptrval____))
[    4.307992] CPU: 0 PID: 860 Comm: kworker/0:2 Not tainted
4.19.35-04375-gedbbcdc07bf1-dirty #3
[    4.316604] Hardware name: Freescale i.MX8QXP MEK (DT)
[    4.321761] Workqueue: events deferred_probe_work_func
[    4.326901] pstate: 80000085 (Nzcv daIf -PAN -UAO)
[    4.331700] pc : plist_add+0x98/0xd8
[    4.335279] lr : pm_qos_update_target+0x310/0x330
[    4.339982] sp : ffff00000d603a00
[    4.343290] x29: ffff00000d603a00 x28: 0000000000000000
[    4.348607] x27: ffff00000936b538 x26: 0000000000000000
[    4.353924] x25: ffff000008f425b0 x24: 0000000000000000
[    4.359241] x23: ffff0000098d0000 x22: 0000000000000000
[    4.364557] x21: 000000003af84fa8 x20: ffff80083a084fb0
[    4.369874] x19: ffff000009685998 x18: ffffffffffffffff
[    4.375191] x17: 0000000000000000 x16: 0000000000000000
[    4.380508] x15: ffff0000096686c8 x14: ffff0000898d0fef
[    4.385824] x13: ffff0000098d0ffd x12: ffff000009685000
[    4.391141] x11: 0000000005f5e0ff x10: ffff000009668940
[    4.396458] x9 : ffff000008681658 x8 : ffff80083a084fb8
[    4.401775] x7 : ffff80083a084fc8 x6 : ffff80083af84fc8
[    4.407091] x5 : 0000000000000000 x4 : 0000000000000000
[    4.412408] x3 : ffff80083af84fb0 x2 : 0000000000000000
[    4.417725] x1 : ffff80083af84fb8 x0 : ffff80083a084fb0
[    4.423044] Call trace:
[    4.425497]  plist_add+0x98/0xd8
[    4.428728]  pm_qos_add_request+0x88/0x170
[    4.432831]  tcpm_register_port+0x5ec/0x898
[    4.437017]  tcpci_register_port+0x154/0x1e0
[    4.441291]  tcpci_probe+0xa8/0x218
[    4.444784]  i2c_device_probe+0x2e4/0x2f8
[    4.448796]  really_probe+0x248/0x3b8
[    4.452461]  driver_probe_device+0x12c/0x148
[    4.456735]  __device_attach_driver+0xac/0x160
[    4.461184]  bus_for_each_drv+0x68/0xd0
[    4.465022]  __device_attach+0xd8/0x160
[    4.468864]  device_initial_probe+0x10/0x18
[    4.473049]  bus_probe_device+0x94/0xa0
[    4.476890]  deferred_probe_work_func+0x84/0xd8
[    4.481427]  process_one_work+0x1ec/0x460
[    4.485438]  worker_thread+0x224/0x448
[    4.489194]  kthread+0x12c/0x130
[    4.492427]  ret_from_fork+0x10/0x18
[    4.496006] Code: f9400822 91002021 f9000428 a9008801 (f9000048)
[    4.502103] ---[ end trace 910526b6d64dab64 ]---
[    4.506754] note: kworker/0:2[860] exited with preempt_count 1

Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
Suggested-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
6 years agoMLK-21504 arm: dts: imx6qdl: fix mipi csi compatible string typo
Robby Cai [Fri, 19 Apr 2019 09:26:01 +0000 (17:26 +0800)]
MLK-21504 arm: dts: imx6qdl: fix mipi csi compatible string typo

should be "fsl,imx6q-mipi-csi2" rather than "fsl,imx6-mipi-csi2"

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>