From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: gic: fix irq_alloc_descs handling for sparse irq
Date: Sat, 22 Oct 2011 21:36:35 +0100 [thread overview]
Message-ID: <20111022203635.GA30950@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1319314808-27007-1-git-send-email-robherring2@gmail.com>
On Sat, Oct 22, 2011 at 03:20:08PM -0500, Rob Herring wrote:
> @@ -657,7 +664,7 @@ int __init gic_of_init(struct device_node *node, struct device_node *parent)
>
> domain->of_node = of_node_get(node);
>
> - gic_init(gic_cnt, 16, dist_base, cpu_base);
> + gic_init(gic_cnt, -1, dist_base, cpu_base);
>
> if (parent) {
> irq = irq_of_parse_and_map(node, 0);
You don't explain this change - '16' is used here to skip the SGI
interrupts which will never be passed to the generic IRQ subsystem
from the GIC.
Moreover, the second parameter is an unsigned integer, not a signed
integer.
And not only that, but:
gic->irq_offset = (irq_start - 1) & ~31;
means that irq_offset ends up being -2 & ~31, or -32. Do you really
want the PPIs to generate IRQ numbers from -16 to -1 ? It doesn't stop
there:
for (i = irq_start; i < irq_limit; i++) {
irq_set_chip_and_handler(i, &gic_chip, handle_fasteoi_irq);
irq_set_chip_data(i, gic);
set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
}
This will start from -1 to irq_limit (-1 + number of GIC IRQs).
Basically, -1 is not legal here - 1 is the minimum valid value that
this function takes for proper operation - but that's just wasteful, so
16 is the realistic minimum value.
next prev parent reply other threads:[~2011-10-22 20:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-22 20:20 [PATCH] ARM: gic: fix irq_alloc_descs handling for sparse irq Rob Herring
2011-10-22 20:36 ` Russell King - ARM Linux [this message]
2011-10-23 3:43 ` Rob Herring
2011-10-24 14:36 ` [PATCH v2] " Rob Herring
2011-11-14 13:19 ` Magnus Damm
2011-11-14 14:11 ` Rob Herring
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=20111022203635.GA30950@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).