Subject: iBook G4 update
To: None <port-macppc@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: port-macppc
Date: 06/08/2004 00:44:25
Hi all

I moved froward with iBook G4 keyboard troubles.

At the beginning, communication with the keyboard works fine in DDB. ADB
interrupts are fired regularly and everything is okay. 

Once a user process opens the keyboard, interrupts disapear and the
keyboard does not respond anymore, even in DDB.

I traced the problem to wskbd_do_open:

int     
wskbd_do_open(struct wskbd_softc *sc, struct wseventvar *evp) 
{
        sc->sc_base.me_evp = evp;
        sc->sc_translating = 0;

        return (wskbd_enable(sc, 1));
}

After entering wskbd_do_open and before entering wskbd_enable, the ADB
interruptions get masked. 

I assume that sc->sc_base.me_evp or sc->sc_translating must be changing
the behavior of an interrupt. Tracing with DDB shows that things get
wrong after the second occurence of stw, so I'd vote for
sc->sc_translating. Now I see two explanations
1) the ADB interrupt was disabled
2) the system remained in splhigh()

But I see nothing in the sources that could explain that. ADB Iterrupts
go to the sys/arch/macppc/dev/pm_direct.c:pm_intr_pm2(). 

Any idea about how to track down the issue? Where sc->sc_translating is
used in sys/arch/macppc/dev/* ? 

-- 
Emmanuel Dreyfus
Il y a 10 sortes de personnes dans le monde: ceux qui comprennent 
le binaire et ceux qui ne le comprennent pas.
manu@netbsd.org