This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4376: Errors at some Linux kernel settings

Part Number: AM4376

Hi,

we use AM4376 for our CPUs.

Currently we use Linux 5.10:

Linux PM5072-T-2ETH 5.10.47-rt45-5.10.47 #1 PREEMPT_RT Mon Dec 13 10:48:22 UTC 2021 armv7l GNU/Linux

Normally CPU works properly. But if we activate following kernel settings, we get many errors at boot:

CONFIG_SLUB_DEBUG_ON=y

CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y

CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_LOCKDEP=y

CONFIG_DEBUG_ATOMIC_SLEEP=y

CONFIG_TRACE_IRQFLAGS=y

CONFIG_PROVE_RCU=y
# CONFIG_PROVE_RCU_REPEATEDLY is not set

Here some log messages (dmesg):

[   12.459019] BUG: sleeping function called from invalid context at /usr/src/kernel/kernel/locking/rtmutex.c:969
[   12.459045] in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 44, name: kworker/u2:2
[   12.459060] 5 locks held by kworker/u2:2/44:
[   12.459068]  #0: c1815ab8 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x21c/0x7f0
[   12.459131]  #1: c2a3bef4 ((work_completion)(&entry->work)){+.+.}-{0:0}, at: process_one_work+0x21c/0x7f0
[   12.459164]  #2: c2deccf8 (&dev->mutex){....}-{0:0}, at: __device_driver_lock+0x38/0x48
[   12.459214]  #3: c2de90a4 (&bank->lock){....}-{2:2}, at: omap_gpio_set_config+0x78/0x1dc
[   12.459257]  #4: c0a44368 (enable_lock){+.+.}-{2:2}, at: clk_enable_lock+0x40/0xfc
[   12.459292] irq event stamp: 696
[   12.459298] hardirqs last  enabled at (695): [<c06ade2c>] _raw_spin_unlock_irqrestore+0x80/0x84
[   12.459327] hardirqs last disabled at (696): [<c06ada98>] _raw_spin_lock_irqsave+0x34/0x70
[   12.459343] softirqs last  enabled at (0): [<c0033960>] copy_process+0x53c/0x1b90
[   12.459360] softirqs last disabled at (0): [<00000000>] 0x0
[   12.459373] Preemption disabled at:
[   12.459378] [<c03f047c>] omap_gpio_set_config+0x78/0x1dc
[   12.459396] CPU: 0 PID: 44 Comm: kworker/u2:2 Not tainted 5.10.47-rt45-5.10.47 #1
[   12.459413] Hardware name: Generic AM43 (Flattened Device Tree)
[   12.459425] Workqueue: events_unbound async_run_entry_fn
[   12.459456] Backtrace: 
[   12.459465] [<c0015088>] (dump_backtrace) from [<c00153b8>] (show_stack+0x20/0x24)
[   12.459499]  r7:c2a3a000 r6:c03f047c r5:c2a3a000 r4:c0893730
[   12.459505] [<c0015398>] (show_stack) from [<c06a2d0c>] (dump_stack+0x2c/0x30)
[   12.459536] [<c06a2ce0>] (dump_stack) from [<c00674d0>] (___might_sleep+0x1d4/0x270)
[   12.459567]  r5:c2a3a000 r4:00000000
[   12.459572] [<c00672fc>] (___might_sleep) from [<c06ade88>] (rt_spin_lock+0x58/0xfc)
[   12.459596]  r7:00008000 r6:00000001 r5:c0a4431c r4:00000000
[   12.459601] [<c06ade30>] (rt_spin_lock) from [<c03f5cb0>] (clk_enable_lock+0x40/0xfc)
[   12.459627]  r6:00030d40 r5:000000ff r4:c10c07b0
[   12.459631] [<c03f5c70>] (clk_enable_lock) from [<c03f6cc8>] (clk_core_enable_lock+0x1c/0x34)
[   12.459657]  r5:000000ff r4:c1b7fc80
[   12.459662] [<c03f6cac>] (clk_core_enable_lock) from [<c03f6d04>] (clk_enable+0x24/0x28)
[   12.459685]  r5:000000ff r4:c2de9040
[   12.459690] [<c03f6ce0>] (clk_enable) from [<c03f04d0>] (omap_gpio_set_config+0xcc/0x1dc)
[   12.459712] [<c03f0404>] (omap_gpio_set_config) from [<c03e3670>] (gpiod_set_config+0x60/0x74)
[   12.459755]  r9:c2d64680 r8:00000000 r7:c3897ec0 r6:00030d40 r5:030d400b r4:0000004b
[   12.459760] [<c03e3610>] (gpiod_set_config) from [<c03e36a4>] (gpiod_set_debounce+0x20/0x24)
[   12.459787]  r5:c2dee52c r4:c388c000
[   12.459791] [<c03e3684>] (gpiod_set_debounce) from [<c04e6e50>] (mmc_gpiod_request_cd+0x6c/0xb4)
[   12.459827] [<c04e6de4>] (mmc_gpiod_request_cd) from [<c04db270>] (mmc_of_parse+0x594/0x63c)
[   12.459871]  r9:c2d64680 r8:c388c000 r7:c2decc10 r6:c2decc00 r5:c2decc10 r4:c388c000
[   12.459876] [<c04dacdc>] (mmc_of_parse) from [<c04f4e40>] (sdhci_omap_probe+0xc4/0x648)
[   12.459914]  r6:c2decc00 r5:481d8200 r4:c388c640
[   12.459919] [<c04f4d7c>] (sdhci_omap_probe) from [<c045a530>] (platform_drv_probe+0x58/0xa8)
[   12.459952]  r10:00000000 r9:00000000 r8:c0a5ae24 r7:00000000 r6:c0a5ae24 r5:00000000
[   12.459961]  r4:c2decc10 r3:c04f4d7c
[   12.459965] [<c045a4d8>] (platform_drv_probe) from [<c04583b4>] (really_probe+0x100/0x3c4)
[   12.459997]  r7:00000000 r6:c10c2034 r5:c10c202c r4:c2decc10
[   12.460002] [<c04582b4>] (really_probe) from [<c0458864>] (driver_probe_device+0x6c/0xc4)
[   12.460036]  r10:00000001 r9:c0a6e0e9 r8:c0a6f080 r7:c1a06100 r6:c3894680 r5:c0a5ae24
[   12.460043]  r4:c2decc10 r3:00000000
[   12.460047] [<c04587f8>] (driver_probe_device) from [<c045891c>] (__driver_attach_async_helper+0x60/0x64)
[   12.460073]  r5:c0a78018 r4:c2decc10
[   12.460078] [<c04588bc>] (__driver_attach_async_helper) from [<c0062e84>] (async_run_entry_fn+0x54/0x110)
[   12.460105]  r5:c0a78018 r4:c3894690
[   12.460109] [<c0062e30>] (async_run_entry_fn) from [<c00568e4>] (process_one_work+0x2f4/0x7f0)
[   12.460137]  r7:c1a06100 r6:c1a08400 r5:c29cd680 r4:c3894690
[   12.460143] [<c00565f0>] (process_one_work) from [<c0056e3c>] (worker_thread+0x5c/0x5d0)
[   12.460169]  r10:c09f5c80 r9:00000088 r8:ffffe000 r7:c1a08438 r6:c29cd694 r5:c1a08400
[   12.460176]  r4:c29cd680
[   12.460180] [<c0056de0>] (worker_thread) from [<c005dcb8>] (kthread+0x1c8/0x1f0)
[   12.460218]  r10:c2a37e70 r9:c29cd680 r8:c0056de0 r7:00000000 r6:c29b0a40 r5:c2a3a000
[   12.460225]  r4:c29cda80
[   12.460229] [<c005daf0>] (kthread) from [<c0008320>] (ret_from_fork+0x14/0x34)
[   12.460254] Exception stack(0xc2a3bfb0 to 0xc2a3bff8)
[   12.460267] bfa0:                                     00000000 00000000 00000000 00000000
[   12.460280] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   12.460291] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   12.460304]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c005daf0
[   12.460311]  r4:c29b0a40

Best Regards
Walter.