NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/56438: panic when trying to use gpioiic in -current 9.99.90

>Number:         56438
>Category:       kern
>Synopsis:       panic when trying to use gpioiic in -current 9.99.90
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 03 22:55:00 +0000 2021
>Release:        NetBSD-current 9.99.90
RPI 3 evbarm6hf
Architecture: evbarm
Machine: evbarm6hf

I have been using gpioiic for many releases of NetBSD on various types
of RPI devices.  I attempted to use it on -current pulled from source
2021-09-26 or so and a panic can be produced when /etc/rc.d/gpio runs.

From a boot:

Creating a.out runtime link editor directory cache.
Checking quotas: done.
Configuring GPIO.
[  13.2358565] panic: kernel diagnostic assertion "KERNEL_LOCKED_P()" failed: file "../../../../kern/subr_autoconf.c", line 1053
[  13.2487462] cpu0: Begin traceback...
[  13.2487462] 0xd1cf1b5c: netbsd:db_panic+0x14
[  13.2562360] 0xd1cf1b74: netbsd:vpanic+0x148
[  13.2562360] 0xd1cf1b8c: netbsd:__aeabi_uldivmod
[  13.2562360] 0xd1cf1bc4: netbsd:config_match+0x88
[  13.2680444] 0xd1cf1be4: netbsd:mapply+0x4c
[  13.2680444] 0xd1cf1c34: netbsd:config_search_internal+0x1a8
[  13.2771142] 0xd1cf1c5c: netbsd:config_search+0x90
[  13.2771142] 0xd1cf1cf4: netbsd:gpioioctl+0x3b0
[  13.2875069] 0xd1cf1d1c: netbsd:spec_ioctl+0xe8
[  13.2875069] 0xd1cf1d4c: netbsd:VOP_IOCTL+0x50
[  13.2971192] 0xd1cf1e24: netbsd:vn_ioctl+0xd8
[  13.2971192] 0xd1cf1eec: netbsd:sys_ioctl+0x468
[  13.3075899] 0xd1cf1fac: netbsd:syscall+0x188
[  13.3075899] cpu0: End traceback...
Stopped in pid 681.681 (gpioctl) at     netbsd:cpu_Debugger+0x4:        bx

in this case, modules=YES, gpio=YES in /etc/rc.conf.  In
/etc/modules.conf gpioiic and sht4xtemp was included.  In
/etc/gpio.conf a single line:

gpio0 attach gpioiic 5 0x03 0x0

which is the usual way I have done this.  The kernel is a evbarm6hf
build without MULTIPROCESSOR to work around kern/56433 where the RPI3
won't boot in MP.


This can be repeated without actually having physical hardware by
using gpiosim.  The following will produce the panic:

In /etc/rc.conf, use modules=YES and gpio=YES

In /etc/modules.conf include:

In /etc/gpio.conf put the following:

gpio0 attach gpioiic 5 0x03 0x0

Change gpio0 to whatever gpiosim attaches to.  If you do not have any
physical gpio devices it will likely be gpio0, if you do, it will be
+1 beyond what is there physically.  So a RPI, it would end up gpio1.

Boot the system and you will see the panic when /etc/rc.d/gpio runs.
The test for this was performed on a RPI3 with a kernel without
MULTIPROCESSOR enabled to work around kern/56433


Don't know.  The attachment framework is a bit of a black box to me.

Home | Main Index | Thread Index | Old Index