* [RFCv2 03/14] irq_domain: Make irq_domain structure match powerpc's irq_host
[not found] ` <1327352870-14687-4-git-send-email-grant.likely@secretlab.ca>
@ 2012-01-24 21:38 ` Rob Herring
2012-01-24 22:08 ` Grant Likely
0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2012-01-24 21:38 UTC (permalink / raw)
To: linux-arm-kernel
On 01/23/2012 03:07 PM, Grant Likely wrote:
> Part of the series to unify the irq remapping mechanisms in the
> kernel. A follow up patch will copy the powerpc implementation into
> kernel/irq/irqdomain.c, which will be a lot easier if the structures
> are identical.
>
> Where they differ, I've chose to use the powerpc names since there is
> a lot more code using those names.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> arch/arm/common/gic.c | 14 ++++----
> include/linux/irqdomain.h | 84 ++++++++++++++++++++++++++++++++++-----------
> kernel/irq/irqdomain.c | 14 ++++----
> 3 files changed, 78 insertions(+), 34 deletions(-)
>
snip...
> @@ -126,7 +126,7 @@ void irq_dispose_mapping(unsigned int irq)
> }
> EXPORT_SYMBOL_GPL(irq_dispose_mapping);
>
> -int irq_domain_simple_dt_translate(struct irq_domain *d,
> +int irq_domain_simple_xlate(struct irq_domain *d,
> struct device_node *controller,
> const u32 *intspec, unsigned int intsize,
> unsigned long *out_hwirq, unsigned int *out_type)
This needs a declaration in irqdomain.h (as well as EXPORT?). There
could be others as well, but this is the one I'm using for generic irq chip.
Rob
> @@ -181,7 +181,7 @@ EXPORT_SYMBOL_GPL(irq_domain_generate_simple);
>
> struct irq_domain_ops irq_domain_simple_ops = {
> #ifdef CONFIG_OF_IRQ
> - .dt_translate = irq_domain_simple_dt_translate,
> + .xlate = irq_domain_simple_xlate,
> #endif /* CONFIG_OF_IRQ */
> };
> EXPORT_SYMBOL_GPL(irq_domain_simple_ops);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFCv2 03/14] irq_domain: Make irq_domain structure match powerpc's irq_host
2012-01-24 21:38 ` [RFCv2 03/14] irq_domain: Make irq_domain structure match powerpc's irq_host Rob Herring
@ 2012-01-24 22:08 ` Grant Likely
2012-01-24 22:11 ` Rob Herring
0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2012-01-24 22:08 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jan 24, 2012 at 2:38 PM, Rob Herring <robherring2@gmail.com> wrote:
> On 01/23/2012 03:07 PM, Grant Likely wrote:
>> Part of the series to unify the irq remapping mechanisms in the
>> kernel. ?A follow up patch will copy the powerpc implementation into
>> kernel/irq/irqdomain.c, which will be a lot easier if the structures
>> are identical.
>>
>> Where they differ, I've chose to use the powerpc names since there is
>> a lot more code using those names.
>>
>> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>> ---
>> ?arch/arm/common/gic.c ? ? | ? 14 ++++----
>> ?include/linux/irqdomain.h | ? 84 ++++++++++++++++++++++++++++++++++-----------
>> ?kernel/irq/irqdomain.c ? ?| ? 14 ++++----
>> ?3 files changed, 78 insertions(+), 34 deletions(-)
>>
>
> snip...
>
>> @@ -126,7 +126,7 @@ void irq_dispose_mapping(unsigned int irq)
>> ?}
>> ?EXPORT_SYMBOL_GPL(irq_dispose_mapping);
>>
>> -int irq_domain_simple_dt_translate(struct irq_domain *d,
>> +int irq_domain_simple_xlate(struct irq_domain *d,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? struct device_node *controller,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? const u32 *intspec, unsigned int intsize,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned long *out_hwirq, unsigned int *out_type)
>
> This needs a declaration in irqdomain.h (as well as EXPORT?). There
> could be others as well, but this is the one I'm using for generic irq chip.
Fine by me. I'll add that as a follow-on patch since nothing in-tree
currently depends on that. It will be in the next version of the
patch series. Also, are you okay if I rename it to
irq_domain_generic_xlate()? Simple doesn't really describe it well,
and it can be used for any interrupt controller implementing the
binding we've settled on as recommended for new device support.
g.
>
> Rob
>
>> @@ -181,7 +181,7 @@ EXPORT_SYMBOL_GPL(irq_domain_generate_simple);
>>
>> ?struct irq_domain_ops irq_domain_simple_ops = {
>> ?#ifdef CONFIG_OF_IRQ
>> - ? ? .dt_translate = irq_domain_simple_dt_translate,
>> + ? ? .xlate = irq_domain_simple_xlate,
>> ?#endif /* CONFIG_OF_IRQ */
>> ?};
>> ?EXPORT_SYMBOL_GPL(irq_domain_simple_ops);
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFCv2 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one
[not found] ` <1327352870-14687-14-git-send-email-grant.likely@secretlab.ca>
@ 2012-01-24 22:10 ` Rob Herring
2012-01-25 0:26 ` Grant Likely
0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2012-01-24 22:10 UTC (permalink / raw)
To: linux-arm-kernel
On 01/23/2012 03:07 PM, Grant Likely wrote:
> This patch removes the simplistic implementation of irq_domains and enables
> the powerpc infrastructure for all irq_domain users. The powerpc
> infrastructure includes support for complex mappings between Linux and
> hardware irq numbers, and can manage allocation of irq_descs.
>
> This patch also converts the few users of irq_domain_add()/irq_domain_del()
> to call irq_domain_add_legacy() instead.
>
> v2: Fix removal of irq_alloc_descs() call in gic driver
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> arch/arm/common/gic.c | 85 ++++++++-----------
> arch/arm/common/vic.c | 16 +---
> arch/arm/include/asm/hardware/gic.h | 4 +-
> arch/arm/include/asm/hardware/vic.h | 2 +
> arch/arm/mach-exynos/common.c | 2 +-
> arch/arm/mach-versatile/core.c | 5 +-
> drivers/mfd/twl-core.c | 12 +--
> include/linux/irqdomain.h | 45 +---------
> kernel/irq/irqdomain.c | 159 +++--------------------------------
> 9 files changed, 69 insertions(+), 261 deletions(-)
>
> diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
snip
> @@ -716,17 +708,17 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
> gic_irqs = 1020;
> gic->gic_irqs = gic_irqs;
>
> - domain->nr_irq = gic_irqs - domain->hwirq_base;
> - domain->irq_base = irq_alloc_descs(irq_start, 16, domain->nr_irq,
> - numa_node_id());
> - if (IS_ERR_VALUE(domain->irq_base)) {
> + irq_base = irq_alloc_descs(irq_start, 16, gic_irqs - hwirq_base,
> + numa_node_id());
> + if (IS_ERR_VALUE(irq_base)) {
> WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n",
> irq_start);
> - domain->irq_base = irq_start;
> + irq_base = irq_start;
> }
> - domain->host_data = gic;
> - domain->ops = &gic_irq_domain_ops;
> - irq_domain_add(domain);
> + gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base,
gic_irqs is wrong here. It needs 16 or 32 subtracted off. This patch
will fix things:
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 44bf4e7..5fc0c97 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -707,8 +707,9 @@ void __init gic_init_bases(unsigned int gic_nr, int
irq_start,
if (gic_irqs > 1020)
gic_irqs = 1020;
gic->gic_irqs = gic_irqs;
+ gic_irqs -= hwirq_base;
- irq_base = irq_alloc_descs(irq_start, 16, gic_irqs - hwirq_base,
+ irq_base = irq_alloc_descs(irq_start, 16, gic_irqs,
numa_node_id());
if (IS_ERR_VALUE(irq_base)) {
WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming
pre-allocated\n",
> + hwirq_base, &gic_irq_domain_ops, gic);
> + if (WARN_ON(!gic->domain))
> + return;
>
> gic_chip.flags |= gic_arch_extn.flags;
> gic_dist_init(gic);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RFCv2 03/14] irq_domain: Make irq_domain structure match powerpc's irq_host
2012-01-24 22:08 ` Grant Likely
@ 2012-01-24 22:11 ` Rob Herring
0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2012-01-24 22:11 UTC (permalink / raw)
To: linux-arm-kernel
On 01/24/2012 04:08 PM, Grant Likely wrote:
> On Tue, Jan 24, 2012 at 2:38 PM, Rob Herring <robherring2@gmail.com> wrote:
>> On 01/23/2012 03:07 PM, Grant Likely wrote:
>>> Part of the series to unify the irq remapping mechanisms in the
>>> kernel. A follow up patch will copy the powerpc implementation into
>>> kernel/irq/irqdomain.c, which will be a lot easier if the structures
>>> are identical.
>>>
>>> Where they differ, I've chose to use the powerpc names since there is
>>> a lot more code using those names.
>>>
>>> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>>> ---
>>> arch/arm/common/gic.c | 14 ++++----
>>> include/linux/irqdomain.h | 84 ++++++++++++++++++++++++++++++++++-----------
>>> kernel/irq/irqdomain.c | 14 ++++----
>>> 3 files changed, 78 insertions(+), 34 deletions(-)
>>>
>>
>> snip...
>>
>>> @@ -126,7 +126,7 @@ void irq_dispose_mapping(unsigned int irq)
>>> }
>>> EXPORT_SYMBOL_GPL(irq_dispose_mapping);
>>>
>>> -int irq_domain_simple_dt_translate(struct irq_domain *d,
>>> +int irq_domain_simple_xlate(struct irq_domain *d,
>>> struct device_node *controller,
>>> const u32 *intspec, unsigned int intsize,
>>> unsigned long *out_hwirq, unsigned int *out_type)
>>
>> This needs a declaration in irqdomain.h (as well as EXPORT?). There
>> could be others as well, but this is the one I'm using for generic irq chip.
>
> Fine by me. I'll add that as a follow-on patch since nothing in-tree
> currently depends on that. It will be in the next version of the
> patch series. Also, are you okay if I rename it to
> irq_domain_generic_xlate()? Simple doesn't really describe it well,
> and it can be used for any interrupt controller implementing the
> binding we've settled on as recommended for new device support.
>
Okay.
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFCv2 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one
2012-01-24 22:10 ` [RFCv2 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one Rob Herring
@ 2012-01-25 0:26 ` Grant Likely
0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2012-01-25 0:26 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jan 24, 2012 at 3:10 PM, Rob Herring <robherring2@gmail.com> wrote:
> On 01/23/2012 03:07 PM, Grant Likely wrote:
>> This patch removes the simplistic implementation of irq_domains and enables
>> the powerpc infrastructure for all irq_domain users. ?The powerpc
>> infrastructure includes support for complex mappings between Linux and
>> hardware irq numbers, and can manage allocation of irq_descs.
>>
>> This patch also converts the few users of irq_domain_add()/irq_domain_del()
>> to call irq_domain_add_legacy() instead.
>>
>> v2: Fix removal of irq_alloc_descs() call in gic driver
>>
>> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>> ---
>> ?arch/arm/common/gic.c ? ? ? ? ? ? ? | ? 85 ++++++++-----------
>> ?arch/arm/common/vic.c ? ? ? ? ? ? ? | ? 16 +---
>> ?arch/arm/include/asm/hardware/gic.h | ? ?4 +-
>> ?arch/arm/include/asm/hardware/vic.h | ? ?2 +
>> ?arch/arm/mach-exynos/common.c ? ? ? | ? ?2 +-
>> ?arch/arm/mach-versatile/core.c ? ? ?| ? ?5 +-
>> ?drivers/mfd/twl-core.c ? ? ? ? ? ? ?| ? 12 +--
>> ?include/linux/irqdomain.h ? ? ? ? ? | ? 45 +---------
>> ?kernel/irq/irqdomain.c ? ? ? ? ? ? ?| ?159 +++--------------------------------
>> ?9 files changed, 69 insertions(+), 261 deletions(-)
>>
>> diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
>
> snip
>
>> @@ -716,17 +708,17 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
>> ? ? ? ? ? ? ? gic_irqs = 1020;
>> ? ? ? gic->gic_irqs = gic_irqs;
>>
>> - ? ? domain->nr_irq = gic_irqs - domain->hwirq_base;
>> - ? ? domain->irq_base = irq_alloc_descs(irq_start, 16, domain->nr_irq,
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?numa_node_id());
>> - ? ? if (IS_ERR_VALUE(domain->irq_base)) {
>> + ? ? irq_base = irq_alloc_descs(irq_start, 16, gic_irqs - hwirq_base,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?numa_node_id());
>> + ? ? if (IS_ERR_VALUE(irq_base)) {
>> ? ? ? ? ? ? ? WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n",
>> ? ? ? ? ? ? ? ? ? ?irq_start);
>> - ? ? ? ? ? ? domain->irq_base = irq_start;
>> + ? ? ? ? ? ? irq_base = irq_start;
>> ? ? ? }
>> - ? ? domain->host_data = gic;
>> - ? ? domain->ops = &gic_irq_domain_ops;
>> - ? ? irq_domain_add(domain);
>> + ? ? gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base,
>
> gic_irqs is wrong here. It needs 16 or 32 subtracted off. This patch
> will fix things:
Good catch, I've integrated this into my series.
g.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-25 0:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1327352870-14687-1-git-send-email-grant.likely@secretlab.ca>
[not found] ` <1327352870-14687-4-git-send-email-grant.likely@secretlab.ca>
2012-01-24 21:38 ` [RFCv2 03/14] irq_domain: Make irq_domain structure match powerpc's irq_host Rob Herring
2012-01-24 22:08 ` Grant Likely
2012-01-24 22:11 ` Rob Herring
[not found] ` <1327352870-14687-14-git-send-email-grant.likely@secretlab.ca>
2012-01-24 22:10 ` [RFCv2 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one Rob Herring
2012-01-25 0:26 ` Grant Likely
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).