Skip to content

Oops with vchiq_prepare_bulk_data (tc358743 + OMX JPEG encoder) #4669

Closed
@mdevaev

Description

@mdevaev

Describe the bug
The latest version of 5.10 kernel crashing when using OMX JPEG encoding and TC358743 with 720p video source resolution.

To reproduce
Take TC358743 and ustreamer.

git clone https://github.com/pikvm/ustreamer
cd ustreamer
make WITH_OMX=1

Add cma=128M to cmdline.txt and gpu_mem=256 to config.txt and try this command:

ustreamer --encoder=omx --dv-timings --persistent -m uyvy

You will see the crash.

System

  • Raspberry Pi 4 B+ 4G
  • Arch Linux ARM / PiKVM OS
  • vcgencmd version:
    Nov  2 2021 13:22:15
    Copyright (c) 2012 Broadcom
    version e50fe24ee2b6974f3ba6615ba0f1d8f45c485f69 (clean) (release) (start)
    
  • Linux pikvm 5.10.76-4-raspberrypi4-ARCH #1 SMP Fri Nov 5 08:11:58 MSK 2021 armv7l GNU/Linux

Logs
OOPS 1

[  853.623484] ------------[ cut here ]------------
[  853.628118] kernel BUG at kernel/dma/mapping.c:208!
[  853.633006] Internal error: Oops - BUG: 0 [#1] SMP ARM
Entering kdb (current=0xc3823c00, pid 1113) on processor 0 Oops: (null)
due to oops @ 0xc02a4f2c
CPU: 0 PID: 1113 Comm: ILCS_HOST Tainted: G         C        5.10.76-4-raspberrypi4-ARCH #1
Hardware name: BCM2711
PC is at dma_unmap_sg_attrs+0x40/0x44
LR is at 0x0
pc : [<c02a4f2c>]    lr : [<00000000>]    psr: 20080013
sp : c48c9d64  ip : 00000080  fp : 00000000
r10: 000000fc  r9 : 00000000  r8 : 00000000
r7 : 00000000  r6 : 00000006  r5 : c1a530f4  r4 : f0e2d0c8
r3 : 10801080  r2 : 10801080  r1 : 10801080  r0 : c1e69a10
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 30c5383d  Table: 04139c00  DAC: fffffffd
CPU: 0 PID: 1113 Comm: ILCS_HOST Tainted: G         C        5.10.76-4-raspberrypi4-ARCH #1
Hardware name: BCM2711
[<c020f0d8>] (unwind_backtrace) from [<c020ae58>] (show_stack+0x10/0x14)
[<c020ae58>] (show_stack) from [<c0e08748>] (dump_stack+0xa4/0xc4)
[<c0e08748>] (dump_stack) from [<c0301eec>] (kdb_main_loop+0x4bc/0x9a0)
[<c0301eec>] (kdb_main_loop) from [<c0304fa0>] (kdb_stub+0x258/0x458)
[<c0304fa0>] (kdb_stub) from [<c02f9ff4>] (kgdb_cpu_enter+0x3e0/0x6fc)
more> ^M[<c02f9ff4>] (kgdb_cpu_enter) from [<c02fa9b4>] (kgdb_handle_exception+0xe0/0x13c)
more> ^M[<c02fa9b4>] (kgdb_handle_exception) from [<c020e794>] (kgdb_notify+0x28/0x48)
more> ^M[<c020e794>] (kgdb_notify) from [<c02503bc>] (notify_die+0x90/0xd0)
more> ^M[<c02503bc>] (notify_die) from [<c020af8c>] (die+0x130/0x34c)
more> ^M[<c020af8c>] (die) from [<c0200b94>] (__und_svc_finish+0x0/0x2c)
more> ^MException stack(0xc48c9cd0 to 0xc48c9d18)
more> ^M9cc0:                                     c1e69a10 10801080 10801080 10801080
more> ^M9ce0: f0e2d0c8 c1a530f4 00000006 00000000 00000000 00000000 000000fc 00000000
more> ^M9d00: 00000080 c48c9d64 00000000 c02a4f2c 20080013 ffffffff
more> ^M[<c0200b94>] (__und_svc_finish) from [<c02a4f2c>] (dma_unmap_sg_attrs+0x40/0x44)
more> ^M[<c02a4f2c>] (dma_unmap_sg_attrs) from [<c0c6509c>] (cleanup_pagelistinfo+0x98/0xb4)
more> ^M[<c0c6509c>] (cleanup_pagelistinfo) from [<c0c656c0>] (vchiq_prepare_bulk_data+0x190/0x6dc)
more> ^M[<c0c656c0>] (vchiq_prepare_bulk_data) from [<c0c5f0e4>] (vchiq_bulk_transfer+0x258/0x3e4)
more> ^M[<c0c5f0e4>] (vchiq_bulk_transfer) from [<c0c63530>] (vchiq_ioctl+0x724/0x17fc)
more> ^M[<c0c63530>] (vchiq_ioctl) from [<c044b198>] (sys_ioctl+0x34c/0x904)
more> ^M[<c044b198>] (sys_ioctl) from [<c0200040>] (ret_fast_syscall+0x0/0x4c)
more> ^MException stack(0xc48c9fa8 to 0xc48c9ff0)
more> ^M9fa0:                   b6b4b538 afefab1c 00000009 c014c406 afefab1c 000b900e
more> ^M9fc0: b6b4b538 afefab1c ac4ba020 00000036 00000000 3f155c40 ae504ce0 00000000
more> ^M9fe0: b6b4b240 afefab0c b6b38f44 b6c609fc
more> ^M
more> ^M[0]kdb>

OOPS 2

[  145.337313] ------------[ cut here ]------------
[  145.341993] kernel BUG at include/linux/scatterlist.h:95!
[  145.347427] Internal error: Oops - BUG: 0 [#1] SMP ARM
Entering kdb (current=0xc3c1da00, pid 755) on processor 0 Oops: (null)
due to oops @ 0xc0c65774
CPU: 0 PID: 755 Comm: ILCS_HOST Tainted: G         C        5.10.76-4-raspberrypi4-ARCH #1
Hardware name: BCM2711
PC is at vchiq_prepare_bulk_data+0x244/0x6dc
LR is at 0x0
pc : [<c0c65774>]    lr : [<00000000>]    psr: 00080013
sp : c4699d90  ip : 00000001  fp : c1934378
r10: 000006dc  r9 : 00000003  r8 : 00033700
r7 : f0e570e0  r6 : 00000035  r5 : f0e571b0  r4 : 00000035
r3 : 00001000  r2 : f0e571c8  r1 : 00000000  r0 : 3b713b9f
Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 30c5383d  Table: 03bb43c0  DAC: fffffffd
CPU: 0 PID: 755 Comm: ILCS_HOST Tainted: G         C        5.10.76-4-raspberrypi4-ARCH #1
Hardware name: BCM2711
[<c020f0d8>] (unwind_backtrace) from [<c020ae58>] (show_stack+0x10/0x14)
[<c020ae58>] (show_stack) from [<c0e08748>] (dump_stack+0xa4/0xc4)
[<c0e08748>] (dump_stack) from [<c0301eec>] (kdb_main_loop+0x4bc/0x9a0)
[<c0301eec>] (kdb_main_loop) from [<c0304fa0>] (kdb_stub+0x258/0x458)
[<c0304fa0>] (kdb_stub) from [<c02f9ff4>] (kgdb_cpu_enter+0x3e0/0x6fc)
more> ^M[<c02f9ff4>] (kgdb_cpu_enter) from [<c02fa9b4>] (kgdb_handle_exception+0xe0/0x13c)
more> ^M[<c02fa9b4>] (kgdb_handle_exception) from [<c020e794>] (kgdb_notify+0x28/0x48)
more> ^M[<c020e794>] (kgdb_notify) from [<c02503bc>] (notify_die+0x90/0xd0)
more> ^M[<c02503bc>] (notify_die) from [<c020af8c>] (die+0x130/0x34c)
more> ^M[<c020af8c>] (die) from [<c0200b94>] (__und_svc_finish+0x0/0x2c)
more> ^MException stack(0xc4699d00 to 0xc4699d48)
more> ^M9d00: 3b713b9f 00000000 f0e571c8 00001000 00000035 f0e571b0 00000035 f0e570e0
more> ^M9d20: 00033700 00000003 000006dc c1934378 00000001 c4699d90 00000000 c0c65774
more> ^M9d40: 00080013 ffffffff
more> ^M[<c0200b94>] (__und_svc_finish) from [<c0c65774>] (vchiq_prepare_bulk_data+0x244/0x6dc)
more> ^M[<c0c65774>] (vchiq_prepare_bulk_data) from [<c0c5f0e4>] (vchiq_bulk_transfer+0x258/0x3e4)
more> ^M[<c0c5f0e4>] (vchiq_bulk_transfer) from [<c0c63530>] (vchiq_ioctl+0x724/0x17fc)
more> ^M[<c0c63530>] (vchiq_ioctl) from [<c044b198>] (sys_ioctl+0x34c/0x904)
more> ^M[<c044b198>] (sys_ioctl) from [<c0200040>] (ret_fast_syscall+0x0/0x4c)
more> ^MException stack(0xc4699fa8 to 0xc4699ff0)
more> ^M9fa0:                   b6b4c538 afefab1c 00000009 c014c406 afefab1c 0002a00e
more> ^M9fc0: b6b4c538 afefab1c ad2ff020 00000036 00000000 3f155be0 ae504c70 00000000
more> ^M9fe0: b6b4c240 afefab0c b6b39f44 b6c619fc
more> ^M
more> ^M[0]kdb>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions