tech-kern archive

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

Solved! (was: why is this needed?)

gscpcib(4) in it's current state does not work. it does not attach the GPIO part. I had to apply the attached diff to make it work, but I really wonder why this is needed...

When I leave out the device_t sc_dev part in struct gscpcib_softc, i.e. I do not have this structure member, but the rest of the diff, then the gpio will attach, but accessing with e.g. 'gpioctl gpio0 6 set out' will lead to an uvm_map error an beam the machine to the eternal hunting grounds... (aka panic).

Something(tm) must be modifying the gscpcib_softc structure in the attach routine, around pcibattach(). Setting the sc- >sc_gpio_present to true, then calling pcibattach(), and after this, sc->sc_gpio_present is not longer true. I don't want to committ my fix right away, I'd really like to understand what is going on here.

Looks like this driver missed "struct pcib_softc" as the first element in its own softc structure. But this is needed, since we call pcibattach() later. Adding this element to the softc fixes the problem. The problem probably got unnoticed since the GPIOs were never attached and thus no panic due to acessing them.

While here, I removed the unneeded and empty gscpcib_childdetach function.

Find attached the diff that I will committ very shortly, since it fixes the problem on Soekris net4801 machines. The fix allows you to use the GPIO pins of the SC1100, the front panel LEDs are connected to them (GPIO pin 6 is the error LED).

- Marc Balmer

Attachment: gscpcib_02.diff
Description: Binary data

Home | Main Index | Thread Index | Old Index