Skip to contentSkip to conversation

__do_IRQ() going away

PATCH Ralf Baechle 4 participants 7 messages Mar 11, 2009 – Mar 13, 2009 MIPS

lore
Share & tools
lore
#0 lore raw

__do_IRQ() is deprecated since a long time and there are plans to remove it for 2.6.30. The MIPS platforms seem to fall into three classes:

o Platforms setting CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ to explicitly disable __do_IRQ():

	capcella_defconfig, cobalt_defconfig, e55_defconfig,
	fulong_defconfig, ip27_defconfig, jazz_defconfig, jmr3927_defconfig,
	lasat_defconfig, mpc30x_defconfig, pnx8335-stb225_defconfig,
	pnx8550-jbs_defconfig, pnx8550-stb810_defconfig, rb532_defconfig,
	rbtx49xx_defconfig, tb0219_defconfig, tb0226_defconfig,
	tb0287_defconfig and workpad_defconfig.

o Platforms that don't set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ but don't seem to use __do_IRQ():

bcm47xx_defconfig, cavium-octeon_defconfig, excite_defconfig, ip22_defconfig, ip28_defconfig, msp71xx_defconfig, wrppmc_defconfig,

o Platforms that still seem to rely on __do_IRQ():
o All Sibyte platforms:
bigsur_defconfig and sb1250-swarm_defconfig

o All Alchemy platforms:
db1000_defconfig, db1100_defconfig, db1200_defconfig, db1500_defconfig, db1550_defconfig, mtx1_defconfig, pb1100_defconfig, pb1500_defconfig and pb1550_defconfig

o malta_defconfig. The platform code itself is ok but irq-gic.c, irq-msc01.c, irq-msc01.c and irq_cpu.c are still using set_irq_chip and need fixing.

o And the rest:
decstation_defconfig, emma2rh_defconfig, ip32_defconfig, yosemite_defconfig, mipssim_defconfig and rm200_defconfig.

For now I've checked in the following patch into linux-queue.

Ralf

MIPS: Enable GENERIC_HARDIRQS_NO__DO_IRQ for all platforms

__do_IRQ() is deprecated and will go away.

 arch/mips/Kconfig |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
arch/mips/Kconfig +1 -11
@@ -77,7 +77,6 @@ config MIPS_COBALT
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL
 	select SYS_SUPPORTS_LITTLE_ENDIAN
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 
 config MACH_DECSTATION
 	bool "DECstations"
@@ -132,7 +131,6 @@ config MACH_JAZZ
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
 	select SYS_SUPPORTS_100HZ
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	help
 	 This a family of machines based on the MIPS R4030 chipset which was
 	 used by several vendors to build RISC/os and Windows NT workstations.
@@ -154,7 +152,6 @@ config LASAT
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
 	select SYS_SUPPORTS_LITTLE_ENDIAN
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 
 config LEMOTE_FULONG
 	bool "Lemote Fulong mini-PC"
@@ -175,7 +172,6 @@ config LEMOTE_FULONG
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select SYS_SUPPORTS_HIGHMEM
 	select SYS_HAS_EARLY_PRINTK
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select GENERIC_ISA_DMA_SUPPORT_BROKEN
 	select CPU_HAS_WB
 	help
@@ -246,7 +242,6 @@ config MACH_VR41XX
 	select CEVT_R4K
 	select CSRC_R4K
 	select SYS_HAS_CPU_VR41XX
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 
 config NXP_STB220
 	bool "NXP STB220 board"
@@ -360,7 +355,6 @@ config SGI_IP27
 	select SYS_SUPPORTS_BIG_ENDIAN
 	select SYS_SUPPORTS_NUMA
 	select SYS_SUPPORTS_SMP
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	help
 	  This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
 	  workstations.  To compile a Linux kernel that runs on these, say Y
@@ -559,7 +553,6 @@ config MIKROTIK_RB532
 	select CEVT_R4K
 	select CSRC_R4K
 	select DMA_NONCOHERENT
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select HW_HAS_PCI
 	select IRQ_CPU
 	select SYS_HAS_CPU_MIPS32_R1
@@ -697,8 +690,7 @@ config SCHED_OMIT_FRAME_POINTER
 	default y
 
 config GENERIC_HARDIRQS_NO__DO_IRQ
-	bool
-	default n
+	def_bool y
 
 #
 # Select some configuration options automatically based on user selections.
@@ -905,7 +897,6 @@ config SOC_PNX833X
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select SYS_SUPPORTS_BIG_ENDIAN
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select GENERIC_GPIO
 	select CPU_MIPSR2_IRQ_VI
 
