From owner-freebsd-mips@FreeBSD.ORG Tue Apr 20 14:18:46 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81BE6106567A; Tue, 20 Apr 2010 14:18:46 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-pz0-f197.google.com (mail-pz0-f197.google.com [209.85.222.197]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8B28FC14; Tue, 20 Apr 2010 14:18:45 +0000 (UTC) Received: by pzk35 with SMTP id 35so211190pzk.3 for ; Tue, 20 Apr 2010 07:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cBjTNJqKhqVC1GDmlMzLEc2XvKg6B68+LMYyFbOPEqk=; b=XCVSRBfU+DIPWh584Zuu9E//AgI4eQ4sVhrHIu8u/norpqrEXeY0zVgdgMC2wvtA6j Z2zo4V9dtG1htv4BC7a4aXWubEDKVb/VUbU9MQ/tHdJK6jr347SZeV5X6qJLtDeIsSPv XrKQa8vcpg751/vrLw0WPV2JjOa8+gn+5+/UA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=iV7/FtK7JcP47ZNgcjfdjFzrlFrZ/CZKWn6xebQgEyepZhX4HlkzjrsrJUD6wCZRmf V1h6rDuiw+jgHG+5wHE50iu8K6Hrdle8ymykh0odgrH4GKI+lctQHS3rH1cQ8Fm90Ag0 KJjFNkUv9QQMliCAhxof7/hTRiPf97j2Y4SXk= MIME-Version: 1.0 Received: by 10.141.29.15 with HTTP; Tue, 20 Apr 2010 07:18:43 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Apr 2010 19:48:43 +0530 Received: by 10.141.4.10 with SMTP id g10mr5748840rvi.179.1271773125330; Tue, 20 Apr 2010 07:18:45 -0700 (PDT) Message-ID: From: "C. Jayachandran" To: Rui Paulo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Account RMI XLR interrupts X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2010 14:18:46 -0000 On Tue, Apr 20, 2010 at 5:06 PM, Rui Paulo wrote: > Hi, > The following patch accounts interrupts on the XLR and makes vmstat -i an= d systat work display useful data. I think the commented out atomic inc can= go away, but I'm not sure. > > Here's an example: > > $ vmstat -i > interrupt =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0total =A0 = =A0 =A0 rate > int16: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 56118 =A0 = =A0 =A0 =A0984 > int17: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 214 = =A0 =A0 =A0 =A0 =A03 > Total =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A056332 = =A0 =A0 =A0 =A0988 > > int16 is the timer and int17 is the network interface (rge1). Are you sure that the mips_intr_events array has the size to hold all the XLR interrupts? The XLR has a slightly different scheme (with COP0 EIRR EIMR registers) and can have upto 64 interrupts. A mechanism to unify the interrupt, and handling the XLR PIC may be a good = idea. The network packets come on MSGRING interrupt - only link status etc will come on the GMAC interrupt. JC. > Index: intr_machdep.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 > --- intr_machdep.c =A0 =A0 =A0(revision 206791) > +++ intr_machdep.c =A0 =A0 =A0(working copy) > @@ -157,28 +157,17 @@ > =A0 =A0 =A0 =A0for (i =3D sizeof(eirr) * 8 - 1; i >=3D 0; i--) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((eirr & (1ULL << i)) =3D=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ie =3D mips_intr_events[i]; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* atomic_add_long(mih->cntp, 1); */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Don't account special IRQs */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch (i) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IRQ_IPI: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IRQ_MSGRING: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 default: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mips_intrcnt_inc(mips_intr_= counters[i]); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0write_c0_eirr64(1ULL << i); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pic_ack(i, 0); > > Regards, > -- > Rui Paulo