From: Catalin Marinas <catalin.marinas@arm.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: adharmap@codeaurora.org, linux-arm-kernel@lists.infradead.org,
Ingo Molnar <mingo@elte.hu>, Yinghai Lu <yinghai@kernel.org>,
Tony Lindgren <tony@atomide.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
Kalle Valo <kalle.valo@iki.fi>, Jean Pihet <jpihet@mvista.com>,
Linus Walleij <linus.walleij@stericsson.com>,
Colin Tuckley <colin.tuckley@arm.com>,
Philby John <pjohn@in.mvista.com>,
Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>,
Alessandro Rubini <rubini@unipv.it>,
Andrea Gallo <andrea.gallo@stericsson.com>,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
Abhijeet Dharmapurikar <adharmap@quicinc.com>
Subject: Re: [PATCH 1/5] gic: prevent gic from crossing NR_IRQ
Date: Thu, 28 Jan 2010 13:19:07 +0000 [thread overview]
Message-ID: <1264684747.7064.61.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20100127224309.GD29665@n2100.arm.linux.org.uk>
On Wed, 2010-01-27 at 22:43 +0000, Russell King - ARM Linux wrote:
> On Wed, Jan 27, 2010 at 11:32:25AM -0800, adharmap@codeaurora.org wrote:
> > From: Abhijeet Dharmapurikar <adharmap@quicinc.com>
> >
> > The gic code tries to initialize interrupts beyond NR_IRQ. Prevent
> > code from doing that.
>
> NAK. This is completely the wrong approach.
>
> /*
> * Find out how many interrupts are supported.
> */
> max_irq = readl(base + GIC_DIST_CTR) & 0x1f;
> max_irq = (max_irq + 1) * 32;
>
> /*
> * 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);
> ...
> for (i = irq_start; i < gic_data[gic_nr].irq_offset + max_irq; i++) {
>
> This function is broken if irq_start != 0, and needs fixing - max_irq
> needs to be limited to the _minimum_ of 1020 or NR_IRQS - irq_start.
Actually I think in this case max_irq should be left to whatever the
hardware reads (but not more than 1020) since further down in this
function we configure the IRQs for the GIC and we also want to disable
those beyond NR_IRQS.
The "for" loop for set_irq_chip() should go to the minimum of max_irqs
and NR_IRQS.
--
Catalin
next prev parent reply other threads:[~2010-01-28 13:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 19:32 [PATCH 0/5] Arm Gic Changes adharmap
2010-01-27 19:32 ` [PATCH 1/5] gic: prevent gic from crossing NR_IRQ adharmap
2010-01-27 22:43 ` Russell King - ARM Linux
2010-01-28 13:19 ` Catalin Marinas [this message]
2010-01-27 19:32 ` [PATCH 2/5] gic: add callback for mask_ack adharmap
2010-01-27 19:32 ` [PATCH 3/5] gic: Add set_type callback adharmap
2010-01-27 23:09 ` Russell King - ARM Linux
2010-01-27 23:18 ` Russell King - ARM Linux
2010-01-28 1:43 ` Abhijeet Dharmapurikar
2010-05-07 10:56 ` Linus Walleij
2010-01-27 19:32 ` [PATCH 4/5] gic: dont disable INT in ack callback adharmap
2010-01-27 19:32 ` [RFC PATCH 5/5] gic: initialize interrupts as per argument adharmap
2010-01-27 23:29 ` Russell King - ARM Linux
2010-01-28 0:39 ` [PATCH 0/5] Arm Gic Changes Ben Dooks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1264684747.7064.61.camel@pc1117.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=adharmap@codeaurora.org \
--cc=adharmap@quicinc.com \
--cc=andrea.gallo@stericsson.com \
--cc=colin.tuckley@arm.com \
--cc=jpihet@mvista.com \
--cc=kalle.valo@iki.fi \
--cc=khilman@deeprootsystems.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@elte.hu \
--cc=pjohn@in.mvista.com \
--cc=rubini@unipv.it \
--cc=santosh.shilimkar@ti.com \
--cc=srinidhi.kasagar@stericsson.com \
--cc=tony@atomide.com \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome