Skip to contentSkip to conversation

ARM IRQ Changes

PATCH New Felipe Balbi 5 participants 13 messages Jan 4, 2011 – Jan 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ARM IRQ Changes

Hi all,

a few patches to enable sparse IRQ numbering on OMAP. Also a few cleanups to arch/arm/Kconfig.

for convenience patches are also available from [1]:

[1] git://gitorious.org/usb/usb.git irq

Felipe Balbi (4):
arm: omap: gpio: don't access irq_desc array directly
arm: Kconfig: remove duplicated GENERIC_HARDIRQS entry
arm: Kconfig: remove duplicated SPARSE_IRQ entry
arm: Kconfig: allow OMAP to use sparse IRQ numbering

 arch/arm/Kconfig          |   22 ++++------------------
 arch/arm/plat-omap/gpio.c |   10 +++++++---
 2 files changed, 11 insertions(+), 21 deletions(-)
Signature · 1 line
1.7.3.4.598.g85356
#1 lore raw

PATCH 1/4 arm: omap: gpio: don't access irq_desc array directly

Instead of accessing the irq_desc array directly we can use irq_to_desc(irq). That will allow us to, if wanted, select SPARSE_IRQ and irq_descs will be added to a radix tree, instead of a array.

---
 arch/arm/plat-omap/gpio.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
arch/arm/plat-omap/gpio.c +7 -3
index c05c653..c351758 100644
@@ -905,8 +905,10 @@ static int gpio_irq_type(unsigned irq, unsigned type)
 	spin_lock_irqsave(&bank->lock, flags);
 	retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
 	if (retval == 0) {
-		irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
-		irq_desc[irq].status |= type;
+		struct irq_desc *d = irq_to_desc(irq);
+
+		d->status &= ~IRQ_TYPE_SENSE_MASK;
+		d->status |= type;
 	}
 	spin_unlock_irqrestore(&bank->lock, flags);
 
@@ -1925,7 +1927,9 @@ static int __init _omap_gpio_init(void)
 
 		for (j = bank->virtual_irq_start;
 		     j < bank->virtual_irq_start + gpio_count; j++) {
-			lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class);
+			struct irq_desc *d = irq_to_desc(j);
+
+			lockdep_set_class(&d->lock, &gpio_lock_class);
 			set_irq_chip_data(j, bank);
 			if (bank_is_mpuio(bank))
 				set_irq_chip(j, &mpuio_irq_chip);
Signature · 1 line
1.7.3.4.598.g85356
#2 lore raw

PATCH 1/4 arm: omap: gpio: don't access irq_desc array directly

Quoted 6 lines · Felipe Balbi

Instead of accessing the irq_desc array directly we can use irq_to_desc(irq). That will allow us to, if wanted, select SPARSE_IRQ and irq_descs will be added to a radix tree, instead of a array.

Can you refresh this one against Tony's omap-for-linus branch. The GPIO omap_device/hwmod conversion changed things around a bit and this patch doesn't apply.

After that, you can send separately, and I'll queue this one along with some other GPIO core fixes for the 2.6.38-rc series after -rc1 comes out.

Kevin

Quoted 32 lines
---
 arch/arm/plat-omap/gpio.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
arch/arm/plat-omap/gpio.c +7 -3
index c05c653..c351758 100644
@@ -905,8 +905,10 @@ static int gpio_irq_type(unsigned irq, unsigned type)
 	spin_lock_irqsave(&bank->lock, flags);
 	retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
 	if (retval == 0) {
-		irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
-		irq_desc[irq].status |= type;
+		struct irq_desc *d = irq_to_desc(irq);
+
+		d->status &= ~IRQ_TYPE_SENSE_MASK;
+		d->status |= type;
 	}
 	spin_unlock_irqrestore(&bank->lock, flags);
 
@@ -1925,7 +1927,9 @@ static int __init _omap_gpio_init(void)
 
 		for (j = bank->virtual_irq_start;
 		     j < bank->virtual_irq_start + gpio_count; j++) {
-			lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class);
+			struct irq_desc *d = irq_to_desc(j);
+
+			lockdep_set_class(&d->lock, &gpio_lock_class);
 			set_irq_chip_data(j, bank);
 			if (bank_is_mpuio(bank))
 				set_irq_chip(j, &mpuio_irq_chip);
#3 lore raw

PATCH 1/4 arm: omap: gpio: don't access irq_desc array directly

Quoted 9 lines · Kevin Hilman
Quoted 6 lines · Felipe Balbi

Instead of accessing the irq_desc array directly we can use irq_to_desc(irq). That will allow us to, if wanted, select SPARSE_IRQ and irq_descs will be added to a radix tree, instead of a array.

Quoted 7 lines

