[PATCH] fix-s3c-eint-offset-calc-error.patch

Ben Dooks ben-linux at fluff.org
Thu Dec 11 13:55:21 CET 2008


On Thu, Dec 04, 2008 at 08:48:18PM +0000, Andy Green wrote:
> There's a bug in calculation of IRQ_EINT_BIT introduced on the test
> branch for pm changes for s3c by Ben Dooks fixed in this patch.
> 
> There's also a bit of a mystery about how wake gets to wake EINT
> set of interrupts, I added a couple of lines that make it work for
> EINT4+ but not sure what's meant to be there for EINT0-3.
> 
> Still, this gets GTA02 resume working again.
> 
> cc: Ben Dooks <ben-linux at fluff.org>
> Signed-off-by: Andy Green <andy at openmoko.com>
> ---
> 
>  arch/arm/mach-s3c2410/include/mach/irqs.h |    2 +-
>  arch/arm/plat-s3c24xx/irq-pm.c            |    3 +++
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
> index 4a82338..1d0629d 100644
> --- a/arch/arm/mach-s3c2410/include/mach/irqs.h
> +++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
> @@ -84,7 +84,7 @@
>  #define IRQ_EINT22     S3C2410_IRQ(50)
>  #define IRQ_EINT23     S3C2410_IRQ(51)
>  
> -#define IRQ_EINT_BIT(x)	((x) - (IRQ_EINT4 + 4))
> +#define IRQ_EINT_BIT(x)	((x) - IRQ_EINT4 + 4)
>  #define IRQ_EINT(x)    (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x)))
>  
>  #define IRQ_LCD_FIFO   S3C2410_IRQ(52)

What I meant to say, is that I've applied this fix.

> diff --git a/arch/arm/plat-s3c24xx/irq-pm.c b/arch/arm/plat-s3c24xx/irq-pm.c
> index b7acf1a..87bda52 100644
> --- a/arch/arm/plat-s3c24xx/irq-pm.c
> +++ b/arch/arm/plat-s3c24xx/irq-pm.c
> @@ -34,6 +34,9 @@ int s3c_irq_wake(unsigned int irqno, unsigned int state)
>  {
>  	unsigned long irqbit = 1 << (irqno - IRQ_EINT0);
>  
> +	if (irqno >= IRQ_EINT4)
> +		return s3c_irqext_wake(irqno, state);
> +
>  	if (!(s3c_irqwake_intallow & irqbit))
>  		return -ENOENT;

IRQ_EINT4+ should have been handled directly by s3c_irqext_wake which
should have been in the irq chip it was registered with.

from arch/arm/plat-s3c24xx/irq.c:
static struct irq_chip s3c_irqext_chip = {
	...
        .set_type       = s3c_irqext_type,
        .set_wake       = s3c_irqext_wake
};

and
        for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
		...
                set_irq_chip(irqno, &s3c_irqext_chip);
		...
	}

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.




More information about the openmoko-kernel mailing list