[PATCH 3/5] ARM: OMAP2+: wakeupgen: Fix wrong array size for irq_target_cpu

2012-02-23 Thread Benoit Cousson
The wakeupgen was wrongly allocating an array based on the
NR_IRQS value (410 on OMAP4) whereas it is just capable of handling 128
entries.
Moreover with SPARSE_IRQ, the NR_IRQS number might be 16, and thus
cannot handle the proper number of entries. It will generate an oops as
soon a driver will request an IRQ  16.

Allocate the array using the fixed MAX_IRQS value (128).

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Santosh Shilimkar santosh.shilim...@ti.com
---
 arch/arm/mach-omap2/omap-wakeupgen.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c 
b/arch/arm/mach-omap2/omap-wakeupgen.c
index d3d8971..bec55e1 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -45,7 +45,7 @@ static void __iomem *wakeupgen_base;
 static void __iomem *sar_base;
 static DEFINE_PER_CPU(u32 [NR_REG_BANKS], irqmasks);
 static DEFINE_SPINLOCK(wakeupgen_lock);
-static unsigned int irq_target_cpu[NR_IRQS];
+static unsigned int irq_target_cpu[MAX_IRQS];
 
 /*
  * Static helper functions.
@@ -379,7 +379,7 @@ int __init omap_wakeupgen_init(void)
 */
 
/* Associate all the IRQs to boot CPU like GIC init does. */
-   for (i = 0; i  NR_IRQS; i++)
+   for (i = 0; i  MAX_IRQS; i++)
irq_target_cpu[i] = boot_cpu;
 
irq_hotplug_init();
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/5] ARM: OMAP2+: wakeupgen: Fix wrong array size for irq_target_cpu

2012-02-23 Thread Shilimkar, Santosh
On Fri, Feb 24, 2012 at 3:53 AM, Benoit Cousson b-cous...@ti.com wrote:
 The wakeupgen was wrongly allocating an array based on the
 NR_IRQS value (410 on OMAP4) whereas it is just capable of handling 128
 entries.
 Moreover with SPARSE_IRQ, the NR_IRQS number might be 16, and thus
 cannot handle the proper number of entries. It will generate an oops as
 soon a driver will request an IRQ  16.

 Allocate the array using the fixed MAX_IRQS value (128).

 Signed-off-by: Benoit Cousson b-cous...@ti.com
 Cc: Santosh Shilimkar santosh.shilim...@ti.com
 ---
  arch/arm/mach-omap2/omap-wakeupgen.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

Right.
Acked-by: Santosh Shilimkar santosh.shilim...@ti.com
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html