Can you refresh this one against Tony's omap-for-linus branch. The GPIO omap_device/hwmod conversion changed things around a bit and this patch doesn't apply.

After that, you can send separately, and I'll queue this one along with some other GPIO core fixes for the 2.6.38-rc series after -rc1 comes out.

Sure, it's attached to this mail.

Signature · 1 line
balbi
#4 lore raw

PATCH 1/4 arm: omap: gpio: don't access irq_desc array directly

Quoted 14 lines · Felipe Balbi
Quoted 13 lines · Kevin Hilman
Quoted 6 lines · Felipe Balbi

Instead of accessing the irq_desc array directly we can use irq_to_desc(irq). That will allow us to, if wanted, select SPARSE_IRQ and irq_descs will be added to a radix tree, instead of a array.

Can you refresh this one against Tony's omap-for-linus branch. The GPIO omap_device/hwmod conversion changed things around a bit and this patch doesn't apply.

Quoted 5 lines
Quoted 3 lines

After that, you can send separately, and I'll queue this one along with some other GPIO core fixes for the 2.6.38-rc series after -rc1 comes out.

Sure, it's attached to this mail.

Thanks. Queueing for 2.6.38-rc

Kevin

Quoted 45 lines

From 8d216ccac14e4eebf259d5b40ed2d239248710e1 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <[email protected]>
Date: Wed, 5 Jan 2011 08:46:18 +0200
Subject: [PATCH] arm: omap: gpio: don't access irq_desc array directly
Organization: Texas Instruments\n

Instead of accessing the irq_desc array directly we can use irq_to_desc(irq). That will allow us to, if wanted, select SPARSE_IRQ and irq_descs will be added to a radix tree, instead of a array.

---
 arch/arm/plat-omap/gpio.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
arch/arm/plat-omap/gpio.c +7 -3
index 1f98e0b..197a6c0 100644
@@ -756,8 +756,10 @@ static int gpio_irq_type(unsigned irq, unsigned type)
 	spin_lock_irqsave(&bank->lock, flags);
 	retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
 	if (retval == 0) {
-		irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
-		irq_desc[irq].status |= type;
+		struct irq_desc *d = irq_to_desc(irq);
+
+		d->status &= ~IRQ_TYPE_SENSE_MASK;
+		d->status |= type;
 	}
 	spin_unlock_irqrestore(&bank->lock, flags);
 
@@ -1671,7 +1673,9 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank)
 
 	for (j = bank->virtual_irq_start;
 		     j < bank->virtual_irq_start + bank_width; j++) {
-		lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class);
+		struct irq_desc *d = irq_to_desc(j);
+
+		lockdep_set_class(&d->lock, &gpio_lock_class);
 		set_irq_chip_data(j, bank);
 		if (bank_is_mpuio(bank))
 			set_irq_chip(j, &mpuio_irq_chip);
#5 lore raw

PATCH 2/4 arm: Kconfig: remove duplicated GENERIC_HARDIRQS entry

In reply to Felipe Balbi

GENERIC_HARDIRQS is defined under kernel/irq/Kconfig, so it's safe to drop the duplicated entry and simply select HAVE_GENERIC_HARDIRQS.

---
 arch/arm/Kconfig |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
arch/arm/Kconfig +1 -7
index d56d21c0..e6f0f8b 100644
@@ -15,6 +15,7 @@ config ARM
 	select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
 	select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
 	select HAVE_GENERIC_DMA_COHERENT
+	select HAVE_GENERIC_HARDIRQS
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZO
 	select HAVE_KERNEL_LZMA
@@ -88,10 +89,6 @@ config MCA
 	  <file:Documentation/mca.txt> (and especially the web page given
 	  there) before attempting to build an MCA bus kernel.
 
-config GENERIC_HARDIRQS
-	bool
-	default y
-
 config STACKTRACE_SUPPORT
 	bool
 	default y
@@ -171,9 +168,6 @@ config FIQ
 config ARCH_MTD_XIP
 	bool
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-	def_bool y
-
 config ARM_L1_CACHE_SHIFT_6
 	bool
 	help
Signature · 1 line
1.7.3.4.598.g85356
#6 lore raw

PATCH 2/4 arm: Kconfig: remove duplicated GENERIC_HARDIRQS entry

Quoted 33 lines · Felipe Balbi

GENERIC_HARDIRQS is defined under kernel/irq/Kconfig, so it's safe to drop the duplicated entry and simply select HAVE_GENERIC_HARDIRQS.

---
 arch/arm/Kconfig |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
arch/arm/Kconfig +1 -4
index d56d21c0..e6f0f8b 100644
@@ -15,6 +15,7 @@ config ARM
 	select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
 	select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
 	select HAVE_GENERIC_DMA_COHERENT