@@ -924,7 +915,6 @@ config SOC_PNX8550
 	select SYS_HAS_CPU_MIPS32_R1
 	select SYS_HAS_EARLY_PRINTK
 	select SYS_SUPPORTS_32BIT_KERNEL
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select GENERIC_GPIO
 
 config SWAP_IO_SPACE
#1 lore raw

I'll have a quick look at the NEC EMMA2 code, for review...

//Markus

Quoted 135 lines · Ralf Baechle

__do_IRQ() is deprecated since a long time and there are plans to remove it for 2.6.30. The MIPS platforms seem to fall into three classes:

o Platforms setting CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ to explicitly disable __do_IRQ():

	capcella_defconfig, cobalt_defconfig, e55_defconfig,
	fulong_defconfig, ip27_defconfig, jazz_defconfig, jmr3927_defconfig,
	lasat_defconfig, mpc30x_defconfig, pnx8335-stb225_defconfig,
	pnx8550-jbs_defconfig, pnx8550-stb810_defconfig, rb532_defconfig,
	rbtx49xx_defconfig, tb0219_defconfig, tb0226_defconfig,
	tb0287_defconfig and workpad_defconfig.

o Platforms that don't set CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ but don't seem to use __do_IRQ():

bcm47xx_defconfig, cavium-octeon_defconfig, excite_defconfig, ip22_defconfig, ip28_defconfig, msp71xx_defconfig, wrppmc_defconfig,

o Platforms that still seem to rely on __do_IRQ():
o All Sibyte platforms:
bigsur_defconfig and sb1250-swarm_defconfig

o All Alchemy platforms:
db1000_defconfig, db1100_defconfig, db1200_defconfig,
db1500_defconfig,
db1550_defconfig, mtx1_defconfig, pb1100_defconfig, pb1500_defconfig and pb1550_defconfig

o malta_defconfig. The platform code itself is ok but irq-gic.c, irq-msc01.c, irq-msc01.c and irq_cpu.c are still using set_irq_chip and need fixing.

o And the rest:
decstation_defconfig, emma2rh_defconfig, ip32_defconfig, yosemite_defconfig, mipssim_defconfig and rm200_defconfig.

For now I've checked in the following patch into linux-queue.

Ralf

MIPS: Enable GENERIC_HARDIRQS_NO__DO_IRQ for all platforms

__do_IRQ() is deprecated and will go away.

arch/mips/Kconfig | 12 +-----------

1 file changed, 1 insertion(+), 11 deletions(-)
arch/mips/Kconfig +0 -1
@@ -77,7 +77,6 @@ config MIPS_COBALT
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL
 	select SYS_SUPPORTS_LITTLE_ENDIAN
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 

config MACH_DECSTATION
bool "DECstations"

arch/mips/Kconfig +0 -1
@@ -132,7 +131,6 @@ config MACH_JAZZ
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
 	select SYS_SUPPORTS_100HZ
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	help
 	 This a family of machines based on the MIPS R4030 chipset which was
 	 used by several vendors to build RISC/os and Windows NT  

workstations.

arch/mips/Kconfig +0 -1
@@ -154,7 +152,6 @@ config LASAT
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
 	select SYS_SUPPORTS_LITTLE_ENDIAN
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 

config LEMOTE_FULONG
bool "Lemote Fulong mini-PC"

arch/mips/Kconfig +0 -2
@@ -175,7 +172,6 @@ config LEMOTE_FULONG
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select SYS_SUPPORTS_HIGHMEM
 	select SYS_HAS_EARLY_PRINTK
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select GENERIC_ISA_DMA_SUPPORT_BROKEN
 	select CPU_HAS_WB
 	help
@@ -246,7 +242,6 @@ config MACH_VR41XX
 	select CEVT_R4K
 	select CSRC_R4K
 	select SYS_HAS_CPU_VR41XX
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 

config NXP_STB220
bool "NXP STB220 board"

arch/mips/Kconfig +0 -2
@@ -360,7 +355,6 @@ config SGI_IP27
 	select SYS_SUPPORTS_BIG_ENDIAN
 	select SYS_SUPPORTS_NUMA
 	select SYS_SUPPORTS_SMP
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	help
 	  This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
 	  workstations.  To compile a Linux kernel that runs on these, say Y
