[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACxGe6ufk+BUoXZBKm5Q-O1Aj1j=18fJ5KjOC-fKQMbpw4z=mw@mail.gmail.com>
Date: Tue, 17 Jan 2012 17:28:05 -0700
From: Grant Likely <grant.likely@...retlab.ca>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Michael Bohan <mbohan@...eaurora.org>,
Rob Herring <robherring2@...il.com>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
linuxppc-dev@...ts.ozlabs.org,
Russell King <linux@....linux.org.uk>, sfr@...b.auug.org.au,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
linux-arm-msm@...r.kernel.org
Subject: Re: [RFC 13/14] irq_domain: Remove 'new' irq_domain in favour of the
ppc one
On Mon, Jan 16, 2012 at 8:42 PM, Benjamin Herrenschmidt
<benh@...nel.crashing.org> wrote:
> On Mon, 2012-01-16 at 18:43 -0800, Michael Bohan wrote:
>>
>> I was planning on sending these patches out, but it seems like with
>> Grant's patches, they may no longer be up to date. I was curious if any
>> thought was given to supporting configurations like this the one I
>> mentioned with the advent of these patches. I am happy to help test if
>> you can steer me in the right direction.
>
> I haven't had a chance to look in detail at what Grant is doing in his
> latest series, but the ppc domain scheme that he's basing it on has the
> concept of sparse interrupt domains.
>
> For these, we use a radix tree for the reverse map (we do not rely on a
> linear range) and we "allocate" linux IRQ numbers on-demand as we create
> mapping for individual HW interrupts.
My latest patches are primarily a direct port of the ppc code to be
generic for all architectures, and it does pretty much what you want.
As Ben suggests, you should look at the radix revmap code. Use the
irq_domain_add_tree() function for creating the irq_domain, and there
is no need to even pre-allocate the number of hwirqs that you want to
support. It uses a radix tree to manage arbitrary mappings from hwirq
number to linux numbers.
The other option is the linear map which maintains a static array with
one entry per hwirq number. Use irq_domain_add_linear() to create one
and pass in the maximum number of hwirqs supported by the controller.
It will allocate an array of irq_desc* so that irq_descs can be
allocated dynamically.
It is also important to note that for both these revmaps, the actual
virq number is irrelevant. The irq_domain is entirely responsible for
allocation and management. There will be no need for a 'chunk of
virqs' assigned to an irq controller.
BTW: Ben, if you can carve out some time, I'd appreciate a look over
my series and make sure you're okay with it. Once it's had some
testing by arm and ppc folks, I want to get it into linux-next.
g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists