Skip to contentSkip to conversation

arm: bug fixes and irq cleanup (v2) for .39

PATCH New Thomas Gleixner 6 participants 38 messages Mar 28, 2011 – Apr 19, 2011 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

cover arm: bug fixes and irq cleanup (v2) for .39

The following series contains a few bugfixes, which I made in order to compile the irq cleanup series.

The irq cleanup series is almost the same except for a few typo fixups and does not longer remove the tegra resume/suspend stuff, but removes the irq fiddling inside.

For your conveniance the series is also available from:

    git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git irq/for-arm

once the mirror decided to sync.

Please let me know how to proceed with this lot.

Thanks,

tglx

#4 lore raw

PATCH 3/29 arm: at91: at572d940hf: Fix SDRAMC define

Le 28/03/2011 19:12, Thomas Gleixner :

Quoted 3 lines

That wants to be AT91_SDRAMC0

Quoted 25 lines
---
 arch/arm/mach-at91/include/mach/at572d940hf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-tip/arch/arm/mach-at91/include/mach/at572d940hf.h
===================================================================

arch/arm/mach-at91/include/mach/at572d940hf.h +1 -1
@@ -89,7 +89,7 @@
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_SDRAMC	(0xffffea00 - AT91_BASE_SYS)
+#define AT91_SDRAMC0	(0xffffea00 - AT91_BASE_SYS)
 #define AT91_SMC	(0xffffec00 - AT91_BASE_SYS)
 #define AT91_MATRIX	(0xffffee00 - AT91_BASE_SYS)
 #define AT91_AIC	(0xfffff000 - AT91_BASE_SYS)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 1 line
Nicolas Ferre
#8 lore raw

PATCH 6/29 arm: nomadik: Remove non existing cpu id check

Quoted 10 lines · Thomas Gleixner

---
?arch/arm/plat-nomadik/gpio.c | ? ?7 -------
?1 file changed, 7 deletions(-)

Index: linux-2.6-tip/arch/arm/plat-nomadik/gpio.c
===================================================================

arch/arm/plat-nomadik/gpio.c static void __nmk_gpio_irq_modify(struct · line 544

Quoted 4 lines
arch/arm/plat-nomadik/gpio.c +0 -1
@@ -541,13 +541,6 @@ static void __nmk_gpio_irq_modify(struct
 ?static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip,
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?int gpio, bool on)
 ?{
-#ifdef CONFIG_ARCH_U8500

This architecture does exist.

arch/arm/plat-nomadik/gpio.c static void __nmk_gpio_irq_modify(struct · line 546

Quoted 9 lines
arch/arm/plat-nomadik/gpio.c +0 -6
- ? ? ? if (cpu_is_u8500v2()) {
- ? ? ? ? ? ? ? __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base,
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? on ? NMK_GPIO_SLPM_WAKEUP_ENABLE
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: NMK_GPIO_SLPM_WAKEUP_DISABLE);
- ? ? ? }
-#endif
 ? ? ? ?__nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, on);
 ?}
 

srinidhi

#11 lore raw

PATCH 8/29 arm: tegra: Remove unused bogus irq enable/disable magic

Quoted 1 line · Thomas Gleixner

The core code handles thees already.

thees -> these

Quoted 38 lines
Cc Colin Cross <[email protected]>
Cc linux-tegra at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org

---
?arch/arm/mach-tegra/gpio.c | ? 19 ------------------- ?1 file changed, 19 deletions(-)

Index: linux-2.6-tip/arch/arm/mach-tegra/gpio.c
===================================================================

arch/arm/mach-tegra/gpio.c +0 -12
@@ -275,13 +275,6 @@ void tegra_gpio_resume(void)
 ? ? ? ?}
 
 ? ? ? ?local_irq_restore(flags);
-
- ? ? ? for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
- ? ? ? ? ? ? ? struct irq_desc *desc = irq_to_desc(i);
- ? ? ? ? ? ? ? if (!desc || (desc->status & IRQ_WAKEUP))
- ? ? ? ? ? ? ? ? ? ? ? continue;
- ? ? ? ? ? ? ? enable_irq(i);
- ? ? ? }
 ?}
 
 ?void tegra_gpio_suspend(void)
@@ -289,18 +282,6 @@ void tegra_gpio_suspend(void)
 ? ? ? ?unsigned long flags;
 ? ? ? ?int b, p, i;
 
- ? ? ? for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
- ? ? ? ? ? ? ? struct irq_desc *desc = irq_to_desc(i);
- ? ? ? ? ? ? ? if (!desc)
- ? ? ? ? ? ? ? ? ? ? ? continue;
- ? ? ? ? ? ? ? if (desc->status & IRQ_WAKEUP) {

arch/arm/mach-tegra/gpio.c void tegra_gpio_suspend(void) · line 287

Quoted 10 lines
arch/arm/mach-tegra/gpio.c +0 -7
- ? ? ? ? ? ? ? ? ? ? ? int gpio = i - INT_GPIO_BASE;
- ? ? ? ? ? ? ? ? ? ? ? pr_debug("gpio %d.%d is wakeup\n", gpio/8, gpio&7);
- ? ? ? ? ? ? ? ? ? ? ? continue;
- ? ? ? ? ? ? ? }
- ? ? ? ? ? ? ? disable_irq(i);
- ? ? ? }
-
 ? ? ? ?local_irq_save(flags);
 ? ? ? ?for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) {
 ? ? ? ? ? ? ? ?struct tegra_gpio_bank *bank = &tegra_gpio_banks[b];

This will cause warnings in both the suspend and resume functions as i is now unused.

Other than that:

Do you want me to take this through the Tegra tree for 2.6.39-rc1?

#12 lore raw

PATCH 8/29 arm: tegra: Remove unused bogus irq enable/disable magic

Quoted 6 lines · Colin Cross

On Mon, Mar 28, 2011 at 10:12 AM, Thomas Gleixner <[email protected]> wrote:

Other than that:

Do you want me to take this through the Tegra tree for 2.6.39-rc1?

Either way is fine.

Thanks,

tglx

#28 lore raw

PATCH 23/29 arm: at91: Cleanup irq chip

Le 28/03/2011 19:12, Thomas Gleixner :

Quoted 6 lines

Avoid the whole lazy disable dance in the demux handler by providing a irq_disable() callback.

Use the proper accessor functions and tidy up gpio_irq_handler()

Seems ok.

Quoted 77 lines
---
 arch/arm/mach-at91/gpio.c |   31 +++++++++----------------------
 1 file changed, 9 insertions(+), 22 deletions(-)

Index: linux-2.6-tip/arch/arm/mach-at91/gpio.c
===================================================================

arch/arm/mach-at91/gpio.c +9 -22
@@ -375,6 +375,7 @@ static int gpio_irq_type(struct irq_data
 
 static struct irq_chip gpio_irqchip = {
 	.name		= "GPIO",
+	.irq_disable	= gpio_irq_mask,
 	.irq_mask	= gpio_irq_mask,
 	.irq_unmask	= gpio_irq_unmask,
 	.irq_set_type	= gpio_irq_type,
@@ -384,16 +385,14 @@ static struct irq_chip gpio_irqchip = {
 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
 {
 	unsigned	pin;
-	struct irq_desc	*gpio;
-	struct at91_gpio_chip *at91_gpio;
-	void __iomem	*pio;
+	struct irq_data *idata = irq_desc_get_irq_data(desc);
+	struct irq_chip *chip = irq_data_get_irq_chip(idata);
+	struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(idata);
+	void __iomem	*pio = at91_gpio->regbase;
 	u32		isr;
 
-	at91_gpio = get_irq_chip_data(irq);
-	pio = at91_gpio->regbase;
-
 	/* temporarily mask (level sensitive) parent IRQ */
-	desc->irq_data.chip->irq_ack(&desc->irq_data);
+	chip->irq_ack(idata);
 	for (;;) {
 		/* Reading ISR acks pending (edge triggered) GPIO interrupts.
 		 * When there none are pending, we're finished unless we need
@@ -409,27 +408,15 @@ static void gpio_irq_handler(unsigned ir
 		}
 
 		pin = at91_gpio->chip.base;
-		gpio = &irq_desc[pin];
 
 		while (isr) {
-			if (isr & 1) {
-				if (unlikely(gpio->depth)) {
-					/*
-					 * The core ARM interrupt handler lazily disables IRQs so
-					 * another IRQ must be generated before it actually gets
-					 * here to be disabled on the GPIO controller.
-					 */
-					gpio_irq_mask(irq_get_irq_data(pin));
-				}
-				else
-					generic_handle_irq(pin);
-			}
+			if (isr & 1)
+				generic_handle_irq(pin);
 			pin++;
-			gpio++;
 			isr >>= 1;
 		}
 	}
-	desc->irq_data.chip->irq_unmask(&desc->irq_data);
+	chip->irq_unmask(idata);
 	/* now it may re-trigger */
 }
 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 1 line
Nicolas Ferre
#33 lore raw

PATCH 27/29 arm: Cleanup the irq namespace

Quoted 40 lines · Thomas Gleixner

Convert to the new function names. Automated with coccinelle.

---
 arch/arm/mach-ep93xx/gpio.c                    |   31 +++++++++++------

Index: linux-2.6-tip/arch/arm/mach-ep93xx/gpio.c
===================================================================

arch/arm/mach-ep93xx/gpio.c +11 -11
@@ -231,20 +231,29 @@ void __init ep93xx_gpio_init_irq(void)
 
 	for (gpio_irq = gpio_to_irq(0);
 	     gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
-		set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip);
-		set_irq_handler(gpio_irq, handle_level_irq);
+		irq_set_chip(gpio_irq, &ep93xx_gpio_irq_chip);
+		irq_set_handler(gpio_irq, handle_level_irq);
 		set_irq_flags(gpio_irq, IRQF_VALID);
 	}
 