@@ -559,7 +553,6 @@ config MIKROTIK_RB532
 	select CEVT_R4K
 	select CSRC_R4K
 	select DMA_NONCOHERENT
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select HW_HAS_PCI
 	select IRQ_CPU
 	select SYS_HAS_CPU_MIPS32_R1
@@ -697,8 +690,7 @@ config SCHED_OMIT_FRAME_POINTER
 	default y
 

config GENERIC_HARDIRQS_NO__DO_IRQ

arch/mips/Kconfig +1 -2
-	bool
-	default n
+	def_bool y

#
# Select some configuration options automatically based on user selections.

arch/mips/Kconfig +0 -2
@@ -905,7 +897,6 @@ config SOC_PNX833X
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select SYS_SUPPORTS_BIG_ENDIAN
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select GENERIC_GPIO
 	select CPU_MIPSR2_IRQ_VI
 
@@ -924,7 +915,6 @@ config SOC_PNX8550
 	select SYS_HAS_CPU_MIPS32_R1
 	select SYS_HAS_EARLY_PRINTK
 	select SYS_SUPPORTS_32BIT_KERNEL
-	select GENERIC_HARDIRQS_NO__DO_IRQ
 	select GENERIC_GPIO
 

config SWAP_IO_SPACE

#2 lore raw
In reply to Ralf Baechle
Quoted 8 lines · Ralf Baechle

__do_IRQ() is deprecated since a long time and there are plans to remove it for 2.6.30. The MIPS platforms seem to fall into three classes:

o Platforms that still seem to rely on __do_IRQ():

     o All Alchemy platforms:
	db1000_defconfig, db1100_defconfig, db1200_defconfig, db1500_defconfig,
	db1550_defconfig, mtx1_defconfig, pb1100_defconfig, pb1500_defconfig
	and pb1550_defconfig

I believe that the defconfigs just need to be updated. There are no __do_IRQ invocations in the alchemy/ tree anymore, and generic hardirqs are enabled by CONFIG_SOC_AU1X00.

Gr�sse,
Manuel Lauss

#3 lore raw
Quoted 11 lines · Manuel Lauss
Quoted 8 lines · Ralf Baechle

__do_IRQ() is deprecated since a long time and there are plans to remove it for 2.6.30. The MIPS platforms seem to fall into three classes:

o Platforms that still seem to rely on __do_IRQ():

     o All Alchemy platforms:
	db1000_defconfig, db1100_defconfig, db1200_defconfig, db1500_defconfig,
	db1550_defconfig, mtx1_defconfig, pb1100_defconfig, pb1500_defconfig
	and pb1550_defconfig
Quoted 3 lines

I believe that the defconfigs just need to be updated. There are no __do_IRQ invocations in the alchemy/ tree anymore, and generic hardirqs are enabled by CONFIG_SOC_AU1X00.

__do_IRQ will be called from the generic code if irq_desc->handle_irq is not set for an interrupt and handle_irq will be left NULL if a platform only calls set_irq_chip or even does a homebrew initialization. Fix is to call set_irq_chip_and_handler or better set_irq_chip_and_handler_name. Iow, now with CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ always set half the platforms will blow up because the function pointer irq_desc->handle_irq is unset.

Ralf

#4 lore raw
Quoted 13 lines · Ralf Baechle
Quoted 11 lines · Manuel Lauss
Quoted 8 lines · Ralf Baechle

__do_IRQ() is deprecated since a long time and there are plans to remove it for 2.6.30.  The MIPS platforms seem to fall into three classes:

 o Platforms that still seem to rely on __do_IRQ():
     o All Alchemy platforms:
    db1000_defconfig, db1100_defconfig, db1200_defconfig, db1500_defconfig, db1550_defconfig, mtx1_defconfig, pb1100_defconfig, pb1500_defconfig and pb1550_defconfig

Quoted 8 lines
Quoted 3 lines

I believe that the defconfigs just need to be updated.  There are no __do_IRQ invocations in the alchemy/ tree anymore, and generic hardirqs are enabled by CONFIG_SOC_AU1X00.

__do_IRQ will be called from the generic code if irq_desc->handle_irq is not set for an interrupt and handle_irq will be left NULL if a platform only calls set_irq_chip or even does a homebrew initialization.  Fix is to call set_irq_chip_and_handler or better set_irq_chip_and_handler_name.

Alchemy does all that...

Quoted 3 lines

Iow, now with CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ always set half the platforms will blow up because the function pointer irq_desc->handle_irq is unset.

