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

Sergei Shtylyov sshtylyov at mvista.com
Mon Jan 10 07:09:35 EST 2011


On 10-01-2011 2:29, Marek Vasut 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];
>
>   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++) {

    Won't the loop condition also have to change?

> +		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++) {

    Same question here...

> +		void __iomem *base = irq_base(i << 5);
>
>   		__raw_writel(saved_icmr[i], base + ICMR);
>   		__raw_writel(0, base + ICLR);

WBR, Sergei



More information about the linux-arm-kernel mailing list