Commit c482ae4d authored by Haojian Zhuang's avatar Haojian Zhuang Committed by Eric Miao

[ARM] pxa: fix resume failure by saving/restoring IPRx registers

Since interrupt handler is changed to use interrupt priority, we also need
to save and restore these interrupt controller registers in suspend/resume
routine.
Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@marvell.com>
Tested-by: default avatarDaniel Mack <daniel@caiaq.de>
Tested-by: default avatarPavel Machek <pavel@ucw.cz>
Tested-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 902805db
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "generic.h" #include "generic.h"
#define MAX_INTERNAL_IRQS 128
#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR)) #define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR)) #define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
...@@ -122,6 +124,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn) ...@@ -122,6 +124,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
{ {
int irq, i; int irq, i;
BUG_ON(irq_nr > MAX_INTERNAL_IRQS);
pxa_internal_irq_nr = irq_nr; pxa_internal_irq_nr = irq_nr;
for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) {
...@@ -149,7 +153,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn) ...@@ -149,7 +153,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static unsigned long saved_icmr[2]; static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
{ {
...@@ -159,6 +164,8 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) ...@@ -159,6 +164,8 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
saved_icmr[i] = _ICMR(irq); saved_icmr[i] = _ICMR(irq);
_ICMR(irq) = 0; _ICMR(irq) = 0;
} }
for (i = 0; i < pxa_internal_irq_nr; i++)
saved_ipr[i] = IPR(i);
return 0; return 0;
} }
...@@ -171,6 +178,8 @@ static int pxa_irq_resume(struct sys_device *dev) ...@@ -171,6 +178,8 @@ static int pxa_irq_resume(struct sys_device *dev)
_ICMR(irq) = saved_icmr[i]; _ICMR(irq) = saved_icmr[i];
_ICLR(irq) = 0; _ICLR(irq) = 0;
} }
for (i = 0; i < pxa_internal_irq_nr; i++)
IPR(i) = saved_ipr[i];
ICCR = 1; ICCR = 1;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment