NetBSD-Bugs archive

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

kern/60818: plmmc_ifpga.c does not establish interrupt handler for PL181 controller



>Number:         60818
>Category:       kern
>Synopsis:       plmmc_ifpga.c does not establish interrupt handler for PL181 controller
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 28 17:55:00 +0000 2026
>Originator:     Joe Groff
>Release:        11.0-STABLE
>Organization:
>Environment:
>Description:
The evbarm INTEGRATOR_CP kernel configuration attaches the SDMMC controller via:

```
plmmc0		at ifpga? offset 0x0c000000 irq 23
```

However, the code in `plmmc_ifpga_attach` that enables the controller has the line that establishes the interrupt handler disabled in an `#if 0` block. At line 79:

```
#if 0
	sc->sc_ih = ifpga_intr_establish(ifa->ifa_irq, IPL_BIO, plmmc_intr, sc);
#endif
```

Booting a kernel with a QEMU virtual machine with `qemu-system-arm -machine integratorcp -sd foo.img`, the kernel will time out trying to probe the SD card because the interrupts from the controller are never handled. However, by removing the `#if 0` and the assignment to the nonexistent `sc->sc_ih` field, the existing interrupt handler appears to just work.


>How-To-Repeat:
- Build the kernel with `./build.sh -m evbarm -a earmv5 kernel=INTEGRATOR_CP`.

- Boot the kernel in qemu with something like `qemu-system-arm -machine integratorcp -kernel ../path/to/INTEGRATOR_CP/netbsd -sd netbsd-root.fs`
>Fix:
Change line 79 of arch/evbarm/ifpga/plmmc_ifpga.c to remove the `#if 0` and unnecessary assignment (or, alternately, add an `sc_ih` field to `struct plmmc_softc`):

```
-#if 0
-	sc->sc_ih = ifpga_intr_establish(ifa->ifa_irq, IPL_BIO, plmmc_intr, sc);
-#endif
+	ifpga_intr_establish(ifa->ifa_irq, IPL_BIO, plmmc_intr, sc);
```




Home | Main Index | Thread Index | Old Index