From owner-freebsd-mips@FreeBSD.ORG Tue Apr 20 14:23:25 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 C61451065675; Tue, 20 Apr 2010 14:23:25 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9313B8FC13; Tue, 20 Apr 2010 14:23:25 +0000 (UTC) Received: by pwi9 with SMTP id 9so4367139pwi.13 for ; Tue, 20 Apr 2010 07:23:25 -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=TWP4BLXlv5+eOEcWUpH346u8hCxusS9CqaH+w2OBoyc=; b=RoaiIDKN4wbGFssl2EzuX4lDJfvO7uMi5IWCbeZJ/ZdXNBWH9UR5HcsmJ5quGu9I1H 2GQWvrnrAiHGjiAmAHPLQ6R5hEyDDq9sHAYhMHIRdlq+6L4HOrA4eAFSGrINom0iJj1B GydTKtxKori0ZVDKdE25C+UfaGGgGShPjIsxI= 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=QS2s8cOutvsTl5H360H/jesCKXfPfHe2uNSFsG3AAFJujbYp+NSnfx/aQs9+lSrMuC kFHavY8BKz6PIuhPBndCGurkkOJEmRP3/gY2dfIQ1hYeE62KErRswOw07VpAjhLIogsn Uxb4/jc2W8ue0RAOxwnJtWsCPl2EL4mHWLku8= MIME-Version: 1.0 Received: by 10.141.29.15 with HTTP; Tue, 20 Apr 2010 07:23:23 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Apr 2010 19:53:23 +0530 Received: by 10.141.88.3 with SMTP id q3mr5753849rvl.162.1271773403829; Tue, 20 Apr 2010 07:23:23 -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:23:25 -0000 Please ignore the first part of the mail about array size, I seem to have missed the definition in rmi files. JC. On Tue, Apr 20, 2010 at 7:48 PM, C. Jayachandran wrote: > 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 a= nd systat work display useful data. I think the commented out atomic inc ca= n 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? =A0The 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 goo= d 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 > --=20 C. Jayachandran c.jayachandran@gmail.com