+	select HAVE_GENERIC_HARDIRQS
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZO
 	select HAVE_KERNEL_LZMA
@@ -88,10 +89,6 @@ config MCA
 	  <file:Documentation/mca.txt> (and especially the web page given
 	  there) before attempting to build an MCA bus kernel.
 
-config GENERIC_HARDIRQS
-	bool
-	default y
-
 config STACKTRACE_SUPPORT
 	bool
 	default y

arch/arm/Kconfig config FIQ · line 176

Quoted 6 lines
arch/arm/Kconfig +0 -3
@@ -171,9 +168,6 @@ config FIQ
 config ARCH_MTD_XIP
 	bool
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-	def_bool y
-

You didn't mention this change in the commit log. Is this duplicated, too or did it just slip through?

Uwe

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

PATCH 2/4 arm: Kconfig: remove duplicated GENERIC_HARDIRQS entry

Quoted 37 lines · Uwe Kleine-K?nig
Quoted 36 lines · Felipe Balbi

GENERIC_HARDIRQS is defined under kernel/irq/Kconfig, so it's safe to drop the duplicated entry and simply select HAVE_GENERIC_HARDIRQS.

---
 arch/arm/Kconfig |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
arch/arm/Kconfig +1 -4
index d56d21c0..e6f0f8b 100644
@@ -15,6 +15,7 @@ config ARM
 	select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
 	select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
 	select HAVE_GENERIC_DMA_COHERENT
+	select HAVE_GENERIC_HARDIRQS
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZO
 	select HAVE_KERNEL_LZMA
@@ -88,10 +89,6 @@ config MCA
 	  <file:Documentation/mca.txt> (and especially the web page given
 	  there) before attempting to build an MCA bus kernel.
 
-config GENERIC_HARDIRQS
-	bool
-	default y
-
 config STACKTRACE_SUPPORT
 	bool
 	default y
@@ -171,9 +168,6 @@ config FIQ
 config ARCH_MTD_XIP
 	bool
 
Quoted 5 lines

arch/arm/Kconfig config FIQ · line 176

Quoted 3 lines
arch/arm/Kconfig +0 -3
-config GENERIC_HARDIRQS_NO__DO_IRQ
-	def_bool y
-

You didn't mention this change in the commit log. Is this duplicated, too or did it just slip through?

Yes it is. My bad. Do I need to update the patch ? I can do it tomorrow.

Signature · 1 line
balbi
#8 lore raw

PATCH 2/4 arm: Kconfig: remove duplicated GENERIC_HARDIRQS entry

In reply to Uwe Kleine-König
Quoted 37 lines · Uwe Kleine-K?nig
Quoted 36 lines · Felipe Balbi

GENERIC_HARDIRQS is defined under kernel/irq/Kconfig, so it's safe to drop the duplicated entry and simply select HAVE_GENERIC_HARDIRQS.

---
 arch/arm/Kconfig |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
arch/arm/Kconfig +1 -4
index d56d21c0..e6f0f8b 100644
@@ -15,6 +15,7 @@ config ARM
 	select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
 	select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
 	select HAVE_GENERIC_DMA_COHERENT
+	select HAVE_GENERIC_HARDIRQS
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZO
 	select HAVE_KERNEL_LZMA
@@ -88,10 +89,6 @@ config MCA
 	  <file:Documentation/mca.txt> (and especially the web page given
 	  there) before attempting to build an MCA bus kernel.
 
-config GENERIC_HARDIRQS
-	bool
-	default y
-
 config STACKTRACE_SUPPORT
 	bool
 	default y
@@ -171,9 +168,6 @@ config FIQ
 config ARCH_MTD_XIP
 	bool
 
Quoted 5 lines

arch/arm/Kconfig config FIQ · line 176

Quoted 3 lines
arch/arm/Kconfig +0 -3
-config GENERIC_HARDIRQS_NO__DO_IRQ
-	def_bool y
-

You didn't mention this change in the commit log. Is this duplicated, too or did it just slip through?

If you look at kernel/irq/Kconfig (as I did with the original patch) you'd notice kernel/irq/Kconfig defines both of these symbols being removed when HAVE_GENERIC_HARDIRQS is enabled.

If you read the discussion in the previous version of this patch set, you'd notice that the removal of this was specifically requested.

It's very tiresome to have to re-explain these things. Please take some more time to research the points you bring up, rather than impulse-replying.

#9 lore raw

PATCH 2/4 arm: Kconfig: remove duplicated GENERIC_HARDIRQS entry

Hi Russell,

Quoted 16 lines · Russell King - ARM Linux
Quoted 10 lines · Uwe Kleine-K?nig

arch/arm/Kconfig config FIQ · line 176

