From owner-freebsd-arm@FreeBSD.ORG Tue Apr 15 20:03:19 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D26C8F for ; Tue, 15 Apr 2014 20:03:19 +0000 (UTC) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7EE416CD for ; Tue, 15 Apr 2014 20:03:18 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id rd3so10079342pab.11 for ; Tue, 15 Apr 2014 13:03:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=cIooNGUQv0lNfdZS5VfBw+QHWp8MvtJIjTJx55LU+lI=; b=HGM3xxowh5mVz7TW1Rfu+ZleJempPh3BMz/Ee5aK/9wNYR75xQ/UbOiHHo2EHZIopP F2ApUsje0knCC56UNInlC6SZ/F4Mrf0TnK2p5G52yysi7Rc9NWMd2ZGoot0cMrT0iE1t mXlrDDZyhu0I0SvcHBiVFLXX7C6UHK7OwuIc26KAWupPp4ZrabFOizaFp2kHgJDZOCOd nHaior5aFnjDyNODmDA0mdy2bBdC2witxIEWBrG3jDArldaOryTj8Jfbg2/2mVRUn/pb sv9+4BTXq5vSbjZTdCUD1L8/LkfjiQIBRveMBer1WTj7HOlfPZrByfQEQTpFHtZBIj3W PH1g== X-Gm-Message-State: ALoCoQkuzBhpZa8bYcaX822kxi8u44jtShnCJio6Ztr2ddzKWf5jxHNSmgIg5AbpLQVVtqJKkPrZ X-Received: by 10.66.66.66 with SMTP id d2mr4154603pat.36.1397592196189; Tue, 15 Apr 2014 13:03:16 -0700 (PDT) Received: from macintosh-c42c033c0b73.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ak1sm42130413pbc.58.2014.04.15.13.03.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 13:03:15 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: [RFC] Refactored interrupt handling on ARM From: Warner Losh In-Reply-To: Date: Tue, 15 Apr 2014 14:03:13 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <1C9D6FD8-A237-4123-A22F-9D8FAF984C1B@bsdimp.com> References: <3e7f866f4bc774975ae3c85e0df78ec2@uj.edu.pl> <53418D13.7030107@freebsd.org> <534C0F48.2090302@freebsd.org> <534C5A6A.1090707@freebsd.org> <246c2ef842c2b47eb2400c1f700ad441@uj.edu.pl> <534CC733.7010009@freebsd.org> <619da7d72d2345b1fcac5426b45c6ead@uj.edu.pl> <1397580102.1124.121.camel@revolution.hippie.lan> To: Jakub Klama X-Mailer: Apple Mail (2.1874) Cc: freebsd-arm@FreeBSD.org, Ian Lepore X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 20:03:19 -0000 On Apr 15, 2014, at 11:36 AM, Jakub Klama 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=