1
0
Fork 0
Commit Graph

254 Commits (redonkable)

Author SHA1 Message Date
Richard Liu add79449db MA-17683 [#imx-2302] Fix video playback "rcu stall" issue on 8mq
Loop play a video AVC_1080p_24fps_90Mbps_bird90.m2ts met UI
freeze and "rcu stall". Enable CONFIG_DEBUG_SPINLOCK kernel
debug get below call stack, the reason is due to spin_lock
be used in IRQ interrupt and caused deadlock.

8mq board enabled Video overlay feature, there are two fences
enabled: out fence (represent frame on screen) and android out
fence (new added, represent frame off screen). When there are
two fences sync_file_set_fence() will call dma_fence_array_create()
to register irq_dma_fence_array_work(), then gckOS_DestroySignal()
will be called in IRQ which use spin_lock cause deadlock.

Fix solution is use spin_lock_irqsave() instead of spin_lock()
for Database->lock if it is not called in IRQ interrupt.

Call stack:
[  608.902810]  dump_backtrace.cfi_jt+0x0/0x4
[  608.906914]  show_stack+0x18/0x24
[  608.910237]  dump_stack+0xb8/0x114
[  608.913644]  spin_bug+0xb0/0xb4
[  608.916788]  do_raw_spin_lock+0xac/0x124
[  608.920714]  _raw_spin_lock+0x20/0x2c
[  608.924384]  gckOS_DestroySignal+0x6c/0x170
[  608.928572]  viv_fence_release+0x28/0x40
[  608.932502]  dma_fence_release+0x13c/0x280
[  608.936603]  dma_fence_array_release+0x74/0x98
[  608.941049]  dma_fence_release+0x13c/0x280
[  608.945150]  irq_dma_fence_array_work+0x6c/0x9c
[  608.949690]  irq_work_run_list+0xb4/0x148
[  608.953702]  irq_work_run+0x20/0x40
[  608.957193]  handle_IPI+0x10c/0x180
[  608.960686]  efi_header_end+0x13c/0x15c
[  608.964526]  el1_irq+0x104/0x200
[  608.967761]  radix_tree_lookup+0x38/0x84
[  608.971686]  gckOS_WaitSignal+0x54/0x258
[  608.975615]  gckKERNEL_Dispatch+0x1460/0x1754
[  608.979977]  gckDEVICE_Dispatch+0x1a0/0x1a4
[  608.984165]  drv_ioctl+0xb8/0x184
[  608.987487]  do_vfs_ioctl+0x3a0/0x6f0
[  608.991154]  __arm64_sys_ioctl+0x78/0xa4
[  608.995082]  el0_svc_common+0xb4/0x18c
[  608.998834]  el0_svc_handler+0x74/0x98
[  609.002589]  el0_svc+0x8/0xc

Change-Id: Idf16a5707add70246c74d2f1446f7dbb7037f5f0
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
(cherry picked from commit b6106c5de2529b01ce5bb3380fd93328b55d5528)
2020-09-04 10:39:18 +08:00
Richard Liu 8c5e7b55ac MA-17341-2 [#imx-2211] Fix kernel panic when do stop on android
There is kernel panic when stop android or kill surfaceflinger
after enable framebuffer tile compression on 8mq board.
The root cause of the issue is dcss driver not api to receive
ts fd, gpu driver will set the ts_dma_buf in _SetVidMemMetadata(),
dcss driver get the ts buffer physical address from ts_dma_buf,
when stop android framebuffer and matched ts buffer will free,
previous ts_dma_buf get from ts_fd will be invalid, when dcss
driver use this ts_dma_buf will cause problem. It is a common
issue, if Linux Weston do the similar stop should also meet
the same panic issue.

Keep a reference for ts_dma_buf in _SetVidMemMetadata(),
decrease the reference in _dmabuf_release() can avoid the
panic issue.

Kernel panic log:
[   41.007431] kernel BUG at drivers/gpu/drm/drm_gem.c:154!
[   41.139375] Call trace:
[   41.141824]  drm_gem_object_init+0xb8/0xbc
[   41.145920]  drm_gem_cma_prime_import_sg_table+0x84/0xdc
[   41.151233]  drm_gem_prime_import_dev+0xe8/0x194
[   41.160036]  dcss_plane_atomic_set_base+0x31c/0x3d0
[   41.164915]  dcss_plane_atomic_update+0x450/0x46c
[   41.164923]  drm_atomic_helper_commit_planes+0x130/0x31c
[   41.182255]  dcss_drm_atomic_commit_tail+0xcc/0x150
[   41.187139]  dcss_commit_work+0x10/0x1c
[   41.197322]  process_one_work+0x2d8/0x580
[   41.201333]  worker_thread+0x28c/0x518
[   41.205085]  kthread+0x14c/0x15c
[   41.208316]  ret_from_fork+0x10/0x18

Change-Id: I385851b436d1fead1131ce25f496bdd5d3d14264
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
(cherry picked from commit 9ef46bda523088bfba51b7432acd2c1e21e547d5)
2020-09-04 10:39:10 +08:00
Richard Liu da8160ec36 MA-17341 [#imx-2211] Remove ts_address code to keep align with Linux
Android pass ts_address to dcss to fix kernel panic issue
reported in ticket MA-12928, this fix solution is not formal.
Remove ts_address code to keep align with Linux, if android
still meet panic issue for corner case we need check root
cause and do formal fix.

Change-Id: I04a6294f237e0c1ed5544dce1dc13e5a6ac232ab
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
(cherry picked from commit 54baa89690f61101c8182cd4fed2177941476587)
2020-09-04 10:39:03 +08:00
Xianzhong 0c3cc8d15f MGS-5943 [#imx-2089] 0091-KERNEL-SPACE-Update-gc_feature_database.h-to-290561
Update gc_feature_database.h to 290561

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-22 02:09:08 +08:00
Xianzhong dbda71a745 MGS-5943 [#imx-2089] 0081-BUG27413-CL290463-KERNEL-SPACE-64x_234062-ocl-fix-th
fix
 the bug#27413. no need to switch hardware object to query the name and chip
 info of the chip.

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-22 02:09:08 +08:00
Xianzhong 9b30171363 MGS-5943 [#imx-2089] 0079-CL290440-KERNEL-SPACE-6.4.x-Always-enable-gcdIGNORE_
6.4.x: Always enable
 gcdIGNORE_DRIVER_VERSION_MISMATCH for NXP tree.

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-22 02:09:08 +08:00
Xianzhong c0fb4ffb96 MGS-5928-3 [#ccc] fix Android kernel crash problem
user may not sync cache before free the cacheable memory,
when GPU allocate the non-sync memory for non-cacheable map,
it will lead to the unstable issue if cache sync is missing.

revert previous optimization to sync cache for each request,
need work out other idea to reduce the memory consumption.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit 9707d26d9daece1d8a821e1d530e0c422ea527a0)
2020-08-18 16:57:55 +08:00
Ming Qian b287e45d99 MLK-24477-4:[8QM_MEK/8QXP_MEK]mxc:vpu_malone: report color space by try_fmt
gst will depend on the try_fmt api
if driver don't report the correct color space in try_fmt
gst may return fail

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-17 11:26:25 +08:00
Xianzhong ca331e5a4a MGS-5928-2 [#ccc] support virtual memory in normal zone
opencl conformance encounters out of memory on 6qp often

Normal free:223540kB, free_cma:180280kB
0 pages HighMem/MovableOnly

currently GPU virtual memory allocate highmem only,
change to try normal zone first, then go highmem.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-14 18:22:45 +08:00
Xianzhong 59501b0f9c MGS-5928-1 [#ccc] allocate auxiliary memory for cacheable map
create dma mapping and scatter list pages for cachable memory,
also move the auxiliary memory allocation into map/unmap.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-14 18:20:58 +08:00
Xianzhong b9d2070f87 MGS-5933-1 [#ccc] reenable m865s gpu TX clock gating
Disabled TX clock gating can not fix GFXBench hang on M865,
128B L2 cache mode for reading texture can fix that.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-14 18:20:36 +08:00
Shijie Qin 31b92c7ddf LF-2111: mxc: vpu_windsor: Avoid hide parameter
Fix declaration hides parameter 'attr'.
(coverity ID 5572378)

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-08-13 17:20:32 +08:00
Shijie Qin 2f7a8e07a3 LF-2138: mxc: vpu_malone: change typedef of 'valid_ts_received' to unsigned int
Bit field of 'valid_ts_received' is 1, change its typedef to
unsigned int. (coverity ID 9000734)

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-08-13 17:20:32 +08:00
Xianzhong eda396f8bc MGS-5849 Integrate VSI GPU 6.4.3.p0 kernel driver
6.4.3.p0 new feature list:
 - OpenGL ES 3.2.6.1
 - Vulkan 1.1.6.3
 - OpenVX 1.2 NN extension

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-13 11:06:14 +08:00
Ming Qian c9f7364dc4 MLK-24477-3:[8QM_MEK/8QXP_MEK]mxc:vpu_malone: improve get/set color api
use the v4l2 api instead of custom api

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-12 16:02:21 +08:00
Ming Qian f36e9e62bd MLK-24477-2:[8QM_MEK/8QXP_MEK]mxc:vpu_windsor: enable color description in vui
1. enable color description in vui when encoding.
2. improve the get/set color description api

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-12 16:02:07 +08:00
Zhou Peng 85b5d239b0 MLK-24373-2 arm64: imx8mp: vpu: g1/g2: fix potential deadlock issue
Replace spin_lock() with spin_lock_irqsave() to avoid potential deadlock

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-07-17 15:25:53 +08:00
Zhou Peng 742c7adea8 MLK-24373-1 arm64: imx8mp: vpu: g1/g2: fix blocking issue in suspend
HW enable and disable are shared with the same function, driver need to
check the parameter to identify whether HW is enabled or not

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-07-17 15:25:53 +08:00
Shijie Qin 24a0a82d97 MLK-24404-2 mxc: vpu_windsor: correct device power usage_count
If 'pm_runtime_get_sync()' fail, need to reset device power usage_count
to '0'. Otherwise, the usage_count always bigger than '0' and not do
'runtime_suspend()' actually.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-07-15 19:18:59 +08:00
Shijie Qin 11acf33f0c MLK-24404-1 mxc: vpu_malone: correct device power usage_count
If 'pm_runtime_get_sync()' fail, need to reset device power usage_count
to '0'. Otherwise, the usage_count always bigger than '0' and not do
'runtime_suspend()' actually.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-07-15 19:18:59 +08:00
Xianzhong 0e631625a9 MGS-5806 [#ccc] fix 8mm gpu hang due to dummy draw
shall trigger dummy draw when update gpu mmu setup,
the problem is caused by 8mp vip errata workaround.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-07-04 01:58:53 +08:00
Ella Feng ae39e0e8b1 MA-17404 [#imx-2206] Kernel code copyright and license issue.
Those files need have GPL license align with linux kernel. This is introduced by
VIP HW errata workaround.
Removed VSI private license and add GPL license.

Signed-off-by: Ella Feng <ella.feng@nxp.com>
2020-07-04 01:58:53 +08:00
Ming Qian a491cf9985 LF-1681: [8QM_MEK/8QXP_MEK]mxc:vpu_windsor: delete redundant data before start code
there may be some redundant data before the encoded frame,
generally it won't bring any problem.
but on android, the redundant data may affect the mux,
can cause the mp4 can't be decoded.
so delete the redundant data in the driver.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2020-07-03 14:35:38 +08:00
Joakim Zhang 2143242c69 MLK-24364 mxc: sim: add runtime pm support
Add runtime pm support for SIM.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2020-07-02 21:32:13 +08:00
Joakim Zhang 1de612cb22 MLK-24363-2 mxc: emvsim: fix error report in probe stage
In probe stage, setting "emvsim_dev.parent = &pdev->dev" after error
report which is unreasonable, this patch fixes this issue.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2020-07-02 21:32:12 +08:00
Joakim Zhang 68f1614266 MLK-24363-1 mxc: emvsim: add error check when enable clk
Add error check when enable clk and register misc device at the end of
probe stage. This patch just improve and clean up the code, no function
change.

Fixes: commit d494420149 ("MLK-23793-2 mxc: emvsim: add runtime pm support")
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2020-07-02 21:32:12 +08:00
Joakim Zhang 511ca8224d LF-1573 mxc: sim: Unchecked return value
Coverity report: CID = 10280137

check_return: Calling clk_prepare_enable without checking return value
(as is done elsewhere 8 out of 10 times).

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2020-06-23 19:50:41 +08:00
Joakim Zhang af5b1d275e LF-1572 mxc: sim: Unchecked return value
Coverity report: CID = 10280138

check_return: Calling clk_prepare_enable without checking return value
(as is done elsewhere 8 out of 10 times).

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2020-06-23 19:50:41 +08:00
Ella Feng 5db279fcc5 MGS-5789 [#imx-2156] Fix Coverity issue in VIP PM HW workaround
Fix resource leak issue in VIP PM HW workaround, set pointer to NULL before release funcCmd
since they point to the same memory.

Signed-off-by: Ella Feng <ella.feng@nxp.com>
2020-06-22 17:46:28 +08:00
Ella Feng a6ff08ef2f MGS-5787 [#imx-1868] Update database for GPU/VIP
Update database for GPU/VIP for 0611 patch release from VSI.

Signed-off-by: Ella Feng <ella.feng@nxp.com>
2020-06-22 17:46:28 +08:00
Minjie Zhuang efba98ba02 MGS-5787 [#imx-1868] 0004-CL275303-default-open-flopreset-with-TP
CL275303 default open flopreset with TP

Signed-off-by: Minjie Zhuang <minjie.zhuang@nxp.com>
2020-06-22 17:46:25 +08:00
Minjie Zhuang be6df93710 MGS-5787 [#imx-1868] 0003-CL275293-fix-flop-tp-reset-issue
CL275293 fix flop tp reset issue

Signed-off-by: Minjie Zhuang <minjie.zhuang@nxp.com>
2020-06-22 17:46:25 +08:00
Joakim Zhang a93e76030c MLK-20236 mxc: sim/emvsim: useless call
Coverity reprot: CID = 4159427

side_effect_free: Calling emvsim_check_baud_rate(&emvsim->baud_rate)
is only useful for its return value, which is ignored.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2020-06-19 22:23:23 +08:00
Xianzhong 85a7c0f80d MGS-5768 [#imx-2132] fix android cts memory leak with CL_MEM_USE_HOST_PHYSICAL_ADDR_VIV
CL_MEM_USE_HOST_PHYSICAL_ADDR_VIV will use host physical memory directly, logical address is zero.
gckOS_UnlockPages will check Logical address and return invalid parameter,
that causes memory leak in OpenCL user library, need remove this check.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-06-11 15:17:20 +08:00
Ella Feng 003e8f969b MGS-5531 [#imx-1868] Fix VIP Hang isse with HW reet
This SW workaround insert a small program after power-on reset.
The small program is similar to a hardware bare-metal test pattern.
It is target to initialize registers by performing short operations in the NN, TP and PPU modules
by doing simple convolution, connected layer, tensor add operations

Signed-off-by: Ella Feng <ella.feng@nxp.com>
2020-06-11 19:29:10 +08:00
Minjie Zhuang 7124761ebb MGS-5709 [#imx-1439] fix gpu suspend/resume stuck
L4.19 SCFW introduced LP mode, clk_set requires power-on,
fixed GPU govern to conform with the latest SCFW change.
remove redundant clk_set_rate in probe to fix LP clock.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-05-28 19:53:55 +08:00
Minjie Zhuang 8905f28a8b MGS-5060 [#imx-1868] 0021-Update-gc_feature_database.h-to-271754
Update gc_feature_database.h to 271754

Signed-off-by: Ella Feng <ella.feng@nxp.com>
2020-05-28 19:52:10 +08:00
Shijie Qin ab12a0e299 LF-1430-4 mxc: vpu_malone: refine the operation of insert scode
For more readable, use a handler table to insert scode for
each format.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-05-26 18:19:24 +08:00
Shijie Qin 4799aeb690 LF-1430-3 mxc: vpu_malone: unify set payload header
The payload header of sequence / picture / slice are the
same operation, could unify them in a function.
payload size = data_size - payload_header_size - start_code_size

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-05-26 18:19:24 +08:00
Shijie Qin 34fcc5dd0d LF-1430-2 mxc: vpu_malone: correct VP8 ivf frame header
Correct VP8 ivf frame header
  firmware just parse 64-bit timestamp(8 bytes).
  As not transfer timestamp to firmware, use default value(ZERO).
  No need to do anything here.
Refine the function of set vp8 ivf sequence header.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-05-26 18:19:24 +08:00
Shijie Qin a4fe7d2f15 LF-1430-1 mxc: vpu_malone: refine insert scode for VC1 format
The seq payload size should is 20+12.
Refine the function of set rcv header.
Refine the function of create nal header.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-05-26 18:19:24 +08:00
Ming Qian da37a31d45 LF-1405-2:[8QM_MEK/8QXP_MEK]mxc:vpu_malone: support insmod repeatly
1. the mu won't be really power off,
so we need restore the mu but not initialize it
2. the vpu is shared with vpu windsor,
so we don't do vpu reset when remove module.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2020-05-25 09:25:49 +08:00
Ming Qian 8ebff584ef LF-1405-1: [8QM_MEK/8QXP_MEK]mxc:vpu_malone: support insmod separately
delay the creation of video device node in order to avoid inmod failure

in probe function, if create video node in a early stage,
the video node may be created before initialize the vpu dev,
and in such case, open video node,
the mu mailbox may be not requested,
then it will led to download firmware fail.

so create the video device node at the end of the probe function.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2020-05-25 09:25:49 +08:00
Ming Qian 7f3a9db8ad LF-1406-2:[8QM_MEK/8QXP_MEK]mxc:vpu_windsor: support insmod repeatly
1. the mu won't be really power off,
so we need restore the mu but not initialize it
2. the vpu is shared with vpu malone,
so we don't do vpu reset when remove module.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2020-05-25 09:25:49 +08:00
Ming Qian 1e607ac346 LF-1406-1:[8QM_MEK/8QXP_MEK]mxc:vpu_windsor: support insmod separately
delay the creation of video device node in order to avoid inmod failure
in probe function, if create video node in a early stage,
the video node may be created before initialize the vpu dev,
and in such case, open video node,
the mu mailbox may be not requested,
then it will led to download firmware fail.

so create the video device node at the end of the probe function.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2020-05-25 09:25:49 +08:00
Liu Ying c18ff376db MLK-24090 mxc: ipu3: ipu_device: Fix AB-BA deadlock between vdoa_lock and ipu_ch_tbl.lock
In VDOA_MODE, _get_vdoa_ipu_res() would lock ipu_ch_tbl.lock mutex first,
then lock vdoa_lock mutex and finally unlock ipu_ch_tbl.lock mutex.
The vdoa_lock mutex is unlocked until put_vdoa_ipu_res().  Since the two
mutexes are not unlocked in a reversed order as they are locked, AB-BA
deadlock issue may happen as the below warning shows, which can be detected
with the debug option CONFIG_PROVE_LOCKING enabled.

[   52.398770] ======================================================
[   52.404957] WARNING: possible circular locking dependency detected
[   52.411145] 5.4.24 #1477 Not tainted
[   52.414728] ------------------------------------------------------
[   52.420915] ipu1_task/92 is trying to acquire lock:
[   52.425800] 81f02274 (&ipu_ch_tbl.lock){+.+.}, at: get_res_do_task+0x144/0x77c
[   52.433050]
[   52.433050] but task is already holding lock:
[   52.438888] 8183189c (vdoa_lock){+.+.}, at: vdoa_get_handle+0x64/0x158
[   52.445434]
[   52.445434] which lock already depends on the new lock.
[   52.445434]
[   52.453615]
[   52.453615] the existing dependency chain (in reverse order) is:
[   52.461101]
[   52.461101] -> #1 (vdoa_lock){+.+.}:
[   52.466175]        __mutex_lock+0xb8/0xaa8
[   52.470283]        mutex_lock_nested+0x2c/0x34
[   52.474735]        vdoa_get_handle+0x64/0x158
[   52.479100]        _get_vdoa_ipu_res+0x2b4/0x338
[   52.483726]        get_res_do_task+0x34/0x77c
[   52.488092]        ipu_task_thread+0x148/0xeb0
[   52.492551]        kthread+0x168/0x170
[   52.496310]        ret_from_fork+0x14/0x20
[   52.500414]        0x0
[   52.502779]
[   52.502779] -> #0 (&ipu_ch_tbl.lock){+.+.}:
[   52.508457]        __lock_acquire+0x15d0/0x2588
[   52.512995]        lock_acquire+0xdc/0x280
[   52.517103]        __mutex_lock+0xb8/0xaa8
[   52.521210]        mutex_lock_nested+0x2c/0x34
[   52.525662]        get_res_do_task+0x144/0x77c
[   52.530113]        ipu_task_thread+0x148/0xeb0
[   52.534566]        kthread+0x168/0x170
[   52.538322]        ret_from_fork+0x14/0x20
[   52.542425]        0x0
[   52.544790]
[   52.544790] other info that might help us debug this:
[   52.544790]
[   52.552797]  Possible unsafe locking scenario:
[   52.552797]
[   52.558721]        CPU0                    CPU1
[   52.563256]        ----                    ----
[   52.567790]   lock(vdoa_lock);
[   52.570853]                                lock(&ipu_ch_tbl.lock);
[   52.577040]                                lock(vdoa_lock);
[   52.582619]   lock(&ipu_ch_tbl.lock);
[   52.586289]
[   52.586289]  *** DEADLOCK ***
[   52.586289]
[   52.592215] 1 lock held by ipu1_task/92:
[   52.596142]  #0: 8183189c (vdoa_lock){+.+.}, at: vdoa_get_handle+0x64/0x158
[   52.603123]
[   52.603123] stack backtrace:
[   52.607493] CPU: 0 PID: 92 Comm: ipu1_task Not tainted 5.4.24 #1477
[   52.613765] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   52.620298] Backtrace:
[   52.622764] [<8010f094>] (dump_backtrace) from [<8010f3ac>] (show_stack+0x20/0x24)
[   52.630345]  r7:818641a8 r6:00000000 r5:600f0193 r4:818641a8
[   52.636026] [<8010f38c>] (show_stack) from [<80f534d8>] (dump_stack+0xbc/0xe8)
[   52.643261] [<80f5341c>] (dump_stack) from [<8019c8f4>] (print_circular_bug+0x1c4/0x214)
[   52.651361]  r10:a8330000 r9:ffffffff r8:a8330000 r7:a8330550 r6:81d13b1c r5:81d13ac0
[   52.659197]  r4:81d13ac0 r3:46e9f8d1
[   52.662783] [<8019c730>] (print_circular_bug) from [<8019cb48>] (check_noncircular+0x204/0x21c)
[   52.671492]  r9:00000001 r8:81708f50 r7:00000000 r6:a8423a98 r5:a8330530 r4:a8330550
[   52.679245] [<8019c944>] (check_noncircular) from [<8019f274>] (__lock_acquire+0x15d0/0x2588)
[   52.687778]  r8:81708f50 r7:81d13ac0 r6:00000001 r5:81e93d7c r4:a8330530
[   52.694491] [<8019dca4>] (__lock_acquire) from [<801a0b84>] (lock_acquire+0xdc/0x280)
[   52.702334]  r10:00000000 r9:00000000 r8:00000000 r7:81f02274 r6:600f0113 r5:81708724
[   52.710169]  r4:00000000
[   52.712717] [<801a0aa8>] (lock_acquire) from [<80f71938>] (__mutex_lock+0xb8/0xaa8)
[   52.720384]  r10:81e93d7c r9:0000f6d0 r8:81f022e8 r7:00008f50 r6:00000000 r5:ffffe000
[   52.728219]  r4:81f02240
[   52.730765] [<80f71880>] (__mutex_lock) from [<80f72354>] (mutex_lock_nested+0x2c/0x34)
[   52.738778]  r10:00000000 r9:a8423ccc r8:81f022e8 r7:000002d0 r6:8188b6f8 r5:81f02234
[   52.746613]  r4:a4540400
[   52.749162] [<80f72328>] (mutex_lock_nested) from [<80b8c830>] (get_res_do_task+0x144/0x77c)
[   52.757612] [<80b8c6ec>] (get_res_do_task) from [<80b8d6a0>] (ipu_task_thread+0x148/0xeb0)
[   52.765886]  r10:a8139bd0 r9:a8423ccc r8:81f022e8 r7:a4540400 r6:81831604 r5:a454053c
[   52.773721]  r4:600f0013
[   52.776269] [<80b8d558>] (ipu_task_thread) from [<801684c8>] (kthread+0x168/0x170)
[   52.783849]  r10:a8139bd0 r9:80b8d558 r8:81f022e8 r7:a8422000 r6:00000000 r5:a840cd00
[   52.791684]  r4:a83cc080
[   52.794231] [<80168360>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
[   52.801460] Exception stack(0xa8423fb0 to 0xa8423ff8)
[   52.806521] 3fa0:                                     00000000 00000000 00000000 00000000
[   52.814711] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   52.822898] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   52.829521]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80168360
[   52.837356]  r4:a840cd00

This patch corrects the locking/unlocking sequence for the two mutexes
to fix the deadlock issue.

Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2020-05-22 09:32:52 +08:00
Zhou Peng 0d1b3814c9 MLK-24009-4 arm64: imx8mq: vpu: g1/g2: fix build issue as module
fix clk use-after-free issue

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-05-15 12:39:05 +08:00
Zhou Peng 420a357a1b MLK-24009-3 arm64: imx8mm: vpu: h1: fix build issue as module
release clk to avoid memory leak

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-05-15 12:39:05 +08:00
Zhou Peng 76d95bf263 MLK-24009-2 arm64: imx8mp: vpu: g1/g2: fix build issue as module
release clk to avoid memory leak

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-05-15 12:39:05 +08:00
Zhou Peng 099a3ae272 MLK-24009-1 arm64: imx8mp: vpu: vc8000e: fix build issue as module
change module device table name to fix build error as module
rename the c source name to avoid conflict with h1
release clk avoid memory leak
fix typo error in core index

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-05-15 12:39:05 +08:00