I have encountered a totally repeatable kernel panic by running "gpioctl list” 
on an odroid-c1 board.

# name -a
NetBSD armv7 9.99.96 NetBSD 9.99.96 (GENERIC) #0: Mon May  2 10:50:02 UTC 2022  
mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/evbarm/compile/GENERIC evbarm

To investigate, I added some printf() to the gpiolist() function to see what 
was happening in the loop through the pins.  Here is a bit of the output:

# ./gpioctl2 gpio0 list
gpioctl.c::gpiolist()
gpioctl.c::gpiolist(): gpio_npins=71
gpioctl.c::gpiolist(): gpio_pin 0
  0: gp_pin=0
  0: gp_value=1
  0: gp_name=GPIOX_0
gpioctl.c::gpiolist(): gpio_pin 1
  1: gp_pin=1
  1: gp_value=1
  1: gp_name=GPIOX_1

… < lots of pin output deleted > …

gpioctl.c::gpiolist(): gpio_pin 29
  29: gp_pin=29
  29: gp_value=1
  29: gp_name=GPIOY_14
gpioctl.c::gpiolist(): gpio_pin 30
[  33.9588550] panic: divide by 0
[  33.9588550] cpu0: Begin traceback...
[  33.9588550] 0xbd7cdbd4: netbsd:db_panic+0x14
[  33.9677710] 0xbd7cdbf4: netbsd:vpanic+0x114
[  33.9677710] 0xbd7cdc0c: netbsd:panic+0x24
[  33.9761750] 0xbd7cdc2c: netbsd:__aeabi_idiv0+0x18
[  33.9822960] 0xbd7cdc4c: netbsd:meson_pinctrl_pin_read+0x88
[  33.9822960] 0xbd7cdcec: netbsd:gpioioctl+0x4f4
[  33.9902860] 0xbd7cdd24: netbsd:spec_ioctl+0x60
[  33.9902860] 0xbd7cdd54: netbsd:VOP_IOCTL+0x50
[  33.9991180] 0xbd7cde24: netbsd:vn_ioctl+0xd8
[  34.0057320] 0xbd7cdeec: netbsd:sys_ioctl+0x47c
[  34.0057320] 0xbd7cdfac: netbsd:syscall+0x188
[  34.0135450] cpu0: End traceback...
Stopped in pid 214.214 (gpioctl2) at    netbsd:cpu_Debugger+0x4:        bx      
r14
db{0}>

I’m guessing this is a device tree problem, given the reference to 
meson_pinctl_pin_read(), but I have no idea how the kernel data structure is 
created or what to do about this.

For reference, u-boot loads the following device tree before booting the 
kernel: meson8b-odroidc1.dtb.

Any thoughts would be greatly appreciated.

Thanks a lot.

Cheers,
Brook

Reply via email to