Page MenuHomeFreeBSD

Fix BeagleBone Black panic on system start
ClosedPublic

Authored by kjopek_gmail.com on Apr 27 2023, 9:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Feb 1, 10:57 PM
Unknown Object (File)
Jan 10 2024, 1:40 AM
Unknown Object (File)
Dec 20 2023, 7:54 AM
Unknown Object (File)
Dec 13 2023, 6:19 AM
Unknown Object (File)
Oct 5 2023, 2:08 PM
Unknown Object (File)
Sep 29 2023, 2:09 PM
Unknown Object (File)
Sep 27 2023, 2:06 PM
Unknown Object (File)
Sep 26 2023, 5:02 AM

Details

Summary

There is now assertion which requires all memory allocations of positive size.
Negative and zero-sized allocations lead to panic, so plug them off.

Test Plan

Tested on my BBB.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Apr 27 2023, 5:54 PM

When used with latest DTB we still face panic, however related to event timer:

gpioled0: <GPIO LEDs> on ofwbus0
gpioled0: <beaglebone:green:heartbeat> failed to map pin
gpioled0: <beaglebone:green:mmc0> failed to map pin
gpioled0: <beaglebone:green:usr2> failed to map pin
gpioled0: <beaglebone:green:usr3> failed to map pin
panic: No usable event timer found!
cpuid = 0
time = 1
KDB: stack backtrace:
db_trace_self() at db_trace_self
         pc = 0xc05f124c  lr = 0xc007aa34 (db_trace_self_wrapper+0x30)
         sp = 0xc0f14cb8  fp = 0xc0f14dd0
db_trace_self_wrapper() at db_trace_self_wrapper+0x30
         pc = 0xc007aa34  lr = 0xc02ec554 (vpanic+0x140)
         sp = 0xc0f14dd8  fp = 0xc0f14df8
         r4 = 0x00000100  r5 = 0x00000000
         r6 = 0xc07dae31  r7 = 0xc0b22ea8
vpanic() at vpanic+0x140
         pc = 0xc02ec554  lr = 0xc02ec334 (doadump)
         sp = 0xc0f14e00  fp = 0xc0f14e04
         r4 = 0xc0b12f54  r5 = 0x00000001
         r6 = 0xc0b12f78  r7 = 0xc098e808
         r8 = 0x7fffffff  r9 = 0xffffffff
        r10 = 0xc0f05008
doadump() at doadump
         pc = 0xc02ec334  lr = 0xc027a368 (cpu_initclocks_bsp+0x8e8)
         sp = 0xc0f14e0c  fp = 0xc0f14e50
         r4 = 0xc0f05008  r5 = 0xc0f14e04
         r6 = 0xc02ec334 r10 = 0xc0f14e0c
cpu_initclocks_bsp() at cpu_initclocks_bsp+0x8e8
         pc = 0xc027a368  lr = 0xc0279210 (initclocks+0x2c)
         sp = 0xc0f14e58  fp = 0xc0f14e58
         r4 = 0xc0b12558  r5 = 0x0fffffff
         r6 = 0xc278c450  r7 = 0xc08e605c
         r8 = 0x00000000  r9 = 0x04000000
        r10 = 0xc0b12554
initclocks() at initclocks+0x2c
         pc = 0xc0279210  lr = 0xc0274b50 (mi_startup+0x2b0)
         sp = 0xc0f14e60  fp = 0xc0f14e88
mi_startup() at mi_startup+0x2b0
         pc = 0xc0274b50  lr = 0xc0000344 (btext+0x144)
         sp = 0xc0f14e90  fp = 0x00000000
         r4 = 0xc0000480  r5 = 0xc0bd0000
         r6 = 0x0000000a  r7 = 0x00c52078
         r8 = 0xc0e52000  r9 = 0x9cf03dd8
        r10 = 0x00000000
btext() at btext+0x144
         pc = 0xc0000344  lr = 0xc0000344 (btext+0x144)
         sp = 0xc0f14e90  fp = 0x00000000
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at      kdb_enter+0x54: ldrb    r15, [r15, r15, ror r15]!
db>

bummed to know there's still a panic in booting (I have issues like this when I updated my pandaboard too).
However, other panics shouldn't stop us from fixing this one.
TI DTS/FDT has always been a tough gig to follow, since it moves so fast (eg at all, it's not supposed to in theory), so I wish you luck and offer encouragement.

This revision was automatically updated to reflect the committed changes.