Robby Cai
5cead2a105
MLK-25335 dma: pxp: fix kernel dump for pxp device
...
dma API(s) can't use NULL device because of following patch:
d7e02a9312
dma-mapping: remove leftover NULL device support
this patch uses pxp_dev instead of NULL device to resolve kernel dump.
[ 445.484900] 8<--- cut here ---
[ 445.488002] Unable to handle kernel NULL pointer dereference at virtual address 0000015c
[ 445.512965] pgd = 2afadd37
[ 445.515707] [0000015c] *pgd=00000000
[ 445.521436] Internal error: Oops: 5 [#1 ] PREEMPT SMP ARM
[ 445.526776] Modules linked in: 8021q mx6s_capture ov5640_camera_v2
[ 445.532993] CPU: 0 PID: 2117 Comm: vqueue:src Not tainted 5.4.70-2.3.0+g4f2631b022d8 #1
[ 445.541006] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 445.547214] PC is at pxp_device_ioctl+0xc64/0xe80
[ 445.551933] LR is at pxp_buffer_object_lookup+0x30/0x38
[ 445.557169] pc : [<80550e20>] lr : [<8054fd00>] psr: 60000013
[ 445.563446] sp : 93bffea8 ip : 908a03ac fp : 76957ff8
[ 445.568681] r10: 00000036 r9 : 93bfe000 r8 : 93b04540
[ 445.573917] r7 : 939d78c0 r6 : 80085007 r5 : 939d77c0 r4 : 00000000
[ 445.580454] r3 : 00000001 r2 : 00000000 r1 : 00000002 r0 : 939d77c0
[ 445.586993] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 445.594140] Control: 10c5387d Table: 93bd806a DAC: 00000051
[ 445.599904] Process vqueue:src (pid: 2117, stack limit = 0xcf85841b)
[ 445.606270] Stack: (0x93bffea8 to 0x93c00000)
[ 445.610645] fea0: 73800000 8020a840 93ab8800 81304f08 739bc000 93ab8800
[ 445.618841] fec0: 93b8f840 739bc000 93b0fa80 8020eddc 93ab8800 00000002 00000001 00100c00
[ 445.627037] fee0: 00000000 93bffee8 00000000 81304f08 00000008 741d7ff4 926428d0 80085007
[ 445.635234] ff00: 741d7ff4 93b04540 93bfe000 00000036 76957ff8 80256c3c 93ab8800 0000010a
[ 445.643430] ff20: 00000106 00000000 00000000 93b8f840 00000001 80210c20 000001e7 00000000
[ 445.651626] ff40: 0009a100 93b8f848 93bfff54 0001c200 93bfff7c 00000001 93b04540 0000000b
[ 445.659822] ff60: 00000001 00004000 93adc200 81304f08 93b04541 0000000b 80085007 741d7ff4
[ 445.668019] ff80: 93b04540 93bfe000 00000036 8025716c 75742980 743caee0 01a152e0 00000036
[ 445.676214] ffa0: 80101204 80101000 75742980 743caee0 0000000b 80085007 741d7ff4 743cb004
[ 445.684410] ffc0: 75742980 743caee0 01a152e0 00000036 00000002 741d8064 741d81d4 76957ff8
[ 445.692605] ffe0: 743caf40 741d7fd4 743b88d1 76d2cfe8 80000030 0000000b 00000000 00000000
[ 445.700820] [<80550e20>] (pxp_device_ioctl) from [<80256c3c>] (do_vfs_ioctl+0x404/0x900)
[ 445.708936] [<80256c3c>] (do_vfs_ioctl) from [<8025716c>] (ksys_ioctl+0x34/0x60)
[ 445.716355] [<8025716c>] (ksys_ioctl) from [<80101000>] (ret_fast_syscall+0x0/0x54)
[ 445.724023] Exception stack(0x93bfffa8 to 0x93bffff0)
[ 445.729091] ffa0: 75742980 743caee0 0000000b 80085007 741d7ff4 743cb004
[ 445.737287] ffc0: 75742980 743caee0 01a152e0 00000036 00000002 741d8064 741d81d4 76957ff8
[ 445.745477] ffe0: 743caf40 741d7fd4 743b88d1 76d2cfe8
[ 445.750550] Code: e595100c e3a00000 e12fff34 eafffd39 (e594315c)
[ 445.773509] ---[ end trace a4bb9353c99e0cef ]---
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 65430960442dff55b1b086f2ed3caf06a2e7dbb8)
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-04-27 10:42:01 +00:00
Robby Cai
67841b2327
LF-1596 dma: pxp: add checking for out against NULL
...
Coverity Issue ID: 414719
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 02460d551d7c94e911240da6b62082b91653d923)
2020-07-06 18:04:07 +08:00
Robby Cai
fe7318abc1
LF-1595 dma: pxp: fix the typo for possible_inputs_s1 checking
...
Coverity Issue ID: 379378
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 9a66eb111f9419b93a4d3a3786e05488522cf9a6)
2020-07-06 18:03:52 +08:00
Robby Cai
2d98ad7b3a
LF-1594 dma: pxp: fix out-of-bounds access
...
Coverity issue ID: 379372
As only one overlayer supported, the initialization for ol_param
need to be adjusted accordingly.
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 13dcde085e1d017440e3f0bc829faac340a8674e)
2020-07-06 18:03:25 +08:00
Robby Cai
4cfc9a7d83
LF-105-1 dmaengine: pxp: fix build warning of fall through
...
Fix the following build warning:
../drivers/dma/pxp/pxp_dma_v3.c: In function 'pxp_store_shift_ctrl_config':
../drivers/dma/pxp/pxp_dma_v3.c:1700:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
shift_bypass = 1;
~~~~~~~~~~~~~^~~
../drivers/dma/pxp/pxp_dma_v3.c:1701:3: note: here
case PXP_PIX_FMT_YVYU:
^~~~
../drivers/dma/pxp/pxp_dma_v3.c:1705:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
shift_bypass = 1;
~~~~~~~~~~~~~^~~
../drivers/dma/pxp/pxp_dma_v3.c:1706:3: note: here
case PXP_PIX_FMT_NV61:
^~~~
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit c1ca344b32c914c89cbcf307a2e1313ad82a0b71)
2019-12-03 18:09:26 +08:00
Robby Cai
3d64db930d
media: pxp device: fix kernel dump when run pxp_test
...
In 5.x, the first parameter of dma_alloc_coherent() can't be 0, otherwise
the following dump will arise when run the command:
`/unit_tests/Display/pxp_test.out -I "-o 1.yuv" '. This patch fixed this.
And also, use register_chrdev instead of misc_register to make it clean.
[ 53.838653] Internal error: Oops: 17 [#1 ] SMP ARM
[ 53.844538] Modules linked in:
[ 53.847610] CPU: 0 PID: 754 Comm: pxp_test.out Not tainted 5.4.0-rc5-03564-g9792b86 #46
[ 53.855620] Hardware name: Freescale i.MX6 SoloX (Device Tree)
[ 53.861473] PC is at dma_alloc_attrs+0x10/0x114
[ 53.866015] LR is at pxp_device_ioctl+0x90c/0xe98
[ 53.870728] pc : [<c01bf1e8>] lr : [<c05eb360>] psr: a0070013
[ 53.877001] sp : ed4e7e74 ip : 00000001 fp : b6591f9c
[ 53.882232] r10: 00000000 r9 : e47efd40 r8 : ed4e7ecc
[ 53.887463] r7 : ed508cc0 r6 : c1408b08 r5 : 00000000 r4 : 00000051
[ 53.893997] r3 : 00000cc1 r2 : e47efd4c r1 : 00055000 r0 : 00000240
[ 53.900533] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 53.907675] Control: 10c5387d Table: ad14804a DAC: 00000051
[ 53.913428] Process pxp_test.out (pid: 754, stack limit = 0x(ptrval))
[ 53.919878] Stack: (0xed4e7e74 to 0xed4e8000)
[ 53.924245] 7e60: 00000051 b6591cf4 c1408b08
[ 53.932434] 7e80: ed508cc0 ed4e7ecc e47efd40 00000000 b6591f9c c05eb360 00000000 c0605e08
[ 53.940622] 7ea0: ed42ac00 c0607e3c 00000034 e47fe3c0 ed4e6000 00000034 c1408b08 c0605cc0
[ 53.948810] 7ec0: ed4e7f78 00000000 ed4e6000 00000000 00054600 00000000 00000000 00000000
[ 53.956998] 7ee0: c1408b08 0479b828 00000000 c1408b08 b6591cf4 e47fb640 c02b7b8c b6591cf4
[ 53.965187] 7f00: ed4e6000 eca65e00 b6591f9c c02b71e0 c02c4bbc c0192be8 ec2dc380 c018dc54
[ 53.973374] 7f20: c1408b08 00000001 00000000 0479b828 c15344fd 00000004 00004000 e47fb3c0
[ 53.981562] 7f40: c15344fd c112a1d4 c110a05c c02c4bcc 00000000 00000000 c02c4aa8 00000000
[ 53.989750] 7f60: e47fab41 0479b828 bee8aad0 e47fb641 e47fb640 00000004 c0145004 b6591cf4
[ 53.997938] 7f80: ed4e6000 00000036 b6591f9c c02b7b8c b6591cf4 bee8aad0 b6591ce8 00000036
[ 54.006125] 7fa0: c01011c4 c0101000 b6591cf4 bee8aad0 00000004 c0145004 b6591cf4 b6ee603c
[ 54.014313] 7fc0: b6591cf4 bee8aad0 b6591ce8 00000036 00077858 00000000 bee8aad0 b6591f9c
[ 54.022502] 7fe0: b6ee6018 b6591cac b6ed5848 b6e604bc 60070010 00000004 00000000 00000000
[ 54.030699] [<c01bf1e8>] (dma_alloc_attrs) from [<00000034>] (0x34)
[ 54.036981] Code: e92d4ff0 e1a05000 e2800d09 e59f60ec (e140a0d8)
[ 54.043222] ---[ end trace d872f4c07e2464bf ]---
Signed-off-by: Robby Cai <robby.cai@nxp.com>
2019-11-25 15:45:52 +08:00
Robby Cai
1f862ce17f
dma: pxp: porting pxp dma driver from imx_4.19.y
...
Porting pxp dma drivers v2 and v3 from imx_4.19.y
Signed-off-by: Robby Cai <robby.cai@nxp.com>
2019-11-25 15:45:52 +08:00