cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
andrea@ross
Adventurer
Adventurer
621 Views
Registered: ‎11-26-2018

Petalinux kernel 4.19.0 Oops with v4l2 driver

I've some problems with the new petalinux 2019 (kernel 4.19.0); when the system loads my module I get this warning. (With petalinux 2018.3 the module was working correctly)

[   29.165507] ------------[ cut here ]------------
[   29.173531] refcount_t: increment on 0; use-after-free.
[   29.178787] WARNING: CPU: 3 PID: 2295 at lib/refcount.c:153 refcount_inc_checked+0x40/0x48
[   29.187038] Modules linked in: video(O+) al5d(O) al5e(O) allegro(O) xlnx_vcu_clk xlnx_vcu xilinx_hdmi_rx(O) xilinx_vphy(O) xlnx_vcu_core mali(O) uio_pdrv_genirq [last unloaded: video]
[   29.203388] CPU: 3 PID: 2295 Comm: insmod Tainted: G           O      4.19.0-xilinx-v2019.1 #1
[   29.211987] Hardware name: ZynqMP ZCU106 RevA (DT)
[   29.216764] pstate: 60000005 (nZCv daif -PAN -UAO)
[   29.221538] pc : refcount_inc_checked+0x40/0x48
[   29.226052] lr : refcount_inc_checked+0x40/0x48
[   29.230564] sp : ffffff8010f7b8f0
[   29.233863] x29: ffffff8010f7b8f0 x28: ffffffc87aebb1b8
[   29.239167] x27: ffffff800920fc18 x26: ffffffc87aebb000
[   29.244471] x25: 0000000000000001 x24: ffffff8008d9c6d8
[   29.249775] x23: 0000000000000000 x22: ffffff8008bfc7c8
[   29.255079] x21: ffffff800918dc28 x20: ffffff8009138648
[   29.260374] x19: 0000000000000001 x18: 0000000000000010
[   29.265669] x17: 0000000000000000 x16: 0000000000000000
[   29.270965] x15: ffffffffffffffff x14: ffffff8009138648
[   29.276269] x13: ffffff80891d6f0f x12: ffffff80091d6f17
[   29.281564] x11: ffffff800914a000 x10: ffffff8010f7b5d0
[   29.286859] x9 : ffffff8009138648 x8 : ffffff8008569d70
[   29.292163] x7 : 2d657375203b3020 x6 : 0000000000000189
[   29.297458] x5 : 0000000000000001 x4 : 0000000000000000
[   29.302754] x3 : 0000000000000000 x2 : ffffffffffffffff
[   29.308049] x1 : c29b4d7389105500 x0 : 0000000000000000
[   29.313345] Call trace:
[   29.315778]  refcount_inc_checked+0x40/0x48
[   29.319947]  __video_register_device+0x5f8/0xf00
[   29.324561]  video_probe+0x394/0x550 [video]
[   29.328818]  platform_drv_probe+0x50/0xa0
[   29.332818]  really_probe+0x1c8/0x280
[   29.336463]  driver_probe_device+0x54/0xe8
[   29.340544]  __driver_attach+0xe4/0xe8
[   29.344276]  bus_for_each_dev+0x70/0xc0
[   29.348096]  driver_attach+0x20/0x28
[   29.351655]  bus_add_driver+0x1dc/0x208
[   29.355475]  driver_register+0x60/0x110
[   29.359295]  __platform_driver_register+0x44/0x50
[   29.363986]  video_init+0x28/0x1000 [video]
[   29.368159]  do_one_initcall+0x74/0x178
[   29.371987]  do_init_module+0x54/0x1c8
[   29.375719]  load_module+0x1b5c/0x20e0
[   29.379451]  __se_sys_finit_module+0xb8/0xc8
[   29.383705]  __arm64_sys_finit_module+0x18/0x20
[   29.388220]  el0_svc_common+0x84/0xd8
[   29.391874]  el0_svc_handler+0x68/0x80
[   29.395606]  el0_svc+0x8/0xc
[   29.398470] ---[ end trace 6a49c9f1f8cce610 ]---