...and it works fine so far on the DB1200 and another 2 boards I have. (I.e. your patch didn't break anything). Unless I'm missing something very big.

Manuel Lauss

#5 lore raw
Quoted 7 lines · Manuel Lauss
Quoted 3 lines

Iow, now with CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ always set half the platforms will blow up because the function pointer irq_desc->handle_irq is unset.

...and it works fine so far on the DB1200 and another 2 boards I have. (I.e. your patch didn't break anything). Unless I'm missing something very big.

Ah, there is a remaining call to set_irq_chip in the Alchemy code - but that seems to be in "does not happen" code so should be benign.

Ralf

#6 lore raw

MIPS: EMMA2RH: Use handle_edge_irq() handler for GPIO interrupts

In reply to Ralf Baechle

EMMA's GPIO interrupts are latched by GPIO interrupt status register. In this case, we're encouraged to use handle_edge_irq() handler.

The following changes are made along with replacing set_irq_chip() with set_irq_chip_and_handler_name(,,handle_edge_irq,"edge"):

* Fix emma2rh_gpio_irq_ack not to disable interrupts

With handle_edge_irq(), we're not expected to disable interrupts when chip->ack is served, so fix it accordingly. We also add a new emma2rh_gpio_irq_mask_ack() for chip->mask_ack operation.

* Remove emma2rh_gpio_irq_end() as chip->end is no longer served.

---

Quoted 2 lines · Ralf Baechle

__do_IRQ() is deprecated since a long time and there are plans to remove it for 2.6.30. The MIPS platforms seem to fall into three classes:

[snip]

Quoted 9 lines

o Platforms that still seem to rely on __do_IRQ():
o All Sibyte platforms:
bigsur_defconfig and sb1250-swarm_defconfig

o All Alchemy platforms:
db1000_defconfig, db1100_defconfig, db1200_defconfig, db1500_defconfig, db1550_defconfig, mtx1_defconfig, pb1100_defconfig, pb1500_defconfig and pb1550_defconfig

Quoted 7 lines

o malta_defconfig. The platform code itself is ok but irq-gic.c, irq-msc01.c, irq-msc01.c and irq_cpu.c are still using set_irq_chip and need fixing.

o And the rest:
decstation_defconfig, emma2rh_defconfig, ip32_defconfig, yosemite_defconfig, mipssim_defconfig and rm200_defconfig.

Here's a patch for EMMA2RH not to call __do_IRQ(). Please review.

Thanks,

Shinya

arch/mips/emma/markeins/irq.c | 28 ++++++++++------------------

1 files changed, 10 insertions(+), 18 deletions(-)
arch/mips/emma/markeins/irq.c +0 -0
index ce8f5f2..d15556c 100644
@@ -149,37 +149,28 @@ static void emma2rh_gpio_irq_disable(unsigned int irq)
 

static void emma2rh_gpio_irq_ack(unsigned int irq) {
- u32 reg;
-

	irq -= EMMA2RH_GPIO_IRQ_BASE;
	emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));

-
- reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
- reg &= ~(1 << irq);
- emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
}

-static void emma2rh_gpio_irq_end(unsigned int irq) +static void emma2rh_gpio_irq_mask_ack(unsigned int irq)

{
	u32 reg;

- if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
-
- irq -= EMMA2RH_GPIO_IRQ_BASE;
+ irq -= EMMA2RH_GPIO_IRQ_BASE;
+ emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));

- reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
- reg |= 1 << irq;
- emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
- }
+ reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
+ reg &= ~(1 << irq);
+ emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
}

struct irq_chip emma2rh_gpio_irq_controller = {
.name = "emma2rh_gpio_irq",
.ack = emma2rh_gpio_irq_ack,
.mask = emma2rh_gpio_irq_disable,
- .mask_ack = emma2rh_gpio_irq_ack,
+ .mask_ack = emma2rh_gpio_irq_mask_ack,
.unmask = emma2rh_gpio_irq_enable,
- .end = emma2rh_gpio_irq_end,
};

void emma2rh_gpio_irq_init(void)
@@ -187,8 +178,9 @@ void emma2rh_gpio_irq_init(void)

	u32 i;

	for (i = 0; i < NUM_EMMA2RH_IRQ_GPIO; i++)

- set_irq_chip(EMMA2RH_GPIO_IRQ_BASE + i,
- &emma2rh_gpio_irq_controller);
+ set_irq_chip_and_handler_name(EMMA2RH_GPIO_IRQ_BASE + i,
+ &emma2rh_gpio_irq_controller,
+ handle_edge_irq, "edge");
}

static struct irqaction irq_cascade = {