-	set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler);
-	set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO_AB,
+				ep93xx_gpio_ab_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO0MUX,
+				ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO1MUX,
+				ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO2MUX,
+				ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO3MUX,

arch/arm/mach-ep93xx/gpio.c void __init ep93xx_gpio_init_irq(void) · line 257

Quoted 10 lines
arch/arm/mach-ep93xx/gpio.c +9 -0
+				ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO4MUX,
+				ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO5MUX,
+				ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO6MUX,
+				ep93xx_gpio_f_irq_handler);
+	irq_set_chained_handler(IRQ_EP93XX_GPIO7MUX,
+				ep93xx_gpio_f_irq_handler);
 }

I would suggest keeping these as one line each just for readability.

Other than that:

#34 lore raw

PATCH 27/29 arm: Cleanup the irq namespace

In reply to Thomas Gleixner
Quoted 10 lines · Thomas Gleixner

Convert to the new function names. Automated with coccinelle.

---
[...]

 arch/arm/plat-mxc/3ds_debugboard.c             |    8 ++--
 arch/arm/plat-mxc/avic.c                       |    4 +-
 arch/arm/plat-mxc/gpio.c                       |   24 +++++++------
 arch/arm/plat-mxc/irq-common.c                 |    4 +-
 arch/arm/plat-mxc/tzic.c                       |    4 +-

for your changes to arch/arm/plat-mxc.

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#37 lore raw

PATCH 29/29 arm: Fold irq_set_chip/irq_set_handler

Le 28/03/2011 19:12, Thomas Gleixner :

Quoted 3 lines

Use irq_set_chip_and_handler() instead. Converted with coccinelle.

Quoted 1 line

---

[..]

Quoted 2 lines
 arch/arm/mach-at91/gpio.c               |    4 ++--
 arch/arm/mach-at91/irq.c                |    3 +--

[..]

Quoted 20 lines

Index: linux-2.6-tip/arch/arm/mach-at91/gpio.c
===================================================================

arch/arm/mach-at91/gpio.c +2 -2
@@ -511,8 +511,8 @@ void __init at91_gpio_irq_setup(void)
 			 * Can use the "simple" and not "edge" handler since it's
 			 * shorter, and the AIC handles interrupts sanely.
 			 */
-			irq_set_chip(pin, &gpio_irqchip);
-			irq_set_handler(pin, handle_simple_irq);
+			irq_set_chip_and_handler(pin, &gpio_irqchip,
+						 handle_simple_irq);
 			set_irq_flags(pin, IRQF_VALID);
 		}
 

Index: linux-2.6-tip/arch/arm/mach-at91/irq.c
===================================================================

arch/arm/mach-at91/irq.c void __init at91_aic_init(unsigned int p · line 149

Quoted 9 lines
arch/arm/mach-at91/irq.c +1 -2
@@ -143,8 +143,7 @@ void __init at91_aic_init(unsigned int p
 		/* Active Low interrupt, with the specified priority */
 		at91_sys_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
 
-		irq_set_chip(i, &at91_aic_chip);
-		irq_set_handler(i, handle_level_irq);
+		irq_set_chip_and_handler(i, &at91_aic_chip, handle_level_irq);
 		set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
 
 		/* Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nIRQ */

[..]

Thanks a lot Thomas,

Best regards,

Signature · 1 line
Nicolas Ferre