> Synopsis: imxspi causes a kernel panic during boot on novena (armv7)
> Category: kernel arm
> Environment:
System : OpenBSD 6.9
Details : OpenBSD 6.9 (GENERIC) #386: Tue Apr 20 04:06:48 MDT 2021
[email protected]:/usr/src/sys/arch/armv7/compile/GENERIC
Architecture: OpenBSD.armv7
Machine : armv
> Description:
On the Novena bsd.rd boots and the install is successful but bsd fails to boot
due to a panic caused by imxpsi.
(Note: To be able to boot I had to create u-boot-dtb.img from stock u-boot
source.
The SPL in the dtb pkg looks for u-boot-dtb.img, not u-boot.img which is
supplied in the u-boot pkg, and fails to load load u-boot shell.)
U-Boot SPL 2021.07 (Aug 27 2021 - 11:49:15 +1200)
Trying to boot from MMC1
U-Boot 2021.07 (Aug 27 2021 - 11:49:15 +1200)
CPU: Freescale i.MX6Q rev1.2 1200 MHz (running at 792 MHz)
CPU: Extended Commercial temperature grade (-20C to 105C) at 61C
Reset cause: WDOG
Model: Kosagi Novena Dual/Quad
Board: Novena 4x
I2C: ready
DRAM: 3.8 GiB
PMIC: PFUZE100 ID=0x10
MMC: FSL_SDHC: 1, FSL_SDHC: 0
Loading Environment from MMC... OK
auto-detected panel Chimei-FHD
Display: Chimei-FHD (1920x1080)
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@2188000
Hit any key to stop autoboot: 0
AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part
SATA Device Info:
S/N: 50026B724508FDBD
Product model number: KINGSTON SHFS37A240G
Firmware version: 560ABBF0
Capacity: 468862128 sectors
Device 0: Model: KINGSTON SHFS37A240G Firm: 560ABBF0 Ser#: 50026B724508FDBD
Type: Hard Disk
Supports 48-bit addressing
Capacity: 228936.5 MB = 223.5 GB (468862128 x 512)
... is now current device
Scanning sata 0:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
7[r[999;999H[6n8MMC: no card present
Scanning disk [email protected]...
Disk [email protected] not ready
Scanning disk [email protected]...
** Unrecognized filesystem type **
Scanning disk [email protected]...
** Unrecognized filesystem type **
Found 6 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/bootarm.efi
106528 bytes read in 9 ms (11.3 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Booting /efi\boot\bootarm.efi
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.17
boot>
booting sd0a:/bsd: 4829128+710068+338508+591780 [271778+120+334928+297575]=0x0
OpenBSD/armv7 booting ...
arg0 0xc0a09128 arg1 0x0 arg2 0x17ef2000
Allocating page tables
IRQ stack: p0x10a38000 v0xc0a38000
ABT stack: p0x10a39000 v0xc0a39000
UND stack: p0x10a3a000 v0xc0a3a000
SVC stack: p0x10a3b000 v0xc0a3b000
Creating L1 page table at 0x10a0c000
Mapping kernel
Constructing L2 page tables
undefined page type 0x2 pa 0x10000000 va 0x10000000 pages 0x2000 attr 0x8
type 0x7 pa 0x12000000 va 0x12000000 pages 0x5ef2 attr 0x8
type 0x9 pa 0x17ef2000 va 0x17ef2000 pages 0x1c attr 0x8
type 0x7 pa 0x17f0e000 va 0x17f0e000 pages 0xe186c attr 0x8
type 0x2 pa 0xf977a000 va 0xf977a000 pages 0x6c7 attr 0x8
type 0x4 pa 0xf9e41000 va 0xf9e41000 pages 0x1 attr 0x8
type 0x2 pa 0xf9e42000 va 0xf9e42000 pages 0x6 attr 0x8
type 0x7 pa 0xf9e48000 va 0xf9e48000 pages 0x1 attr 0x8
type 0x2 pa 0xf9e49000 va 0xf9e49000 pages 0x100 attr 0x8
type 0x1 pa 0xf9f49000 va 0xf9f49000 pages 0x1b attr 0x8
type 0x0 pa 0xf9f64000 va 0xf9f64000 pages 0x7 attr 0x8
type 0x4 pa 0xf9f6b000 va 0xf9f6b000 pages 0x1 attr 0x8
type 0x6 pa 0xf9f6c000 va 0xf9f6c000 pages 0x1 attr 0x8000000000000008
type 0x4 pa 0xf9f6d000 va 0xf9f6d000 pages 0x2 attr 0x8
type 0x0 pa 0xf9f6f000 va 0xf9f6f000 pages 0x1 attr 0x8
type 0x6 pa 0xf9f70000 va 0xf9f70000 pages 0x3 attr 0x8000000000000008
type 0x4 pa 0xf9f73000 va 0xf9f73000 pages 0x1 attr 0x8
type 0x6 pa 0xf9f74000 va 0xf9f74000 pages 0x4 attr 0x8000000000000008
type 0x0 pa 0xf9f78000 va 0xf9f78000 pages 0x1 attr 0x8
type 0x4 pa 0xf9f79000 va 0xf9f79000 pages 0x1 attr 0x8
type 0x0 pa 0xf9f7a000 va 0xf9f7a000 pages 0x1 attr 0x8
type 0x4 pa 0xf9f7b000 va 0xf9f7b000 pages 0x2 attr 0x8
type 0x0 pa 0xf9f7d000 va 0xf9f7d000 pages 0x2 attr 0x8
type 0x4 pa 0xf9f7f000 va 0xf9f7f000 pages 0x1 attr 0x8
type 0x0 pa 0xf9f80000 va 0xf9f80000 pages 0x1 attr 0x8
type 0x4 pa 0xf9f81000 va 0xf9f81000 pages 0x2 attr 0x8
type 0x0 pa 0xf9f83000 va 0xf9f83000 pages 0x1 attr 0x8
type 0x4 pa 0xf9f84000 va 0xf9f84000 pages 0x2 attr 0x8
type 0x2 pa 0xf9f86000 va 0xf9f86000 pages 0x500b attr 0x8
type 0x5 pa 0xfef91000 va 0xfef91000 pages 0x1 attr 0x8000000000000008
type 0x2 pa 0xfef92000 va 0xfef92000 pages 0x106e attr 0x8
pmap [ using 905016 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2021 OpenBSD. All rights reserved. https://www.OpenBSD.org
OpenBSD 6.9 (GENERIC) #386: Tue Apr 20 04:06:48 MDT 2021
[email protected]:/usr/src/sys/arch/armv7/compile/GENERIC
real mem = 3916816384 (3735MB)
avail mem = 3830837248 (3653MB)
random: good seed from bootblocks
mainbus0 at root: Kosagi Novena Dual/Quad
cpu0 at mainbus0 mpidr 0: ARM Cortex-A9 r2p10
cpu0: 32KB 32b/line 4-way L1 VIPT I-cache, 32KB 32b/line 4-way L1 D-cache
cortex0 at mainbus0
amptimer0 at cortex0: 396000 kHz
armliicc0 at cortex0: rtl 7 waymask: 0x0000000f
imxtemp0 at mainbus0simplebus0 at mainbus0: "soc"
ampintc0 at simplebus0 nirq 160, ncpu 4: "interrupt-controller"
"dma-apbh" at simplebus0 not configured
"hdmi" at simplebus0 not configured
"gpu" at simplebus0 not configured
"gpu" at simplebus0 not configured
"timer" at simplebus0 not configured
"l2-cache" at simplebus0 not configured
"pcie" at simplebus0 not configured
simplebus1 at simplebus0: "aips-bus"
imxccm0 at simplebus1
imxanatop0 at simplebus1
syscon0 at simplebus1: "snvs"
imxrtc0 at syscon0
"snvs-lpgpr" at syscon0 not configured
imxsrc0 at simplebus1
syscon1 at simplebus1: "iomuxc-gpr"
"mux-controller" at syscon1 not configured
"ipu1_csi0_mux" at syscon1 not configured
"ipu2_csi1_mux" at syscon1 not configured
imxiomuxc0 at simplebus1
simplebus2 at simplebus1: "spba-bus"
imxspi0 at simplebus2
"ssi" at simplebus2 not configured
"asrc" at simplebus2 not configured
"vpu" at simplebus1 not configured
"pwm" at simplebus1 not configured
"gpt" at simplebus1 not configured
imxgpio0 at simplebus1
imxgpio1 at simplebus1
imxgpio2 at simplebus1
imxgpio3 at simplebus1
imxgpio4 at simplebus1
imxgpio5 at simplebus1
imxgpio6 at simplebus1
"kpp" at simplebus1 not configured
imxdog0 at simplebus1
"usbphy" at simplebus1 not configured
"usbphy" at simplebus1 not configured
imxgpc0 at simplebus1
"sdma" at simplebus1 not configured
simplebus3 at simplebus0: "aips-bus"
syscon2 at simplebus3: "ocotp"
"caam" at simplebus3 not configured
imxehci0 at simplebus3
usb0 at imxehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "i.MX EHCI root hub" rev 2.00/1.00
addr 1
imxehci1 at simplebus3
usb1 at imxehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "i.MX EHCI root hub" rev 2.00/1.00
addr 1
"usbmisc" at simplebus3 not configured
fec0 at simplebus3
fec0: address 00:1f:11:02:17:ff
ukphy0 at fec0 phy 7: Generic IEEE 802.3u media interface, rev. 1: OUI
0x000885, model 0x0021
imxesdhc0 at simplebus3
imxesdhc0: 198 MHz base clock
sdmmc0 at imxesdhc0: 4-bit, sd high-speed, mmc high-speed, dma
imxesdhc1 at simplebus3
imxesdhc1: 198 MHz base clock
sdmmc1 at imxesdhc1: 4-bit, sd high-speed, mmc high-speed, dma
imxiic0 at simplebus3
iic0 at imxiic0
"fsl,mma8452" at iic0 addr 0x1c not configured
pcfrtc0 at iic0 addr 0x68: battery low
"sbs,sbs-battery" at iic0 addr 0xb not configured
"st,stmpe811" at iic0 addr 0x44 not configured
imxiic1 at simplebus3
iic1 at imxiic1
"fsl,pfuze100" at iic1 addr 0x8 not configured
imxiic2 at simplebus3
iic2 at imxiic2
"everest,es8328" at iic2 addr 0x11 not configured
"mmdc" at simplebus3 not configured
"audmux" at simplebus3 not configured
"vdoa" at simplebus3 not configured
imxuart0 at simplebus3: console
imxuart1 at simplebus3
imxuart2 at simplebus3
"ipu" at simplebus0 not configured
"sram" at simplebus0 not configured
imxahci0 at simplebus0: AHCI 1.3
imxahci0: port 0: 3.0Gb/s
scsibus0 at imxahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, KINGSTON SHFS37A, 560A> naa.50026b724508fdbd
sd0: 228936MB, 512 bytes/sector, 468862128 sectors, thin
"gpu" at simplebus0 not configured
"ipu" at simplebus0 not configured
scsibus1 at sdmmc1: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <SD/MMC, N/A, 0010> removable
sd1: 3840MB, 512 bytes/sector, 7864320 sectors
uhub2 at uhub1 port 1 configuration 1 interface 0 "Genesys Logic USB2.0 Hub
Charger" rev 2.00/1.97 addr 2
axe0 at uhub2 port 2 configuration 1 interface 0 "ASIX Electronics AX88772B"
rev 2.00/0.01 addr 3
axe0: AX88772B, address 00:0e:c6:87:72:01
ukphy1 at axe0 phy 16: Generic IEEE 802.3u media interface, rev. 1: OUI
0x000ec6, model 0x0008
uhub3 at uhub2 port 4 configuration 1 interface 0 "Genesys Logic USB2.0 Hub
Charger" rev 2.00/1.97 addr 4
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root on sd0a (773fb1fe7b96327a.a) swap on sd0b dump on sd0b
imxccm_enable: 0x00000072
panic: malloc: allocation too large, type = 2, size = 4294967295
Stopped at db_enter: ldrb r15, [r15, r15, ror r15]!
TID PID UID PRFLAGS PFLAGS CPU COMMAND
* 0 0 0 0x10000 0x200 0 swapper
db_enter
rlv=0xc06b807c rfp=0xc0a3cfa0
malloc+0x6c4
rlv=0xc03f7af0 rfp=0xc0a3cfb8
imxspi_attachhook+0x50
rlv=0xc06c4ec0 rfp=0xc0a3cfd0
config_process_deferred_mountroot+0x50
rlv=0xc034d8a4 rfp=0xc0a3cfe8
main+0x65c
rlv=0xc05e23d8 rfp=0xc0a3cffc
start+0x58
rlv=0xedfe0dd0 rfp=0xc05e23d4
Bad frame pointer: 0xc05e23d4
https://www.openbsd.org/ddb.html describes the minimum info required in bug
reports. Insufficient info makes it difficult to find and fix bugs.
ddb> show panic
malloc: allocation too large, type = 2, size = 4294967295
ddb> trace
db_enter
rlv=0xc06b807c rfp=0xc0a3cfa0
malloc+0x6c4
rlv=0xc03f7af0 rfp=0xc0a3cfb8
imxspi_attachhook+0x50
rlv=0xc06c4ec0 rfp=0xc0a3cfd0
config_process_deferred_mountroot+0x50
rlv=0xc034d8a4 rfp=0xc0a3cfe8
main+0x65c
rlv=0xc05e23d8 rfp=0xc0a3cffc
start+0x58
rlv=0xedfe0dd0 rfp=0xc05e23d4
Bad frame pointer: 0xc05e23d4
ddb> ps
PID TID PPID UID S FLAGS WAIT COMMAND
47419 442906 0 0 2 0x14200 smr
83374 115049 0 0 2 0x14200 zerothread
42607 322555 0 0 2 0x14200 aiodoned
69440 161915 0 0 2 0x14200 update
45554 446402 0 0 2 0x14200 cleaner
81733 319702 0 0 2 0x14200 reaper
11970 146894 0 0 2 0x14200 pagedaemon
13420 430423 0 0 3 0x14200 bored crynlk
24200 214981 0 0 3 0x14200 bored crypto
45643 101375 0 0 3 0x14200 mmctsk sdmmc1
34906 141773 0 0 3 0x14200 mmctsk sdmmc0
27627 282393 0 0 3 0x14200 usbtsk usbtask
82788 513186 0 0 3 0x14200 usbatsk usbatsk
24386 15315 0 0 3 0x14200 bored softnet
32887 447835 0 0 3 0x14200 bored systqmp
99583 407642 0 0 3 0x14200 bored systq
38134 225354 0 0 3 0x40014200 bored softclock
42938 334069 0 0 3 0x40014200 idle0
42432 378775 0 0 3 0x14200 kmalloc kmthread
1 465701 0 0 3 0 initexec swapper
* 0 0 -1 0 7 0x10200 swapper
ddb>
> How-To-Repeat:
Install 6.9 on the Novena and reboot.
> Fix:
Disable imxspi in the kernel.
dmesg:
OpenBSD 6.9 (GENERIC) #386: Tue Apr 20 04:06:48 MDT 2021
[email protected]:/usr/src/sys/arch/armv7/compile/GENERIC
real mem = 3916849152 (3735MB)
avail mem = 3830870016 (3653MB)
random: boothowto does not indicate good seed
mainbus0 at root: Kosagi Novena Dual/Quad
cpu0 at mainbus0 mpidr 0: ARM Cortex-A9 r2p10
cpu0: 32KB 32b/line 4-way L1 VIPT I-cache, 32KB 32b/line 4-way L1 D-cache
cortex0 at mainbus0
amptimer0 at cortex0: 396000 kHz
armliicc0 at cortex0: rtl 7 waymask: 0x0000000f
imxtemp0 at mainbus0simplebus0 at mainbus0: "soc"
ampintc0 at simplebus0 nirq 160, ncpu 4: "interrupt-controller"
"dma-apbh" at simplebus0 not configured
"hdmi" at simplebus0 not configured
"gpu" at simplebus0 not configured
"gpu" at simplebus0 not configured
"timer" at simplebus0 not configured
"l2-cache" at simplebus0 not configured
"pcie" at simplebus0 not configured
simplebus1 at simplebus0: "aips-bus"
imxccm0 at simplebus1
imxanatop0 at simplebus1
syscon0 at simplebus1: "snvs"
imxrtc0 at syscon0
"snvs-lpgpr" at syscon0 not configured
imxsrc0 at simplebus1
syscon1 at simplebus1: "iomuxc-gpr"
"mux-controller" at syscon1 not configured
"ipu1_csi0_mux" at syscon1 not configured
"ipu2_csi1_mux" at syscon1 not configured
imxiomuxc0 at simplebus1
simplebus2 at simplebus1: "spba-bus"
"spi" at simplebus2 not configured
"ssi" at simplebus2 not configured
"asrc" at simplebus2 not configured
"vpu" at simplebus1 not configured
"pwm" at simplebus1 not configured
"gpt" at simplebus1 not configured
imxgpio0 at simplebus1
imxgpio1 at simplebus1
imxgpio2 at simplebus1
imxgpio3 at simplebus1
imxgpio4 at simplebus1
imxgpio5 at simplebus1
imxgpio6 at simplebus1
"kpp" at simplebus1 not configured
imxdog0 at simplebus1
"usbphy" at simplebus1 not configured
"usbphy" at simplebus1 not configured
imxgpc0 at simplebus1
"sdma" at simplebus1 not configured
simplebus3 at simplebus0: "aips-bus"
syscon2 at simplebus3: "ocotp"
"caam" at simplebus3 not configured
imxehci0 at simplebus3
usb0 at imxehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "i.MX EHCI root hub" rev 2.00/1.00
addr 1
imxehci1 at simplebus3
usb1 at imxehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "i.MX EHCI root hub" rev 2.00/1.00
addr 1
"usbmisc" at simplebus3 not configured
fec0 at simplebus3
fec0: address 00:1f:11:02:17:ff
ukphy0 at fec0 phy 7: Generic IEEE 802.3u media interface, rev. 1: OUI
0x000885, model 0x0021
imxesdhc0 at simplebus3
imxesdhc0: 198 MHz base clock
sdmmc0 at imxesdhc0: 4-bit, sd high-speed, mmc high-speed, dma
imxesdhc1 at simplebus3
imxesdhc1: 198 MHz base clock
sdmmc1 at imxesdhc1: 4-bit, sd high-speed, mmc high-speed, dma
imxiic0 at simplebus3
iic0 at imxiic0
"fsl,mma8452" at iic0 addr 0x1c not configured
pcfrtc0 at iic0 addr 0x68: battery low
"sbs,sbs-battery" at iic0 addr 0xb not configured
"st,stmpe811" at iic0 addr 0x44 not configured
imxiic1 at simplebus3
iic1 at imxiic1
"fsl,pfuze100" at iic1 addr 0x8 not configured
imxiic2 at simplebus3
iic2 at imxiic2
"everest,es8328" at iic2 addr 0x11 not configured
"mmdc" at simplebus3 not configured
"audmux" at simplebus3 not configured
"vdoa" at simplebus3 not configured
imxuart0 at simplebus3: console
imxuart1 at simplebus3
imxuart2 at simplebus3
"ipu" at simplebus0 not configured
"sram" at simplebus0 not configured
imxahci0 at simplebus0: AHCI 1.3
imxahci0: port 0: 3.0Gb/s
scsibus0 at imxahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, KINGSTON SHFS37A, 560A> naa.50026b724508fdbd
sd0: 228936MB, 512 bytes/sector, 468862128 sectors, thin
"gpu" at simplebus0 not configured
"ipu" at simplebus0 not configured
scsibus1 at sdmmc1: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <SD/MMC, N/A, 0010> removable
sd1: 3840MB, 512 bytes/sector, 7864320 sectors
uhub2 at uhub1 port 1 configuration 1 interface 0 "Genesys Logic USB2.0 Hub
Charger" rev 2.00/1.97 addr 2
axe0 at uhub2 port 2 configuration 1 interface 0 "ASIX Electronics AX88772B"
rev 2.00/0.01 addr 3
axe0: AX88772B, address 00:0e:c6:87:72:01
ukphy1 at axe0 phy 16: Generic IEEE 802.3u media interface, rev. 1: OUI
0x000ec6, model 0x0008
uhub3 at uhub2 port 4 configuration 1 interface 0 "Genesys Logic USB2.0 Hub
Charger" rev 2.00/1.97 addr 4
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root on sd0a (773fb1fe7b96327a.a) swap on sd0b dump on sd0b
usbdevs:
Controller /dev/usb0:
addr 01: 0000:0000 i.MX, EHCI root hub
high speed, self powered, config 1, rev 1.00
driver: uhub0
Controller /dev/usb1:
addr 01: 0000:0000 i.MX, EHCI root hub
high speed, self powered, config 1, rev 1.00
driver: uhub1
addr 02: 05e3:0614 Genesys Logic, USB2.0 Hub Charger
high speed, self powered, config 1, rev 1.97
driver: uhub2
addr 03: 0b95:772b ASIX Electronics, AX88772B
high speed, self powered, config 1, rev 0.01
driver: axe0
addr 04: 05e3:0614 Genesys Logic, USB2.0 Hub Charger
high speed, self powered, config 1, rev 1.97
driver: uhub3
pcidump:
acpidump: