Re: powerpc/pic/intr.c IPL_HIGH vs IPL_NONE

Matt Thomas <[email protected]> Thu, 3 Jan 2013 20:59:16 -0800
Newsgroups gmane.os.netbsd.ports.bebox,gmane.os.netbsd.ports.powerpc,gmane.os.netbsd.current
Message-ID <[email protected]>
On Jan 3, 2013, at 4:25 AM, Frank Wille wrote:

> On Thu, 03 Jan 2013 19:59:34 +0900 (JST)
> KIYOHARA Takashi <[email protected]> wrote:
>=20
>> I will commit this change.
>>=20
>> Index: intr.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> RCS file: /cvsroot/src/sys/arch/powerpc/pic/intr.c,v
>> retrieving revision 1.23
>> diff -u -r1.23 intr.c
>> --- intr.c	31 Aug 2012 13:12:52 -0000	1.23
>> +++ intr.c	3 Jan 2013 10:57:03 -0000
>> @@ -213,7 +213,7 @@
>> 	ih->ih_fun =3D ih_fun;
>> 	ih->ih_arg =3D ih_arg;
>> 	ih->ih_next =3D NULL;
>> -	ih->ih_ipl =3D ipl;
>> +	ih->ih_ipl =3D maxipl;
>> 	ih->ih_virq =3D virq;
>> 	*p =3D ih;
>=20
> IMHO this is not correct, although it is a workaround for your actual =
problem.

Actually I think the pic should be entered with IPL_HIGH and let the =
lower priority interrupts (if any) be serviced by the pending int =
mechanism.  Note that any sources with an IPL_HIGH can be serviced =
directly.

> You would lose the ability that a hwirq is interrupted by the same =
hwirq
> with a higher priority (from a different device, sharing the same =
hwirq).

The above allows higher priority interrupts to interrupt lower priority =
ones.