RE: 3.10.9-rt5 with Atmel AT91SAM9G25 SoC triggers "Trying to free already-free IRQ 1"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems that there is an irq number mismatch in the "arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch".
The patch adds setup_irq() and remove_irq() calls which have different irq number than the base driver.

If I'm correct, the irq number should be NR_IRQS_LEGACY + AT91_ID_SYS instead of only AT91_ID_SYS.

I have attached a fixed patch for 3.6.9-rt21. I tested it with SAMA5D35, and it removed the 
"Trying to free already-free IRQ 1" boot warnings.

BR,
Sami Pietikäinen

Index: linux-stable/arch/arm/mach-at91/at91rm9200_time.c
===================================================================
--- linux-stable.orig/arch/arm/mach-at91/at91rm9200_time.c
+++ linux-stable/arch/arm/mach-at91/at91rm9200_time.c
@@ -130,6 +130,7 @@ clkevt32k_mode(enum clock_event_mode mod
 		break;
 	case CLOCK_EVT_MODE_SHUTDOWN:
 	case CLOCK_EVT_MODE_UNUSED:
+		remove_irq(NR_IRQS_LEGACY + AT91_ID_SYS, &at91rm9200_timer_irq);
 	case CLOCK_EVT_MODE_RESUME:
 		irqmask = 0;
 		break;
Index: linux-stable/arch/arm/mach-at91/at91sam926x_time.c
===================================================================
--- linux-stable.orig/arch/arm/mach-at91/at91sam926x_time.c
+++ linux-stable/arch/arm/mach-at91/at91sam926x_time.c
@@ -67,7 +67,7 @@ static struct clocksource pit_clk = {
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-
+static struct irqaction at91sam926x_pit_irq;
 /*
  * Clockevent device:  interrupts every 1/HZ (== pit_cycles * MCK/16)
  */
@@ -76,6 +76,8 @@ pit_clkevt_mode(enum clock_event_mode mo
 {
 	switch (mode) {
 	case CLOCK_EVT_MODE_PERIODIC:
+		/* Set up irq handler */
+		setup_irq(at91sam926x_pit_irq.irq, &at91sam926x_pit_irq);
 		/* update clocksource counter */
 		pit_cnt += pit_cycle * PIT_PICNT(pit_read(AT91_PIT_PIVR));
 		pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
@@ -88,6 +90,7 @@ pit_clkevt_mode(enum clock_event_mode mo
 	case CLOCK_EVT_MODE_UNUSED:
 		/* disable irq, leaving the clocksource active */
 		pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
+		remove_irq(at91sam926x_pit_irq.irq, &at91sam926x_pit_irq);
 		break;
 	case CLOCK_EVT_MODE_RESUME:
 		break;


��.n��������+%������w��{.n�����{�����ǫ���ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux