linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Bohan <mbohan@codeaurora.org>
To: Rob Herring <robherring2@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	linux-kernel@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linuxppc-dev@lists.ozlabs.org,
	Russell King <linux@arm.linux.org.uk>,
	sfr@canb.auug.org.au,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	linux-arm-msm@vger.kernel.org
Subject: Re: [RFC 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one
Date: Mon, 16 Jan 2012 18:43:40 -0800	[thread overview]
Message-ID: <4F14E05C.30207@codeaurora.org> (raw)
In-Reply-To: <4F0F7B60.5040701@gmail.com>

On 1/12/2012 4:31 PM, Rob Herring wrote:
> You have removed the irq_alloc_descs call from the GIC which is a step
> backwards. Several of the ARM DT enabled platforms are at the point they
> can fully support dynamic virq base for each irqchip. I changed the
> domain from legacy to linear and got things working. The issue with
> linear is for SPARSE_IRQ. The default behavior on ARM for SPARSE_IRQ is
> all nr_irqs are allocated at boot time before any controller is
> initialized. The only platform with a GIC and requiring SPARSE_IRQ is
> shmobile, but it is also the only one that calls irq_alloc_desc
> functions for it's interrupts. So I think we are okay there. The problem
> occurs when enabling SPARSE_IRQ for a non-DT platform with a GIC and
> with irqchips that don't call irq_alloc_desc for their irqs. IMHO, this
> should be an okay trade-off. There's no advantage to enabling SPARSE_IRQ
> on ARM for platforms that don't require it. All the platforms with a GIC
> have active work to convert to DT (except shmobile which I think is
> okay), so it's a temporary issue.

I thought I would chime in here since this is very relevant to what 
we're doing on arm-msm. We are using Device Tree with the GIC. We also 
have several other interrupt chips, including one for a device that 
supports up to 32768 sparsely populated interrupts. Hence we are using 
SPARSE_IRQ to only allocate irq_descs on demand for this device.

To support this, I had to modify irq_domain_add() to not 'register' the 
domain. Eg. simply add the domain to the list, but do not initialize the 
hwirq values in the irq_data structure. This is because our irq_descs 
are allocated later based on Device Tree topology. This information is 
not available during of_irq_init().

But then I was left with the problem of managing irq_bases for multiple 
chip drivers. The problem with irq_alloc_desc() is that it doesn't allow 
you to allocate a range without allocating its corresponding resources. 
Meaning, I'd like to reserve a chunk of virqs, but not utilize any 
resources for them until I know they're necessary. This is where 
irq_domains comes in.

In order to support this properly, I decided it made sense to add a new 
API called irq_domain_find_free_range(). This walks the irq domains 
list, now sorted by domain->irq_base, to find the first available range 
of the size specified. Thus every irq chip then only needs to know the 
worst case number of interrupts it could ever support. The framework 
takes care of finding the specific virq base. And all of this 
information is available at of_irq_init() time. This all assumes that 
every chip driver registers with irq_domains.

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.

Thanks,
Mike

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

  parent reply	other threads:[~2012-01-17  2:47 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 20:22 [RFC 0/14] Finish up irq_domain generalization Grant Likely
2012-01-11 20:22 ` [RFC 01/14] dt: Make irqdomain less verbose Grant Likely
2012-01-11 20:22 ` [RFC 02/14] irq_domain: Make irq_domain structure match powerpc's irq_host Grant Likely
2012-01-11 20:22 ` [RFC 03/14] irq_domain: convert microblaze from irq_host to irq_domain Grant Likely
2012-01-11 20:22 ` [RFC 04/14] irq_domain/powerpc: Use common irq_domain structure instead of irq_host Grant Likely
2012-01-11 20:22 ` [RFC 05/14] irq_domain/powerpc: eliminate irq_map; use irq_alloc_desc() instead Grant Likely
2012-01-11 20:22 ` [RFC 06/14] irq_domain/powerpc: Eliminate virq_is_host() Grant Likely
2012-01-11 20:22 ` [RFC 07/14] irq_domain: Move irq_domain code from powerpc to kernel/irq Grant Likely
2012-01-11 20:22 ` [RFC 08/14] irqdomain: remove NO_IRQ from irq domain code Grant Likely
2012-01-11 20:22 ` [RFC 09/14] irq_domain: Remove references to old irq_host names Grant Likely
2012-01-11 20:22 ` [RFC 10/14] irq_domain: Replace irq_alloc_host() with revmap-specific initializers Grant Likely
2012-01-11 20:22 ` [RFC 11/14] powerpc: Eliminate NO_IRQ usage Grant Likely
2013-07-25 21:58   ` Geert Uytterhoeven
2013-07-26  3:56     ` Grant Likely
2013-08-23 13:18       ` Geert Uytterhoeven
2013-08-23 13:22         ` Geert Uytterhoeven
2012-01-11 20:22 ` [RFC 12/14] irq_domain: Add support for base irq and hwirq in legacy mappings Grant Likely
2012-01-13  0:37   ` Rob Herring
2012-01-13  0:53     ` Grant Likely
2012-01-11 20:22 ` [RFC 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one Grant Likely
2012-01-11 21:15   ` Rob Herring
2012-01-11 21:27     ` Grant Likely
2012-01-13  0:31       ` Rob Herring
2012-01-13  0:47         ` Grant Likely
2012-01-13  0:53           ` Rob Herring
2012-01-13  2:20         ` Grant Likely
2012-01-17  2:43         ` Michael Bohan [this message]
2012-01-17  3:42           ` Benjamin Herrenschmidt
2012-01-18  0:28             ` Grant Likely
2012-01-18  2:16               ` Benjamin Herrenschmidt
2012-01-11 20:22 ` [RFC 14/14] irq_domain: Remove irq_domain_add_simple() Grant Likely
2012-01-11 21:39 ` [RFC 0/14] Finish up irq_domain generalization Randy Dunlap
2012-01-11 20:50   ` Grant Likely
2012-01-11 21:23     ` Grant Likely
2012-01-11 22:48       ` Randy Dunlap
2012-01-12 10:17 ` [RFC 06/14] irq_domain/powerpc: Eliminate virq_is_host() Milton Miller
2012-01-18  0:38   ` Grant Likely
2012-01-18 21:25   ` Grant Likely

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=4F14E05C.30207@codeaurora.org \
    --to=mbohan@codeaurora.org \
    --cc=benh@kernel.crashing.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=robherring2@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    /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).