Quoted 7 lines · Felipe Balbi
arch/arm/Kconfig +0 -3
@@ -171,9 +168,6 @@ config FIQ
 config ARCH_MTD_XIP
 	bool
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-	def_bool y
-

You didn't mention this change in the commit log. Is this duplicated, too or did it just slip through?

If you look at kernel/irq/Kconfig (as I did with the original patch) you'd notice kernel/irq/Kconfig defines both of these symbols being removed when HAVE_GENERIC_HARDIRQS is enabled.

Quoted 5 lines

If you read the discussion in the previous version of this patch set, you'd notice that the removal of this was specifically requested.

It's very tiresome to have to re-explain these things. Please take some more time to research the points you bring up, rather than

I don't agree here 100%. IMHO the commit log was not good enough for the change introduced by the patch (and Felipe's reply suggests that he agrees). I could still research it, but:

- it was not obvious for me there was a previous version (no "v2" or similar in the patch subject);
- for me it would take say 5 minutes to check, the author knows the answer to my question immediately (at least he should);
- after a research I could suggest a better wording, but I don't care much if it's me or Felipe who comes up with a better text.

So all in all I'm still confident that my mail was OK.

Best regards
Uwe

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

PATCH 2/4 arm: Kconfig: remove duplicated GENERIC_HARDIRQS entry

Hi,

Quoted 13 lines · Uwe Kleine-K?nig
Quoted 9 lines

If you look at kernel/irq/Kconfig (as I did with the original patch) you'd notice kernel/irq/Kconfig defines both of these symbols being removed when HAVE_GENERIC_HARDIRQS is enabled.

If you read the discussion in the previous version of this patch set, you'd notice that the removal of this was specifically requested.

It's very tiresome to have to re-explain these things. Please take some more time to research the points you bring up, rather than

I don't agree here 100%. IMHO the commit log was not good enough for the change introduced by the patch (and Felipe's reply suggests that he agrees). I could still research it, but:

Quoted 8 lines

- it was not obvious for me there was a previous version (no "v2" or similar in the patch subject);
- for me it would take say 5 minutes to check, the author knows the answer to my question immediately (at least he should);
- after a research I could suggest a better wording, but I don't care much if it's me or Felipe who comes up with a better text.

So all in all I'm still confident that my mail was OK.

No need to fight over a simple change, here it is updated.

Signature · 1 line
balbi
#11 lore raw

PATCH 3/4 arm: Kconfig: remove duplicated SPARSE_IRQ entry

In reply to Felipe Balbi

SPARSE_IRQ is defined under kernel/irq/Kconfig so
it's safe to remove the duplicated entry.

---
 arch/arm/Kconfig |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
arch/arm/Kconfig +2 -11
index e6f0f8b..106d9f6 100644
@@ -504,7 +504,7 @@ config ARCH_MMP
 	select GENERIC_CLOCKEVENTS
 	select TICK_ONESHOT
 	select PLAT_PXA
-	select SPARSE_IRQ
+	select HAVE_SPARSE_IRQ
 	help
 	  Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
 
@@ -583,7 +583,7 @@ config ARCH_PXA
 	select GENERIC_CLOCKEVENTS
 	select TICK_ONESHOT
 	select PLAT_PXA
-	select SPARSE_IRQ
+	select HAVE_SPARSE_IRQ
 	help
 	  Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
@@ -1392,15 +1392,6 @@ config HW_PERF_EVENTS
 	  Enable hardware performance counter support for perf events. If
 	  disabled, perf events will use software events only.
 
-config SPARSE_IRQ
-	def_bool n
-	help
-	  This enables support for sparse irqs. This is useful in general
-	  as most CPUs have a fairly sparse array of IRQ vectors, which
-	  the irq_desc then maps directly on to. Systems with a high
-	  number of off-chip IRQs will want to treat this as
-	  experimental until they have been independently verified.
-
 source "mm/Kconfig"
 
 config FORCE_MAX_ZONEORDER
Signature · 1 line
1.7.3.4.598.g85356
#12 lore raw

PATCH 4/4 arm: Kconfig: allow OMAP to use sparse IRQ numbering

In reply to Felipe Balbi

Select HAVE_SPARSE_IRQ to allow OMAP to use sparse IRQ numbering scheme. The main difference is that irq_descs will be added to a radix tree instead of a static array.

---
 arch/arm/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/Kconfig +1 -0
index 106d9f6..2413aa6 100644
@@ -820,6 +820,7 @@ config ARCH_DAVINCI
 config ARCH_OMAP
 	bool "TI OMAP"
 	select HAVE_CLK
+	select HAVE_SPARSE_IRQ
 	select ARCH_REQUIRE_GPIOLIB
 	select ARCH_HAS_CPUFREQ
 	select GENERIC_CLOCKEVENTS
Signature · 1 line
1.7.3.4.598.g85356