The other problem is related to the ioctl call, when I call the streamon ioctl I get this error

[  748.500139] Unable to handle kernel paging request at virtual address 0000326c34765f62
[  748.508063] Mem abort info:
[  748.510854]   ESR = 0x96000004
[  748.513896]   Exception class = DABT (current EL), IL = 32 bits
[  748.519809]   SET = 0, FnV = 0
[  748.522856]   EA = 0, S1PTW = 0
[  748.525994] Data abort info:
[  748.528865]   ISV = 0, ISS = 0x00000004
[  748.532691]   CM = 0, WnR = 0
[  748.535650] [0000326c34765f62] address between user and kernel address ranges
[  748.542784] Internal error: Oops: 96000004 [#2] SMP
[  748.547651] Modules linked in: video(O) al5e(O) al5d(O) allegro(O) xlnx_vcu_clk xlnx_vcu xilinx_hdmi_rx(O) xilinx_vphy(O) xlnx_vcu_core mali(O) uio_pdrv_genirq [last unloaded: video]
[  748.563913] CPU: 3 PID: 2605 Comm: test Tainted: G      D    O      4.19.0-xilinx-v2019.1 #1
[  748.572339] Hardware name: ZynqMP ZCU106 RevA (DT)
[  748.577116] pstate: a0000005 (NzCv daif -PAN -UAO)
[  748.581895] pc : __video_do_ioctl+0x108/0x498
[  748.586238] lr : __video_do_ioctl+0x40/0x498
[  748.590491] sp : ffffff800961bbc0
[  748.593789] x29: ffffff800961bbc0 x28: ffffffc879e16700
[  748.599093] x27: ffffff8008768ec0 x26: ffffff8000c8e1f8
[  748.604397] x25: 0000007ffffffb5c x24: 0000000040045612
[  748.609701] x23: 0000000000000000 x22: ffffff8009138648
[  748.614996] x21: 0000000000000012 x20: 0000000040045612
[  748.620292] x19: ffffffc87ac1b800 x18: 0000000000000000
[  748.625587] x17: 0000000000000000 x16: 0000000000000000
[  748.630882] x15: 0000000000000000 x14: 0000000000000000
[  748.636178] x13: 0000000000000000 x12: 0000000000000000
[  748.641473] x11: 0000000000000000 x10: 0000000000000000
[  748.646768] x9 : 0000000000000000 x8 : 0000000000000000
[  748.652064] x7 : 0000000000000000 x6 : ffffffc87b19c680
[  748.657359] x5 : 00000000ffffffff x4 : ffffff800876cc58
[  748.662654] x3 : ffffffc87b19c680 x2 : ff00326c34765f32
[  748.667950] x1 : 0000000000000000 x0 : ff00326c34765f42
[  748.673247] Process test (pid: 2605, stack limit = 0x00000000b507ed95)
[  748.679756] Call trace:
[  748.682188]  __video_do_ioctl+0x108/0x498
[  748.686182]  video_usercopy+0x144/0x518
[  748.690001]  video_ioctl2+0x14/0x1c
[  748.693474]  v4l2_ioctl+0x3c/0x58
[  748.696774]  do_vfs_ioctl+0xb8/0x8a0
[  748.700340]  ksys_ioctl+0x44/0x90
[  748.703639]  __arm64_sys_ioctl+0x1c/0x28
[  748.707547]  el0_svc_common+0x84/0xd8
[  748.711200]  el0_svc_handler+0x68/0x80
[  748.714933]  el0_svc+0x8/0xc
[  748.717799] Code: 1a9f87e1 2a010000 340017e0 91096040 (f9401018)
[  748.723883] ---[ end trace 30378055529dab84 ]---

I have tried to call all the ioctls many times. What could cause this problem? Maybe it's related to the warning?

Tags (2)
0 Kudos
1 Reply
singlee
Observer
Observer
431 Views
Registered: ‎05-31-2018


Hi andrea:

Did you sovled this problem?
It seems that I have encountered the same problem.

Thank you !
0 Kudos