Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754593AbXHRK1T (ORCPT ); Sat, 18 Aug 2007 06:27:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752849AbXHRK1L (ORCPT ); Sat, 18 Aug 2007 06:27:11 -0400 Received: from nf-out-0910.google.com ([64.233.182.189]:33402 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626AbXHRK1J (ORCPT ); Sat, 18 Aug 2007 06:27:09 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Rfb7M+y/MilXnXCn8r8ZMfZoKKTcMlDAHilUb3j+tFm9+pUgNa9LcTZJL/r0DQkb2yqdixWun+4QDuVEJD82u9OTIGRmtijb3a/TR7Efe3OmhzjJ/De+7atb6csSyc9oBmwdMULJdi+HIjcsrV+3bCmZ7nc29gln7lpTCd2d7L8= Message-ID: Date: Sat, 18 Aug 2007 12:27:07 +0200 From: "Xu Yang" To: "Stefan Richter" Subject: Re: warning in set_irq_chip, ARM port (was Re: bug information) Cc: linux-kernel@vger.kernel.org, "Catalin Marinas" , "Russell King" In-Reply-To: <46C6BF3B.2000502@s5r6.in-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46C6BF3B.2000502@s5r6.in-berlin.de> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3963 Lines: 98 Hi Stefan, thanks for your explaination:) I will try the kernel 2.6.22 and reprot the results later. regards, yang 2007/8/18, Stefan Richter : > Xu Yang wrote: > > When I was porting kernel 2.6.19 to my realview_eb_mpcore system, I > > got the following information. > ... > > does anyone know what does these information tell ? and where might be > > the problem? > ... > > <5>Linux version 2.6.19-arm2 (risingsunxy@localhost.localdomain) (gcc > > version 4.2.0 20070413 (prerelease) (CodeSourcery Sourcery G++ Lite > > 2007q1-21)) #13 SMP Wed Aug 15 19:10:52 CEST 2007 > > CPU: ARMv6-compatible processor [410fb022] revision 2 (ARMv6TEJ), cr=00c5387f > > Machine: ARM-RealView EB > ... > > BUG: warning at kernel/irq/chip.c:95/set_irq_chip() > > [] (dump_stack+0x0/0x14) from [] (set_irq_chip+0x30/0x94) > > [] (set_irq_chip+0x0/0x94) from [] > > (gic_dist_init+0x144/0x1a8) > ... > > Trying to set irq flags for IRQ128 > ... > > These log lines com from the WARN_ON macro at the indicated file, line, > and function. This is the function definition: > http://lxr.free-electrons.com/source/kernel/irq/chip.c?v=2.6.19#083 > > So, set_irq_chip(irq, chip) was called with irq >= NR_IRQS. > > According to your log, the kernel iterated over IRQs up to 255 but > NR_IRQS, the total number of IRQs, is obviously defined as 128. The > call trace points to gic_dist_init as caller of set_irq_chip. > http://lxr.free-electrons.com/source/arch/arm/common/gic.c?v=2.6.19#108 > > Either the parameters used to calculate max_irq in gic_dist_init are > wrong, or NR_IRQS is wrong, or gic_dist_init's loop over the > set_irq_chip call is wrong. I am not familiar with this architecture, > but this looks suspicious to me: > > /* > * The GIC only supports up to 1020 interrupt sources. > * Limit this to either the architected maximum, or the > * platform maximum. > */ > if (max_irq > max(1020, NR_IRQS)) > max_irq = max(1020, NR_IRQS); > > Shouldn't this be: > > if (max_irq > min(1020, NR_IRQS)) > max_irq = min(1020, NR_IRQS); > > On the other hand, gic_dist_init's loop over set_irq_chip has been > changed in Linux 2.6.21 to work with multiple interrupt controllers by > the following patch from Catalin Marinas: > "The current implementation only assumes one GIC to be present in the > system. However, there are platforms with more than one cascaded > interrupt controllers (RealView/EB MPCore for example)." > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b3a1bde4db9889feb116330bff21214811c940e4 > > I think it would be best if you try again with linux-2.6.22.y (latest is > 2.6.22.3) or 2.6.23-rcX (latest is 2.6.23-rc3). If the bug is still > there, report to the linux-arm-kernel@lists.arm.linux.org.uk. (You > would need to subscribe at > http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel first.) > > > A few side notes on getting started with kernel hacking: > > I found 'LXR' a very useful tool to examine the kernel sources. > A similar tool but for offline use is 'cscope', which I often use via > the nice GUI frontend 'kscope'. > > The commit which changed set_irq_chip can be found using the history > links in gitweb > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=history;f=arch/arm/common/gic.c;h=0c89bd35e06fb495dbaddfe2796c6d88a28cea87;hb=HEAD > or quicker and more precisely on a locally installed git repo via 'git > blame' or with the GUI frontend qgit. I actually used qgit in this case. > -- > Stefan Richter > -=====-=-=== =--- =--=- > http://arcgraph.de/sr/ > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/