[PATCH 4/5] ARM: pxa: Fix suspend/resume array index miscalculation

Marek Vasut marek.vasut at gmail.com
Mon Jan 10 18:13:05 EST 2011


On Monday 10 January 2011 23:49:07 Eric Miao wrote:
> On Sun, Jan 9, 2011 at 5:29 PM, Marek Vasut <marek.vasut at gmail.com> wrote:
> > Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
> > ---
> >  arch/arm/mach-pxa/irq.c |   10 +++++-----
> >  1 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
> > index 78f0e0c..81edf97 100644
> > --- a/arch/arm/mach-pxa/irq.c
> > +++ b/arch/arm/mach-pxa/irq.c
> > @@ -194,14 +194,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
> > 
> >  #ifdef CONFIG_PM
> >  static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
> > -static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
> > +static unsigned long saved_ipr[MAX_INTERNAL_IRQS/32];
> 
> This isn't right I'm afraid. Unlike other IRQ registers, each interrupt
> line has its own IPR register. So the changes below are also invalid.

You're right, stupid me ... I just noticed it too (unlike your email). Can you 
check v2 please ?

Cheers
> 
> >  static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
> >  {
> >        int i;
> > 
> > -       for (i = 0; i < pxa_internal_irq_nr; i += 32) {
> > -               void __iomem *base = irq_base(i);
> > +       for (i = 0; i < pxa_internal_irq_nr; i++) {
> > +               void __iomem *base = irq_base(i << 5);
> > 
> >                saved_icmr[i] = __raw_readl(base + ICMR);
> >                __raw_writel(0, base + ICMR);
> > @@ -219,8 +219,8 @@ static int pxa_irq_resume(struct sys_device *dev)
> >  {
> >        int i;
> > 
> > -       for (i = 0; i < pxa_internal_irq_nr; i += 32) {
> > -               void __iomem *base = irq_base(i);
> > +       for (i = 0; i < pxa_internal_irq_nr; i++) {
> > +               void __iomem *base = irq_base(i << 5);
> > 
> >                __raw_writel(saved_icmr[i], base + ICMR);
> >                __raw_writel(0, base + ICLR);
> > --
> > 1.7.2.3



More information about the linux-arm-kernel mailing list