All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: VIC: respect list of valid sources
@ 2012-04-18 15:30 Linus Walleij
  2012-04-19 15:44 ` Jamie Iles
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2012-04-18 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Linus Walleij <linus.walleij@linaro.org>

The current IRQ domain implementation in the VIC allocates 32
interrupts for each VIC instance no matter whether the
controller actually use all the IRQs or not. Alter this so
we only allocate a domain up until the last IRQ marked valid.

Cc: Jamie Iles <jamie@jamieiles.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/common/vic.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 7e288f9..c558a3e 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -168,6 +168,7 @@ late_initcall(vic_pm_init);
  * vic_register() - Register a VIC.
  * @base: The base address of the VIC.
  * @irq: The base IRQ for the VIC.
+ * @valid_sources: bitmask of valid interrupts
  * @resume_sources: bitmask of interrupts allowed for resume sources.
  * @node: The device tree node associated with the VIC.
  *
@@ -178,7 +179,8 @@ late_initcall(vic_pm_init);
  * This also configures the IRQ domain for the VIC.
  */
 static void __init vic_register(void __iomem *base, unsigned int irq,
-				u32 resume_sources, struct device_node *node)
+				u32 valid_sources, u32 resume_sources,
+				struct device_node *node)
 {
 	struct vic_device *v;
 
@@ -192,8 +194,8 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
 	v->resume_sources = resume_sources;
 	v->irq = irq;
 	vic_id++;
-	v->domain = irq_domain_add_legacy(node, 32, irq, 0,
-					  &irq_domain_simple_ops, v);
+	v->domain = irq_domain_add_legacy(node, fls(valid_sources), irq, 0,
+					  &vic_irqdomain_ops, v);
 }
 
 static void vic_ack_irq(struct irq_data *d)
@@ -339,7 +341,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
 	}
 
 	vic_set_irq_sources(base, irq_start, vic_sources);
-	vic_register(base, irq_start, 0, node);
+	vic_register(base, irq_start, vic_sources, 0, node);
 }
 
 void __init __vic_init(void __iomem *base, unsigned int irq_start,
@@ -381,7 +383,7 @@ void __init __vic_init(void __iomem *base, unsigned int irq_start,
 
 	vic_set_irq_sources(base, irq_start, vic_sources);
 
-	vic_register(base, irq_start, resume_sources, node);
+	vic_register(base, irq_start, vic_sources, resume_sources, node);
 }
 
 /**
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 1/2] ARM: VIC: respect list of valid sources
  2012-04-18 15:30 [PATCH 1/2] ARM: VIC: respect list of valid sources Linus Walleij
@ 2012-04-19 15:44 ` Jamie Iles
  0 siblings, 0 replies; 2+ messages in thread
From: Jamie Iles @ 2012-04-19 15:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 18, 2012 at 05:30:43PM +0200, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> The current IRQ domain implementation in the VIC allocates 32
> interrupts for each VIC instance no matter whether the
> controller actually use all the IRQs or not. Alter this so
> we only allocate a domain up until the last IRQ marked valid.
> 
> Cc: Jamie Iles <jamie@jamieiles.com>

Looks good to me.

Reviewed-by: Jamie Iles <jamie@jamieiles.com>

Jamie

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-19 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 15:30 [PATCH 1/2] ARM: VIC: respect list of valid sources Linus Walleij
2012-04-19 15:44 ` Jamie Iles

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.