From patchwork Thu May 14 10:06:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 472290 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A99CB1401DA for ; Thu, 14 May 2015 20:08:05 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 899F81A060F for ; Thu, 14 May 2015 20:08:05 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from filtteri5.pp.htv.fi (filtteri5.pp.htv.fi [213.243.153.188]) by lists.ozlabs.org (Postfix) with ESMTP id 66A051A03A4 for ; Thu, 14 May 2015 20:07:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by filtteri5.pp.htv.fi (Postfix) with ESMTP id 86DBD5A6ED1; Thu, 14 May 2015 13:06:49 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp4.welho.com ([213.243.153.38]) by localhost (filtteri5.pp.htv.fi [213.243.153.188]) (amavisd-new, port 10024) with ESMTP id N2YHz47dHoGG; Thu, 14 May 2015 13:06:44 +0300 (EEST) Received: from fuloong-minipc (91-145-91-118.bb.dnainternet.fi [91.145.91.118]) by smtp4.welho.com (Postfix) with ESMTP id F13615BC016; Thu, 14 May 2015 13:06:56 +0300 (EEST) Date: Thu, 14 May 2015 13:06:56 +0300 From: Aaro Koskinen To: Benjamin Herrenschmidt Subject: Re: G5 Xserve rackmeter broken? Message-ID: <20150514100656.GC609@fuloong-minipc.musicnaut.iki.fi> References: <20150510183259.GA13777@aspire-one.musicnaut.iki.fi> <1431296015.13039.12.camel@kernel.crashing.org> <20150512175555.GB609@fuloong-minipc.musicnaut.iki.fi> <1431463180.20218.57.camel@au1.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1431463180.20218.57.camel@au1.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi, On Wed, May 13, 2015 at 06:39:40AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2015-05-12 at 20:55 +0300, Aaro Koskinen wrote: > > I'm running with HZ=100 so the values are still probably within > > jiffy resolution, so perhaps the calculation should first do > > idle = min(idle, total)? > > Does it gives you a reasonable output if you do that ? The below change fixes the idle system blinking behaviour. I'm also able to reproduce the leds going off during full CPU load case. It seems there is some DMA error. Normally, reading rm->dma_regs->status in the IRQ handler gives 0x8400. In the failure cases I've seen values 0x8880 and 0x8980 - the IRQ will stop after this and it will need paused -> started cycle before it gets going again (but sometimes fails again soon after). A. diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 048901a..3381fa59 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c @@ -227,6 +227,7 @@ static void rackmeter_do_timer(struct work_struct *work) total_idle_ticks = get_cpu_idle_time(cpu); idle_ticks = (unsigned int) (total_idle_ticks - rcpu->prev_idle); + idle_ticks = min(idle_ticks, total_ticks); rcpu->prev_idle = total_idle_ticks; /* We do a very dumb calculation to update the LEDs for now,