ARM: at91: fix drivers broken because of sparse irq support
Subsystems (4)
cover ARM: at91: fix drivers broken because of sparse irq support
From: Ludovic Desroches <[email protected]>
Hello,
This patch fixes the rm9200 breakage (introduced by sparse irq support) reported by Joachim Eastwood.
Regards
Ludovic
Ludovic Desroches (1):
ARM: at91: fix drivers broken because of sparse irq support
arch/arm/mach-at91/at91rm9200_time.c | 2 +- drivers/rtc/rtc-at91sam9.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.11.3
PATCH 1/1 ARM: at91: fix drivers broken because of sparse irq support
From: Ludovic Desroches <[email protected]>
Some drivers directly use AT91_ID_SYS as virq so they are broken because of the NR_IRQS_LEGACY virq offset introduced with sparse irq support.
--- arch/arm/mach-at91/at91rm9200_time.c | 2 +- drivers/rtc/rtc-at91sam9.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-)
arch/arm/mach-at91/at91rm9200_time.c +1 -1
@@ -197,7 +197,7 @@ void __init at91rm9200_timer_init(void)at91_st_read (AT91_ST_SR );/* Make IRQs happen for the system timer */ -setup_irq (AT91_ID_SYS , &at91rm9200_timer_irq); +setup_irq (NR_IRQS_LEGACY +AT91_ID_SYS , &at91rm9200_timer_irq);/* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used * directly for the clocksource and all clockevents, after adjusting
drivers/rtc/rtc-at91sam9.c +6 -5
@@ -345,11 +345,12 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) }/* register irq handler after we know what name we'll use */ - ret =request_irq (AT91_ID_SYS , at91_rtc_interrupt, + ret =request_irq (NR_IRQS_LEGACY +AT91_ID_SYS , at91_rtc_interrupt,IRQF_SHARED ,dev_name (&rtc->rtcdev->dev), rtc);if (ret) { -dev_dbg (&pdev->dev,"can't share IRQ %d?\n" ,AT91_ID_SYS ); +dev_dbg (&pdev->dev,"can't share IRQ %d?\n" , +NR_IRQS_LEGACY +AT91_ID_SYS );rtc_device_unregister (rtc->rtcdev); goto fail_register; }
@@ -386,7 +387,7 @@ static int __devexit at91_rtc_remove(struct platform_device *pdev)/* disable all interrupts */ rtt_writel (rtc,MR , mr & ~(AT91_RTT_ALMIEN |AT91_RTT_RTTINCIEN )); -free_irq (AT91_ID_SYS , rtc); +free_irq (NR_IRQS_LEGACY +AT91_ID_SYS , rtc);rtc_device_unregister (rtc->rtcdev);
@@ -423,7 +424,7 @@ static int at91_rtc_suspend(struct platform_device *pdev, rtc->imr = mr & (AT91_RTT_ALMIEN |AT91_RTT_RTTINCIEN );if (rtc->imr) {if (device_may_wakeup (&pdev->dev) && (mr &AT91_RTT_ALMIEN )) { -enable_irq_wake (AT91_ID_SYS ); +enable_irq_wake (NR_IRQS_LEGACY +AT91_ID_SYS );/* don't let RTTINC cause wakeups */ if (mr &AT91_RTT_RTTINCIEN )rtt_writel (rtc,MR , mr & ~AT91_RTT_RTTINCIEN );
@@ -441,7 +442,7 @@ static int at91_rtc_resume(struct platform_device *pdev)if (rtc->imr) {if (device_may_wakeup (&pdev->dev)) -disable_irq_wake (AT91_ID_SYS ); +disable_irq_wake (NR_IRQS_LEGACY +AT91_ID_SYS ); mr =rtt_readl (rtc,MR );rtt_writel (rtc,MR , mr | rtc->imr); }
Signature · 1 line
1.7.11.3
PATCH 1/1 ARM: at91: fix drivers broken because of sparse irq support
Hi Ludovic,
Quoted 4 lines · On Mon, Aug 13, 2012 at 5:38 PM, <[email protected]> wrote:
From: Ludovic Desroches <[email protected]>
Some drivers directly use
AT91_ID_SYSas virq so they are broken because of theNR_IRQS_LEGACYvirq offset introduced with sparse irq support.
This patch makes my board boot again. Thanks.
Feel free to add;
Quoted 2 lines
Signed-off-by Ludovic Desroches <[email protected]>Cc stable at vger.kernel.org
Why are you sending this to stable?
This is a regression only in 3.6 and should go upstream ASAP.
regards
Joachim Eastwood
PATCH 1/1 ARM: at91: fix drivers broken because of sparse irq support
In reply to ludovic.desroches at atmel.comQuoted 30 lines · ludovic.desroches at atmel.com
From: Ludovic Desroches <[email protected]>
Some drivers directly use
AT91_ID_SYSas virq so they are broken because of theNR_IRQS_LEGACYvirq offset introduced with sparse irq support.Signed-off-by Ludovic Desroches <[email protected]>Cc stable at vger.kernel.org--- arch/arm/mach-at91/at91rm9200_time.c | 2 +- drivers/rtc/rtc-at91sam9.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-)arch/arm/mach-at91/at91rm9200_time.c +1
-1@@ -197,7 +197,7 @@ void __init at91rm9200_timer_init(void)at91_st_read (AT91_ST_SR );/* Make IRQs happen for the system timer */ -setup_irq (AT91_ID_SYS , &at91rm9200_timer_irq); +setup_irq (NR_IRQS_LEGACY +AT91_ID_SYS , &at91rm9200_timer_irq);/* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used * directly for the clocksource and all clockevents, after adjusting drivers/rtc/rtc-at91sam9.c +0
-0
drivers/rtc/rtc-at91sam9.c static int __devinit at91_rtc_probe(struct platform_device *pdev) · line 348
Quoted 5 lines
drivers/rtc/rtc-at91sam9.c +1
-1@@ -345,11 +345,12 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) }/* register irq handler after we know what name we'll use */ - ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt, + ret = request_irq(NR_IRQS_LEGACY + AT91_ID_SYS, at91_rtc_interrupt,
the irq need to be pass by resources and not hardcoded
Best Regrds,
J.