Date: Tue, 15 Apr 2014 14:03:13 -0600 From: Warner Losh <imp@bsdimp.com> To: Jakub Klama <jakub.klama@uj.edu.pl> Cc: freebsd-arm@FreeBSD.org, Ian Lepore <ian@FreeBSD.org> Subject: Re: [RFC] Refactored interrupt handling on ARM Message-ID: <1C9D6FD8-A237-4123-A22F-9D8FAF984C1B@bsdimp.com> In-Reply-To: <da94dcc391d9f02709186d662eab696e@uj.edu.pl> References: <3e7f866f4bc774975ae3c85e0df78ec2@uj.edu.pl> <53418D13.7030107@freebsd.org> <534C0F48.2090302@freebsd.org> <f2bebfa812ecb70f423b6be4779b217b@uj.edu.pl> <534C5A6A.1090707@freebsd.org> <246c2ef842c2b47eb2400c1f700ad441@uj.edu.pl> <534CC733.7010009@freebsd.org> <ACD52C94-A44A-42FD-8016-61B0B21B12D9@bsdimp.com> <619da7d72d2345b1fcac5426b45c6ead@uj.edu.pl> <1397580102.1124.121.camel@revolution.hippie.lan> <da94dcc391d9f02709186d662eab696e@uj.edu.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 15, 2014, at 11:36 AM, Jakub Klama <jakub.klama@uj.edu.pl> wrote: > On Tue, 15 Apr 2014 10:41:42 -0600, Ian Lepore wrote: >> IMO we do too much of this. Unless there's a really good reason not = to >> update the older platforms to use this new scheme, I think we should >> just convert everything to the new way. >=20 > I'd also vote for that. >=20 >> Since this is only needed by the new arm code, and the new arm code = only >> calls intr_event_handle() from arm_dispatch_irq(), can't this logic = just >> move into there? >=20 > Good point. I think that following change should be sufficent: >=20 > --- a/sys/arm/arm/intrng.c > +++ b/sys/arm/arm/intrng.c > @@ -113,6 +113,14 @@ arm_dispatch_irq(device_t dev, struct trapframe = *tf, int irq) > debugf("pic %s, tf %p, irq %d\n", device_get_nameunit(dev), tf, = irq); > + /* > + * If we got null trapframe argument, that probably means > + * a call from non-root interrupt controller. In that case, > + * we'll just use the saved one. > + */ > + if (tf =3D=3D NULL) > + tf =3D PCPU_GET(curthread)->td_intr_frame; > + > for (i =3D 0; arm_intrs[i].ih_dev !=3D NULL; i++) { > if (arm_intrs[i].ih_pic->ic_dev =3D=3D dev && > arm_intrs[i].ih_irq =3D=3D irq) { I=92d have thought that the cascading controllers would have passed this = trap frame along. What am I missing? Warner=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1C9D6FD8-A237-4123-A22F-9D8FAF984C1B>