Subject: Re: Interrupts
To: Tim Kelly <hockey@dialectronics.com>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 12/06/2004 13:57:12
Hello,
> >Anyway, I moved gc_enable_intr() behind the actual processing so it would
> >catch lost interrupts - it occasionally does so, I couldn't find any
> >negative side effects so far ( which of course doesn't mean there are none
> >) but now fsck'ing an USB disk doesn't disrupt audio anymore so I'll leave
> >it in place to see if everything else works as it should.
>
> Could you be more specific about "behind?" Where in the code did you move
> it to?
Same position as the OpenPIC version.
( ok, logically the same position since only one of them will ever be called )
while ((hwpend = (ci->ci_ipending & ~pcpl & HWIRQ_MASK)) != 0) {
irq = 31 - cntlzw(hwpend);
is = &intrsources[irq];
#if 0
if (!have_openpic)
gc_enable_irq(is->is_hwirq);
#endif
ci->ci_ipending &= ~(1 << irq);
splraise(is->is_mask);
mtmsr(emsr);
KERNEL_LOCK(LK_CANRECURSE|LK_EXCLUSIVE);
ih = is->is_hand;
while (ih) {
(*ih->ih_fun)(ih->ih_arg);
ih = ih->ih_next;
}
KERNEL_UNLOCK();
mtmsr(dmsr);
ci->ci_cpl = pcpl;
is->is_ev.ev_count++;
if (have_openpic)
openpic_enable_irq(is->is_hwirq, is->is_type);
#if 1
if (!have_openpic)
gc_enable_irq(is->is_hwirq);
#endif
As I said earlier I changed gc_enable_irq() to collect lost interrupts and mark them pending again so this will loop over the handlers again if it finds one.
have fun
Michael