2015-06-09 18:27:16

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 00/15] Kill off set_irq_flags

This series converts all users of ARM specific set_irq_flags to use
common genirq functions. In many cases where irqdomains are used, the
set_irq_flags calls were redundant, so I've removed them.

This is not intended for 4.2, but if any subsystem maintainers want to
pick up their subsystem's change that is fine. All but the last 2
patches stand on their own. Any new drivers going into 4.2 may need a
similar change, but I'm sure people are told not to use set_irq_flags in
reviews. ;)

Rob


Rob Herring (15):
ARM: kill off set_irq_flags usage
regmap: kill off set_irq_flags usage
clk: kill off set_irq_flags usage
dma: kill off set_irq_flags usage
gpio: kill off set_irq_flags usage
gpu/drm: kill off set_irq_flags usage
irqchip: kill off set_irq_flags usage
memory: kill off set_irq_flags usage
mfd: kill off set_irq_flags usage
PCI: kill off set_irq_flags usage
pinctrl: kill off set_irq_flags usage
SH: kill off set_irq_flags usage
tty/serial: kill off set_irq_flags usage
ARM: remove ununsed set_irq_flags
arm64: remove ununsed set_irq_flags

arch/arm/common/it8152.c | 2 +-
arch/arm/common/locomo.c | 2 +-
arch/arm/common/sa1111.c | 4 ++--
arch/arm/include/asm/hw_irq.h | 6 ------
arch/arm/kernel/irq.c | 20 --------------------
arch/arm/mach-davinci/cp_intc.c | 2 +-
arch/arm/mach-dove/irq.c | 2 +-
arch/arm/mach-ebsa110/core.c | 2 +-
arch/arm/mach-footbridge/common.c | 2 +-
arch/arm/mach-footbridge/isa-irq.c | 8 ++++----
arch/arm/mach-gemini/gpio.c | 2 +-
arch/arm/mach-gemini/irq.c | 2 +-
arch/arm/mach-imx/3ds_debugboard.c | 2 +-
arch/arm/mach-imx/mach-mx31ads.c | 2 +-
arch/arm/mach-iop13xx/irq.c | 2 +-
arch/arm/mach-iop32x/irq.c | 2 +-
arch/arm/mach-iop33x/irq.c | 2 +-
arch/arm/mach-ixp4xx/common.c | 2 +-
arch/arm/mach-ks8695/irq.c | 2 +-
arch/arm/mach-lpc32xx/irq.c | 2 +-
arch/arm/mach-netx/generic.c | 2 +-
arch/arm/mach-omap1/fpga.c | 2 +-
arch/arm/mach-omap1/irq.c | 2 +-
arch/arm/mach-pxa/balloon3.c | 2 +-
arch/arm/mach-pxa/irq.c | 1 -
arch/arm/mach-pxa/lpd270.c | 2 +-
arch/arm/mach-pxa/pcm990-baseboard.c | 2 +-
arch/arm/mach-pxa/pxa3xx.c | 2 +-
arch/arm/mach-pxa/viper.c | 2 +-
arch/arm/mach-pxa/zeus.c | 2 +-
arch/arm/mach-rpc/ecard.c | 2 +-
arch/arm/mach-rpc/irq.c | 16 ++++++++--------
arch/arm/mach-s3c24xx/bast-irq.c | 2 +-
arch/arm/mach-s3c64xx/common.c | 2 +-
arch/arm/mach-sa1100/irq.c | 1 -
arch/arm/mach-sa1100/neponset.c | 4 ++--
arch/arm/mach-w90x900/irq.c | 2 +-
arch/arm64/include/asm/hardirq.h | 5 -----
drivers/base/regmap/regmap-irq.c | 7 -------
drivers/clk/at91/pmc.c | 1 -
drivers/dma/ipu/ipu_irq.c | 8 ++------
drivers/gpio/gpio-adp5588.c | 10 +---------
drivers/gpio/gpio-bcm-kona.c | 15 ---------------
drivers/gpio/gpio-davinci.c | 1 -
drivers/gpio/gpio-em.c | 1 -
drivers/gpio/gpio-ep93xx.c | 2 +-
drivers/gpio/gpio-grgpio.c | 8 --------
drivers/gpio/gpio-mcp23s08.c | 4 ----
drivers/gpio/gpio-msm-v2.c | 1 -
drivers/gpio/gpio-pxa.c | 8 ++++----
drivers/gpio/gpio-sa1100.c | 2 +-
drivers/gpio/gpio-sta2x11.c | 2 +-
drivers/gpio/gpio-tegra.c | 1 -
drivers/gpio/gpio-timberdale.c | 4 +---
drivers/gpio/gpiolib.c | 8 +-------
drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c | 1 -
drivers/gpu/ipu-v3/ipu-common.c | 3 +--
drivers/irqchip/exynos-combiner.c | 2 +-
drivers/irqchip/irq-armada-370-xp.c | 3 +--
drivers/irqchip/irq-bcm2835.c | 2 +-
drivers/irqchip/irq-clps711x.c | 6 +++---
drivers/irqchip/irq-gic-v3.c | 5 ++---
drivers/irqchip/irq-gic.c | 4 ++--
drivers/irqchip/irq-hip04.c | 4 ++--
drivers/irqchip/irq-keystone.c | 2 +-
drivers/irqchip/irq-mmp.c | 3 ---
drivers/irqchip/irq-mxs.c | 1 -
drivers/irqchip/irq-renesas-intc-irqpin.c | 1 -
drivers/irqchip/irq-renesas-irqc.c | 1 -
drivers/irqchip/irq-s3c24xx.c | 14 ++------------
drivers/irqchip/irq-sun4i.c | 2 +-
drivers/irqchip/irq-versatile-fpga.c | 2 +-
drivers/irqchip/irq-vic.c | 2 +-
drivers/irqchip/irq-vt8500.c | 1 -
drivers/irqchip/spear-shirq.c | 1 -
drivers/memory/omap-gpmc.c | 5 ++---
drivers/mfd/88pm860x-core.c | 4 ----
drivers/mfd/ab8500-core.c | 4 ----
drivers/mfd/arizona-irq.c | 7 -------
drivers/mfd/asic3.c | 4 ++--
drivers/mfd/db8500-prcmu.c | 1 -
drivers/mfd/ezx-pcap.c | 6 +-----
drivers/mfd/htc-egpio.c | 4 ++--
drivers/mfd/htc-i2cpld.c | 6 +-----
drivers/mfd/lp8788-irq.c | 5 -----
drivers/mfd/max8925-core.c | 5 +----
drivers/mfd/max8997-irq.c | 5 +----
drivers/mfd/max8998-irq.c | 5 +----
drivers/mfd/mt6397-core.c | 4 ----
drivers/mfd/pm8921-core.c | 5 +----
drivers/mfd/rc5t583-irq.c | 4 +---
drivers/mfd/stmpe.c | 7 -------
drivers/mfd/t7l66xb.c | 6 ------
drivers/mfd/tc3589x.c | 7 -------
drivers/mfd/tc6393xb.c | 4 ++--
drivers/mfd/tps6586x.c | 7 -------
drivers/mfd/tps65912-irq.c | 8 +-------
drivers/mfd/twl4030-irq.c | 11 +----------
drivers/mfd/twl6030-irq.c | 13 -------------
drivers/mfd/ucb1x00-core.c | 2 +-
drivers/mfd/wm831x-irq.c | 7 -------
drivers/mfd/wm8350-irq.c | 8 +-------
drivers/mfd/wm8994-irq.c | 7 -------
drivers/pci/host/pci-dra7xx.c | 1 -
drivers/pci/host/pci-keystone-dw.c | 2 --
drivers/pci/host/pci-tegra.c | 1 -
drivers/pci/host/pcie-designware.c | 1 -
drivers/pci/host/pcie-rcar.c | 1 -
drivers/pci/host/pcie-xilinx.c | 2 --
drivers/pinctrl/bcm/pinctrl-bcm2835.c | 1 -
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 --
drivers/pinctrl/pinctrl-single.c | 5 -----
drivers/pinctrl/samsung/pinctrl-exynos.c | 1 -
drivers/pinctrl/samsung/pinctrl-exynos5440.c | 1 -
drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 --
drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 --
drivers/sh/intc/internals.h | 10 +---------
drivers/tty/serial/serial_ks8695.c | 2 +-
drivers/tty/serial/sirfsoc_uart.c | 6 +++---
119 files changed, 100 insertions(+), 367 deletions(-)

--
2.1.0


2015-06-09 18:49:28

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 01/15] ARM: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Russell King <[email protected]>
Cc: Sekhar Nori <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Sebastian Hesselbarth <[email protected]>
Cc: Gregory Clement <[email protected]>
Cc: Hans Ulli Kroll <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Imre Kaloz <[email protected]>
Cc: Krzysztof Halasa <[email protected]>
Cc: Greg Ungerer <[email protected]>
Cc: Roland Stigge <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Daniel Mack <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Cc: Simtec Linux Team <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Wan ZongShun <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
arch/arm/common/it8152.c | 2 +-
arch/arm/common/locomo.c | 2 +-
arch/arm/common/sa1111.c | 4 ++--
arch/arm/mach-davinci/cp_intc.c | 2 +-
arch/arm/mach-dove/irq.c | 2 +-
arch/arm/mach-ebsa110/core.c | 2 +-
arch/arm/mach-footbridge/common.c | 2 +-
arch/arm/mach-footbridge/isa-irq.c | 8 ++++----
arch/arm/mach-gemini/gpio.c | 2 +-
arch/arm/mach-gemini/irq.c | 2 +-
arch/arm/mach-imx/3ds_debugboard.c | 2 +-
arch/arm/mach-imx/mach-mx31ads.c | 2 +-
arch/arm/mach-iop13xx/irq.c | 2 +-
arch/arm/mach-iop32x/irq.c | 2 +-
arch/arm/mach-iop33x/irq.c | 2 +-
arch/arm/mach-ixp4xx/common.c | 2 +-
arch/arm/mach-ks8695/irq.c | 2 +-
arch/arm/mach-lpc32xx/irq.c | 2 +-
arch/arm/mach-netx/generic.c | 2 +-
arch/arm/mach-omap1/fpga.c | 2 +-
arch/arm/mach-omap1/irq.c | 2 +-
arch/arm/mach-pxa/balloon3.c | 2 +-
arch/arm/mach-pxa/irq.c | 1 -
arch/arm/mach-pxa/lpd270.c | 2 +-
arch/arm/mach-pxa/pcm990-baseboard.c | 2 +-
arch/arm/mach-pxa/pxa3xx.c | 2 +-
arch/arm/mach-pxa/viper.c | 2 +-
arch/arm/mach-pxa/zeus.c | 2 +-
arch/arm/mach-rpc/ecard.c | 2 +-
arch/arm/mach-rpc/irq.c | 16 ++++++++--------
arch/arm/mach-s3c24xx/bast-irq.c | 2 +-
arch/arm/mach-s3c64xx/common.c | 2 +-
arch/arm/mach-sa1100/irq.c | 1 -
arch/arm/mach-sa1100/neponset.c | 4 ++--
arch/arm/mach-w90x900/irq.c | 2 +-
35 files changed, 45 insertions(+), 47 deletions(-)

diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
index 5114b68..96dabcb 100644
--- a/arch/arm/common/it8152.c
+++ b/arch/arm/common/it8152.c
@@ -91,7 +91,7 @@ void it8152_init_irq(void)
for (irq = IT8152_IRQ(0); irq <= IT8152_LAST_IRQ; irq++) {
irq_set_chip_and_handler(irq, &it8152_irq_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
}

diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index b55c362..339fc41 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -205,7 +205,7 @@ static void locomo_setup_irq(struct locomo *lchip)
for ( ; irq <= lchip->irq_base + 3; irq++) {
irq_set_chip_and_handler(irq, &locomo_chip, handle_level_irq);
irq_set_chip_data(irq, lchip);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
}

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 5cc779c..139aa3c 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -486,7 +486,7 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base)
irq_set_chip_and_handler(irq, &sa1111_low_chip,
handle_edge_irq);
irq_set_chip_data(irq, sachip);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

for (i = AUDXMTDMADONEA; i <= IRQ_S1_BVD1_STSCHG; i++) {
@@ -494,7 +494,7 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base)
irq_set_chip_and_handler(irq, &sa1111_high_chip,
handle_edge_irq);
irq_set_chip_data(irq, sachip);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

/*
diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
index 006dae8df..3f683fd 100644
--- a/arch/arm/mach-davinci/cp_intc.c
+++ b/arch/arm/mach-davinci/cp_intc.c
@@ -112,7 +112,7 @@ static int cp_intc_host_map(struct irq_domain *h, unsigned int virq,
pr_debug("cp_intc_host_map(%d, 0x%lx)\n", virq, hw);

irq_set_chip(virq, &cp_intc_irq_chip);
- set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(virq);
irq_set_handler(virq, handle_edge_irq);
return 0;
}
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
index 4a5a7ae..e2a940b 100644
--- a/arch/arm/mach-dove/irq.c
+++ b/arch/arm/mach-dove/irq.c
@@ -172,7 +172,7 @@ void __init dove_init_irq(void)
for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) {
irq_set_chip_and_handler(i, &pmu_irq_chip, handle_level_irq);
irq_set_status_flags(i, IRQ_LEVEL);
- set_irq_flags(i, IRQF_VALID);
+ irq_clear_status_flags(i, IRQ_NOREQUEST);
}
irq_set_chained_handler(IRQ_DOVE_PMU, pmu_irq_handler);
}
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index 8254e71..688e5fe 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -65,7 +65,7 @@ static void __init ebsa110_init_irq(void)
for (irq = 0; irq < NR_IRQS; irq++) {
irq_set_chip_and_handler(irq, &ebsa110_irq_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
}

diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index 9e8220e..0f0c9e0 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -106,7 +106,7 @@ static void __init __fb_init_irq(void)

for (irq = _DC21285_IRQ(0); irq < _DC21285_IRQ(20); irq++) {
irq_set_chip_and_handler(irq, &fb_chip, handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
}

diff --git a/arch/arm/mach-footbridge/isa-irq.c b/arch/arm/mach-footbridge/isa-irq.c
index c3a0abb..fcd79bc 100644
--- a/arch/arm/mach-footbridge/isa-irq.c
+++ b/arch/arm/mach-footbridge/isa-irq.c
@@ -153,13 +153,13 @@ void __init isa_init_irq(unsigned int host_irq)
for (irq = _ISA_IRQ(0); irq < _ISA_IRQ(8); irq++) {
irq_set_chip_and_handler(irq, &isa_lo_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

for (irq = _ISA_IRQ(8); irq < _ISA_IRQ(16); irq++) {
irq_set_chip_and_handler(irq, &isa_hi_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

request_resource(&ioport_resource, &pic1_resource);
@@ -175,8 +175,8 @@ void __init isa_init_irq(unsigned int host_irq)
* resistor on this line.
*/
if (machine_is_netwinder())
- set_irq_flags(_ISA_IRQ(11), IRQF_VALID |
- IRQF_PROBE | IRQF_NOAUTOEN);
+ irq_modify_status(_ISA_IRQ(11),
+ IRQ_NOREQUEST | IRQ_NOPROBE, IRQ_NOAUTOEN);
}
}

diff --git a/arch/arm/mach-gemini/gpio.c b/arch/arm/mach-gemini/gpio.c
index f8cb571..84e301f 100644
--- a/arch/arm/mach-gemini/gpio.c
+++ b/arch/arm/mach-gemini/gpio.c
@@ -220,7 +220,7 @@ void __init gemini_gpio_init(void)
j < GPIO_IRQ_BASE + (i + 1) * 32; j++) {
irq_set_chip_and_handler(j, &gpio_irq_chip,
handle_edge_irq);
- set_irq_flags(j, IRQF_VALID);
+ irq_clear_status_flags(j, IRQ_NOREQUEST);
}

irq_set_chained_handler(IRQ_GPIO(i), gpio_irq_handler);
diff --git a/arch/arm/mach-gemini/irq.c b/arch/arm/mach-gemini/irq.c
index 44f50dc..d929b3f 100644
--- a/arch/arm/mach-gemini/irq.c
+++ b/arch/arm/mach-gemini/irq.c
@@ -92,7 +92,7 @@ void __init gemini_init_irq(void)
} else {
irq_set_handler(i, handle_level_irq);
}
- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
}

/* Disable all interrupts */
diff --git a/arch/arm/mach-imx/3ds_debugboard.c b/arch/arm/mach-imx/3ds_debugboard.c
index 1343773..45903be 100644
--- a/arch/arm/mach-imx/3ds_debugboard.c
+++ b/arch/arm/mach-imx/3ds_debugboard.c
@@ -195,7 +195,7 @@ int __init mxc_expio_init(u32 base, u32 intr_gpio)

for (i = irq_base; i < irq_base + MXC_MAX_EXP_IO_LINES; i++) {
irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq);
- set_irq_flags(i, IRQF_VALID);
+ irq_clear_status_flags(i, IRQ_NOREQUEST);
}
irq_set_irq_type(p_irq, IRQF_TRIGGER_LOW);
irq_set_chained_handler(p_irq, mxc_expio_irq_handler);
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index d08c37c..2c08535 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -238,7 +238,7 @@ static void __init mx31ads_init_expio(void)

for (i = irq_base; i < irq_base + MXC_MAX_EXP_IO_LINES; i++) {
irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq);
- set_irq_flags(i, IRQF_VALID);
+ irq_clear_status_flags(i, IRQ_NOREQUEST);
}
irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_4));
irq_set_irq_type(irq, IRQ_TYPE_LEVEL_HIGH);
diff --git a/arch/arm/mach-iop13xx/irq.c b/arch/arm/mach-iop13xx/irq.c
index bc73970..623d85a 100644
--- a/arch/arm/mach-iop13xx/irq.c
+++ b/arch/arm/mach-iop13xx/irq.c
@@ -233,7 +233,7 @@ void __init iop13xx_init_irq(void)
irq_set_chip(i, &iop13xx_irqchip4);

irq_set_handler(i, handle_level_irq);
- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
}

iop13xx_msi_init();
diff --git a/arch/arm/mach-iop32x/irq.c b/arch/arm/mach-iop32x/irq.c
index d7ee278..2d1f69a 100644
--- a/arch/arm/mach-iop32x/irq.c
+++ b/arch/arm/mach-iop32x/irq.c
@@ -69,6 +69,6 @@ void __init iop32x_init_irq(void)

for (i = 0; i < NR_IRQS; i++) {
irq_set_chip_and_handler(i, &ext_chip, handle_level_irq);
- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
}
}
diff --git a/arch/arm/mach-iop33x/irq.c b/arch/arm/mach-iop33x/irq.c
index f7f5d3e..c99ec8d 100644
--- a/arch/arm/mach-iop33x/irq.c
+++ b/arch/arm/mach-iop33x/irq.c
@@ -113,6 +113,6 @@ void __init iop33x_init_irq(void)
irq_set_chip_and_handler(i,
(i < 32) ? &iop33x_irqchip1 : &iop33x_irqchip2,
handle_level_irq);
- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
}
}
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 8537d4c..0f3f01a 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -296,7 +296,7 @@ void __init ixp4xx_init_irq(void)
for(i = 0; i < NR_IRQS; i++) {
irq_set_chip_and_handler(i, &ixp4xx_irq_chip,
handle_level_irq);
- set_irq_flags(i, IRQF_VALID);
+ irq_clear_status_flags(i, IRQ_NOREQUEST);
}
}

diff --git a/arch/arm/mach-ks8695/irq.c b/arch/arm/mach-ks8695/irq.c
index 76802aa..31439f2 100644
--- a/arch/arm/mach-ks8695/irq.c
+++ b/arch/arm/mach-ks8695/irq.c
@@ -172,6 +172,6 @@ void __init ks8695_init_irq(void)
handle_edge_irq);
}

- set_irq_flags(irq, IRQF_VALID);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST);
}
}
diff --git a/arch/arm/mach-lpc32xx/irq.c b/arch/arm/mach-lpc32xx/irq.c
index 9ecb8f9..39f3d81 100644
--- a/arch/arm/mach-lpc32xx/irq.c
+++ b/arch/arm/mach-lpc32xx/irq.c
@@ -434,7 +434,7 @@ void __init lpc32xx_init_irq(void)
for (i = 0; i < NR_IRQS; i++) {
irq_set_chip_and_handler(i, &lpc32xx_irq_chip,
handle_level_irq);
- set_irq_flags(i, IRQF_VALID);
+ irq_clear_status_flags(i, IRQ_NOREQUEST);
}

/* Set default mappings */
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index db25b0c..6373e2b 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -174,7 +174,7 @@ void __init netx_init_irq(void)
for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) {
irq_set_chip_and_handler(irq, &netx_hif_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST);
}

writel(NETX_DPMAS_INT_EN_GLB_EN, NETX_DPMAS_INT_EN);
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 3c0e422..dfec671 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -169,7 +169,7 @@ void omap1510_fpga_init_irq(void)
}

irq_set_handler(i, handle_edge_irq);
- set_irq_flags(i, IRQF_VALID);
+ irq_clear_status_flags(i, IRQ_NOREQUEST);
}

/*
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index a8a533d..1af7dd9 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -230,7 +230,7 @@ void __init omap1_init_irq(void)

irq_set_chip_and_handler(j, &omap_irq_chip,
handle_level_irq);
- set_irq_flags(j, IRQF_VALID);
+ irq_clear_status_flags(j, IRQ_NOREQUEST);
}
}

diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index d897292..09b9a36 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -528,7 +528,7 @@ static void __init balloon3_init_irq(void)
for (irq = BALLOON3_IRQ(0); irq <= BALLOON3_IRQ(7); irq++) {
irq_set_chip_and_handler(irq, &balloon3_irq_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

irq_set_chained_handler(BALLOON3_AUX_NIRQ, balloon3_irq_handler);
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 89a7c06..3a4a116 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -133,7 +133,6 @@ static int pxa_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_and_handler(virq, &pxa_internal_irq_chip,
handle_level_irq);
irq_set_chip_data(virq, base);
- set_irq_flags(virq, IRQF_VALID);

return 0;
}
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index eaee2c2..2670fb0 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -151,7 +151,7 @@ static void __init lpd270_init_irq(void)
for (irq = LPD270_IRQ(2); irq <= LPD270_IRQ(4); irq++) {
irq_set_chip_and_handler(irq, &lpd270_irq_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lpd270_irq_handler);
irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 2897da2..86e01bf 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -311,7 +311,7 @@ static void __init pcm990_init_irq(void)
for (irq = PCM027_IRQ(0); irq <= PCM027_IRQ(3); irq++) {
irq_set_chip_and_handler(irq, &pcm990_irq_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

/* disable all Interrupts */
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index edcbd9c..0397800 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -381,7 +381,7 @@ static void __init pxa_init_ext_wakeup_irq(int (*fn)(struct irq_data *,
for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
irq_set_chip_and_handler(irq, &pxa_ext_wakeup_chip,
handle_edge_irq);
- set_irq_flags(irq, IRQF_VALID);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST);
}

pxa_ext_wakeup_chip.irq_set_wake = fn;
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index de3b080..dae3de8 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -313,7 +313,7 @@ static void __init viper_init_irq(void)
isa_irq = viper_bit_to_irq(level);
irq_set_chip_and_handler(isa_irq, &viper_irq_chip,
handle_edge_irq);
- set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(isa_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

irq_set_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO),
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index ac2ae5c..48dd5bd 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -151,7 +151,7 @@ static void __init zeus_init_irq(void)
isa_irq = zeus_bit_to_irq(level);
irq_set_chip_and_handler(isa_irq, &zeus_irq_chip,
handle_edge_irq);
- set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(isa_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

irq_set_irq_type(gpio_to_irq(ZEUS_ISA_GPIO), IRQ_TYPE_EDGE_RISING);
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index fcb1d59..f726d4c 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -946,7 +946,7 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
irq_set_chip_and_handler(ec->irq, &ecard_chip,
handle_level_irq);
irq_set_chip_data(ec->irq, ec);
- set_irq_flags(ec->irq, IRQF_VALID);
+ irq_clear_status_flags(ec->irq, IRQ_NOREQUEST);
}

#ifdef CONFIG_ARCH_RPC
diff --git a/arch/arm/mach-rpc/irq.c b/arch/arm/mach-rpc/irq.c
index 3e4fa84..66502e6 100644
--- a/arch/arm/mach-rpc/irq.c
+++ b/arch/arm/mach-rpc/irq.c
@@ -117,7 +117,7 @@ extern unsigned char rpc_default_fiq_start, rpc_default_fiq_end;

void __init rpc_init_irq(void)
{
- unsigned int irq, flags;
+ unsigned int irq, clr, set = 0;

iomd_writeb(0, IOMD_IRQMASKA);
iomd_writeb(0, IOMD_IRQMASKB);
@@ -128,37 +128,37 @@ void __init rpc_init_irq(void)
&rpc_default_fiq_end - &rpc_default_fiq_start);

for (irq = 0; irq < NR_IRQS; irq++) {
- flags = IRQF_VALID;
+ clr = IRQ_NOREQUEST;

if (irq <= 6 || (irq >= 9 && irq <= 15))
- flags |= IRQF_PROBE;
+ clr |= IRQ_NOPROBE;

if (irq == 21 || (irq >= 16 && irq <= 19) ||
irq == IRQ_KEYBOARDTX)
- flags |= IRQF_NOAUTOEN;
+ set |= IRQ_NOAUTOEN;

switch (irq) {
case 0 ... 7:
irq_set_chip_and_handler(irq, &iomd_a_chip,
handle_level_irq);
- set_irq_flags(irq, flags);
+ irq_modify_status(irq, clr, set);
break;

case 8 ... 15:
irq_set_chip_and_handler(irq, &iomd_b_chip,
handle_level_irq);
- set_irq_flags(irq, flags);
+ irq_modify_status(irq, clr, set);
break;

case 16 ... 21:
irq_set_chip_and_handler(irq, &iomd_dma_chip,
handle_level_irq);
- set_irq_flags(irq, flags);
+ irq_modify_status(irq, clr, set);
break;

case 64 ... 71:
irq_set_chip(irq, &iomd_fiq_chip);
- set_irq_flags(irq, IRQF_VALID);
+ irq_modify_status(irq, clr, set);
break;
}
}
diff --git a/arch/arm/mach-s3c24xx/bast-irq.c b/arch/arm/mach-s3c24xx/bast-irq.c
index cb1b791..ced1ab8 100644
--- a/arch/arm/mach-s3c24xx/bast-irq.c
+++ b/arch/arm/mach-s3c24xx/bast-irq.c
@@ -147,7 +147,7 @@ static __init int bast_irq_init(void)

irq_set_chip_and_handler(irqno, &bast_pc104_chip,
handle_level_irq);
- set_irq_flags(irqno, IRQF_VALID);
+ irq_clear_status_flags(irqno, IRQ_NOREQUEST);
}
}

diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index 16547f2..06ba943 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -420,7 +420,7 @@ static int __init s3c64xx_init_irq_eint(void)
for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq);
irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq));
- set_irq_flags(irq, IRQF_VALID);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST);
}

irq_set_chained_handler(IRQ_EINT0_3, s3c_irq_demux_eint0_3);
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
index 65aebfa..4f1d1e9 100644
--- a/arch/arm/mach-sa1100/irq.c
+++ b/arch/arm/mach-sa1100/irq.c
@@ -68,7 +68,6 @@ static int sa1100_normal_irqdomain_map(struct irq_domain *d,
{
irq_set_chip_and_handler(irq, &sa1100_normal_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index af868d25..4491d31 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -320,10 +320,10 @@ static int neponset_probe(struct platform_device *dev)

irq_set_chip_and_handler(d->irq_base + NEP_IRQ_SMC91X, &nochip,
handle_simple_irq);
- set_irq_flags(d->irq_base + NEP_IRQ_SMC91X, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(d->irq_base + NEP_IRQ_SMC91X, IRQ_NOREQUEST | IRQ_NOPROBE);
irq_set_chip_and_handler(d->irq_base + NEP_IRQ_USAR, &nochip,
handle_simple_irq);
- set_irq_flags(d->irq_base + NEP_IRQ_USAR, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(d->irq_base + NEP_IRQ_USAR, IRQ_NOREQUEST | IRQ_NOPROBE);
irq_set_chip(d->irq_base + NEP_IRQ_SA1111, &nochip);

irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c
index d66d43a..491b317 100644
--- a/arch/arm/mach-w90x900/irq.c
+++ b/arch/arm/mach-w90x900/irq.c
@@ -211,6 +211,6 @@ void __init nuc900_init_irq(void)
for (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) {
irq_set_chip_and_handler(irqno, &nuc900_irq_chip,
handle_level_irq);
- set_irq_flags(irqno, IRQF_VALID);
+ irq_clear_status_flags(irqno, IRQ_NOREQUEST);
}
}
--
2.1.0

2015-06-09 18:49:02

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 02/15] regmap: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/base/regmap/regmap-irq.c | 7 -------
1 file changed, 7 deletions(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index a6c3f75..a9cb98a 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -306,14 +306,7 @@ static int regmap_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, data);
irq_set_chip(virq, &data->irq_chip);
irq_set_nested_thread(virq, 1);
-
- /* ARM needs us to explicitly flag the IRQ as valid
- * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}
--
2.1.0

2015-06-09 18:55:30

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 03/15] clk: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Boris Brezillon <[email protected]>
Cc: Mike Turquette <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
---
drivers/clk/at91/pmc.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index 3f27d21..828b196 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -125,7 +125,6 @@ static int pmc_irq_map(struct irq_domain *h, unsigned int virq,

irq_set_chip_and_handler(virq, &pmc_irq,
handle_level_irq);
- set_irq_flags(virq, IRQF_VALID);
irq_set_chip_data(virq, pmc);

return 0;
--
2.1.0

2015-06-09 18:27:37

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 04/15] dma: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: [email protected]
---
drivers/dma/ipu/ipu_irq.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
index 2e284a4..667ebba 100644
--- a/drivers/dma/ipu/ipu_irq.c
+++ b/drivers/dma/ipu/ipu_irq.c
@@ -377,9 +377,7 @@ int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
irq_map[i].irq = irq;
irq_map[i].source = -EINVAL;
irq_set_handler(irq, handle_level_irq);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-#endif
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

irq_set_handler_data(ipu->irq_fn, ipu);
@@ -406,9 +404,7 @@ void ipu_irq_detach_irq(struct ipu *ipu, struct platform_device *dev)
irq_set_handler_data(ipu->irq_err, NULL);

for (irq = irq_base; irq < irq_base + CONFIG_MX3_IPU_IRQS; irq++) {
-#ifdef CONFIG_ARM
- set_irq_flags(irq, 0);
-#endif
+ irq_set_status_flags(irq, IRQ_NOREQUEST);
irq_set_chip(irq, NULL);
irq_set_chip_data(irq, NULL);
}
--
2.1.0

2015-06-09 18:51:52

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 05/15] gpio: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Michael Hennerich <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Ray Jui <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/gpio/gpio-adp5588.c | 10 +---------
drivers/gpio/gpio-bcm-kona.c | 15 ---------------
drivers/gpio/gpio-davinci.c | 1 -
drivers/gpio/gpio-em.c | 1 -
drivers/gpio/gpio-ep93xx.c | 2 +-
drivers/gpio/gpio-grgpio.c | 8 --------
drivers/gpio/gpio-mcp23s08.c | 4 ----
drivers/gpio/gpio-msm-v2.c | 1 -
drivers/gpio/gpio-pxa.c | 8 ++++----
drivers/gpio/gpio-sa1100.c | 2 +-
drivers/gpio/gpio-sta2x11.c | 2 +-
drivers/gpio/gpio-tegra.c | 1 -
drivers/gpio/gpio-timberdale.c | 4 +---
drivers/gpio/gpiolib.c | 8 +-------
14 files changed, 10 insertions(+), 57 deletions(-)

diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
index d3fe6a6..df7bb75 100644
--- a/drivers/gpio/gpio-adp5588.c
+++ b/drivers/gpio/gpio-adp5588.c
@@ -305,15 +305,7 @@ static int adp5588_irq_setup(struct adp5588_gpio *dev)
irq_set_chip_and_handler(irq, &adp5588_irq_chip,
handle_level_irq);
irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
- /*
- * ARM needs us to explicitly flag the IRQ as VALID,
- * once we do so, it will also set the noprobe.
- */
- set_irq_flags(irq, IRQF_VALID);
-#else
- irq_set_noprobe(irq);
-#endif
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

ret = request_threaded_irq(client->irq,
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index b164ce8..8247d27 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -519,11 +519,7 @@ static int bcm_kona_gpio_irq_map(struct irq_domain *d, unsigned int irq,
return ret;
irq_set_lockdep_class(irq, &gpio_lock_class);
irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, handle_simple_irq);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif

return 0;
}
@@ -638,17 +634,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
dev_err(dev, "Couldn't add GPIO chip -- %d\n", ret);
goto err_irq_domain;
}
- for (i = 0; i < chip->ngpio; i++) {
- int irq = bcm_kona_gpio_to_irq(chip, i);
- irq_set_lockdep_class(irq, &gpio_lock_class);
- irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip,
- handle_simple_irq);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
- irq_set_noprobe(irq);
-#endif
- }
for (i = 0; i < kona_gpio->num_bank; i++) {
bank = &kona_gpio->banks[i];
irq_set_chained_handler(bank->irq, bcm_kona_gpio_irq_handler);
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index c5e05c8..59020a6 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -422,7 +422,6 @@ davinci_gpio_irq_map(struct irq_domain *d, unsigned int irq,
irq_set_irq_type(irq, IRQ_TYPE_NONE);
irq_set_chip_data(irq, (__force void *)g);
irq_set_handler_data(irq, (void *)__gpio_mask(hw));
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index 3cfcfc6..3a912a6 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -262,7 +262,6 @@ static int em_gio_irq_domain_map(struct irq_domain *h, unsigned int irq,

irq_set_chip_data(irq, h->host_data);
irq_set_chip_and_handler(irq, &p->irq_chip, handle_level_irq);
- set_irq_flags(irq, IRQF_VALID); /* kill me now */
return 0;
}

diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
index 45684f3..4d35fdc 100644
--- a/drivers/gpio/gpio-ep93xx.c
+++ b/drivers/gpio/gpio-ep93xx.c
@@ -234,7 +234,7 @@ static void ep93xx_gpio_init_irq(void)
gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
irq_set_chip_and_handler(gpio_irq, &ep93xx_gpio_irq_chip,
handle_level_irq);
- set_irq_flags(gpio_irq, IRQF_VALID);
+ irq_clear_status_flags(gpio_irq, IRQ_NOREQUEST);
}

irq_set_chained_handler(IRQ_EP93XX_GPIO_AB,
diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c
index 35a0277..6bdb8de 100644
--- a/drivers/gpio/gpio-grgpio.c
+++ b/drivers/gpio/gpio-grgpio.c
@@ -281,12 +281,7 @@ static int grgpio_irq_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, priv);
irq_set_chip_and_handler(irq, &grgpio_irq_chip,
handle_simple_irq);
- irq_clear_status_flags(irq, IRQ_NOREQUEST);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif

return ret;
}
@@ -301,9 +296,6 @@ static void grgpio_irq_unmap(struct irq_domain *d, unsigned int irq)
int ngpio = priv->bgc.gc.ngpio;
int i;

-#ifdef CONFIG_ARM
- set_irq_flags(irq, 0);
-#endif
irq_set_chip_and_handler(irq, NULL, NULL);
irq_set_chip_data(irq, NULL);

diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 2fc7ff8..73db7ec 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -507,11 +507,7 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
irq_set_chip_data(irq, mcp);
irq_set_chip(irq, &mcp23s08_irq_chip);
irq_set_nested_thread(irq, true);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif
}
return 0;
}
diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c
index 52ff182..4bbaeb36 100644
--- a/drivers/gpio/gpio-msm-v2.c
+++ b/drivers/gpio/gpio-msm-v2.c
@@ -363,7 +363,6 @@ static int msm_gpio_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_lockdep_class(irq, &msm_gpio_lock_class);
irq_set_chip_and_handler(irq, &msm_gpio_irq_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index cdbbcf0..55a11de 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -524,7 +524,7 @@ static int pxa_irq_domain_map(struct irq_domain *d, unsigned int irq,
{
irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
handle_edge_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);
return 0;
}

@@ -643,20 +643,20 @@ static int pxa_gpio_probe(struct platform_device *pdev)
irq = gpio_to_irq(0);
irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
handle_edge_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
if (irq1 > 0) {
irq = gpio_to_irq(1);
irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
handle_edge_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

for (irq = gpio_to_irq(gpio_offset);
irq <= gpio_to_irq(pxa_last_gpio); irq++) {
irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
handle_edge_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
}

diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c
index bec397a..dbc67d1 100644
--- a/drivers/gpio/gpio-sa1100.c
+++ b/drivers/gpio/gpio-sa1100.c
@@ -155,7 +155,7 @@ static int sa1100_gpio_irqdomain_map(struct irq_domain *d,
{
irq_set_chip_and_handler(irq, &sa1100_gpio_irq_chip,
handle_edge_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);

return 0;
}
diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c
index 18579ac..55e47828 100644
--- a/drivers/gpio/gpio-sta2x11.c
+++ b/drivers/gpio/gpio-sta2x11.c
@@ -346,7 +346,7 @@ static void gsta_alloc_irq_chip(struct gsta_gpio *chip)
i = chip->irq_base + j;
irq_set_chip_and_handler(i, &ct->chip, ct->handler);
irq_set_chip_data(i, gc);
- irq_modify_status(i, IRQ_NOREQUEST | IRQ_NOPROBE, 0);
+ irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
}
gc->irq_cnt = i - gc->irq_base;
}
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 1741981..62fdd5d 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -509,7 +509,6 @@ static int tegra_gpio_probe(struct platform_device *pdev)
irq_set_chip_data(irq, bank);
irq_set_chip_and_handler(irq, &tegra_gpio_irq_chip,
handle_simple_irq);
- set_irq_flags(irq, IRQF_VALID);
}

for (i = 0; i < tegra_gpio_bank_count; i++) {
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index e8f97e0..166fe1c 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -294,9 +294,7 @@ static int timbgpio_probe(struct platform_device *pdev)
irq_set_chip_and_handler(tgpio->irq_base + i,
&timbgpio_irqchip, handle_simple_irq);
irq_set_chip_data(tgpio->irq_base + i, tgpio);
-#ifdef CONFIG_ARM
- set_irq_flags(tgpio->irq_base + i, IRQF_VALID | IRQF_PROBE);
-#endif
+ irq_clear_status_flags(tgpio->irq_base + i, IRQ_NOREQUEST | IRQ_NOPROBE);
}

irq_set_handler_data(irq, tgpio);
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 6bc612b..efd35c0 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -477,11 +477,8 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
/* Chips that can sleep need nested thread handlers */
if (chip->can_sleep && !chip->irq_not_threaded)
irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif
+
/*
* No set-up of the hardware will happen if IRQ_TYPE_NONE
* is passed as default type.
@@ -496,9 +493,6 @@ static void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq)
{
struct gpio_chip *chip = d->host_data;

-#ifdef CONFIG_ARM
- set_irq_flags(irq, 0);
-#endif
if (chip->can_sleep)
irq_set_nested_thread(irq, 0);
irq_set_chip_and_handler(irq, NULL, NULL);
--
2.1.0

2015-06-09 18:27:30

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 06/15] gpu/drm: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: David Airlie <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c | 1 -
drivers/gpu/ipu-v3/ipu-common.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c
index 33bd4c6..9a6a747 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c
@@ -165,7 +165,6 @@ static int mdp5_hw_irqdomain_map(struct irq_domain *d,

irq_set_chip_and_handler(irq, &mdp5_hw_irq_chip, handle_level_irq);
irq_set_chip_data(irq, mdp5_kms);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 67bab5c..eb95c94 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -1099,8 +1099,7 @@ static int ipu_irq_init(struct ipu_soc *ipu)
}

ret = irq_alloc_domain_generic_chips(ipu->domain, 32, 1, "IPU",
- handle_level_irq, 0,
- IRQF_VALID, 0);
+ handle_level_irq, 0, 0, 0);
if (ret < 0) {
dev_err(ipu->dev, "failed to alloc generic irq chips\n");
irq_domain_remove(ipu->domain);
--
2.1.0

2015-06-09 18:34:00

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 07/15] irqchip: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Alexander Shiyan <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/irqchip/exynos-combiner.c | 2 +-
drivers/irqchip/irq-armada-370-xp.c | 3 +--
drivers/irqchip/irq-bcm2835.c | 2 +-
drivers/irqchip/irq-clps711x.c | 6 +++---
drivers/irqchip/irq-gic-v3.c | 5 ++---
drivers/irqchip/irq-gic.c | 4 ++--
drivers/irqchip/irq-hip04.c | 4 ++--
drivers/irqchip/irq-keystone.c | 2 +-
drivers/irqchip/irq-mmp.c | 3 ---
drivers/irqchip/irq-mxs.c | 1 -
drivers/irqchip/irq-renesas-intc-irqpin.c | 1 -
drivers/irqchip/irq-renesas-irqc.c | 1 -
drivers/irqchip/irq-s3c24xx.c | 14 ++------------
drivers/irqchip/irq-sun4i.c | 2 +-
drivers/irqchip/irq-versatile-fpga.c | 2 +-
drivers/irqchip/irq-vic.c | 2 +-
drivers/irqchip/irq-vt8500.c | 1 -
drivers/irqchip/spear-shirq.c | 1 -
18 files changed, 18 insertions(+), 38 deletions(-)

diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c
index 5945223..46ecb4d 100644
--- a/drivers/irqchip/exynos-combiner.c
+++ b/drivers/irqchip/exynos-combiner.c
@@ -159,7 +159,7 @@ static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,

irq_set_chip_and_handler(irq, &combiner_chip, handle_level_irq);
irq_set_chip_data(irq, &combiner_data[hw >> 3]);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);

return 0;
}
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index daccc8b..af1d600 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -201,7 +201,6 @@ static int armada_370_xp_msi_map(struct irq_domain *domain, unsigned int virq,
{
irq_set_chip_and_handler(virq, &armada_370_xp_msi_irq_chip,
handle_simple_irq);
- set_irq_flags(virq, IRQF_VALID);

return 0;
}
@@ -318,7 +317,7 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
handle_level_irq);
}
- set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(virq);

return 0;
}
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c
index 5916d6c..66c30c6 100644
--- a/drivers/irqchip/irq-bcm2835.c
+++ b/drivers/irqchip/irq-bcm2835.c
@@ -165,7 +165,7 @@ static int __init armctrl_of_init(struct device_node *node,
BUG_ON(irq <= 0);
irq_set_chip_and_handler(irq, &armctrl_chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);
}
}

diff --git a/drivers/irqchip/irq-clps711x.c b/drivers/irqchip/irq-clps711x.c
index 33127f1..e3609ae 100644
--- a/drivers/irqchip/irq-clps711x.c
+++ b/drivers/irqchip/irq-clps711x.c
@@ -133,14 +133,14 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq,
irq_hw_number_t hw)
{
irq_flow_handler_t handler = handle_level_irq;
- unsigned int flags = IRQF_VALID | IRQF_PROBE;
+ unsigned int flags = 0;

if (!clps711x_irqs[hw].flags)
return 0;

if (clps711x_irqs[hw].flags & CLPS711X_FLAG_FIQ) {
handler = handle_bad_irq;
- flags |= IRQF_NOAUTOEN;
+ flags |= IRQ_NOAUTOEN;
} else if (clps711x_irqs[hw].eoi) {
handler = handle_fasteoi_irq;
}
@@ -150,7 +150,7 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq,
writel_relaxed(0, clps711x_intc->base + clps711x_irqs[hw].eoi);

irq_set_chip_and_handler(virq, &clps711x_intc_chip, handler);
- set_irq_flags(virq, flags);
+ irq_modify_status_flags(irq, IRQ_NOPROBE, flags);

return 0;
}
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 49875ad..a53e080 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -680,13 +680,13 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_percpu_devid(irq);
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_percpu_devid_irq, NULL, NULL);
- set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+ irq_set_status_flags(irq, IRQ_NOAUTOEN);
}
/* SPIs */
if (hw >= 32 && hw < gic_data.irq_nr) {
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_probe(irq);
}
/* LPIs */
if (hw >= 8192 && hw < GIC_ID_NR) {
@@ -694,7 +694,6 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
return -EPERM;
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
- set_irq_flags(irq, IRQF_VALID);
}

return 0;
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 01999d7..6730419 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -792,11 +792,11 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_percpu_devid(irq);
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_percpu_devid_irq, NULL, NULL);
- set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+ irq_set_status_flags(irq, IRQ_NOAUTOEN);
} else {
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);
}
return 0;
}
diff --git a/drivers/irqchip/irq-hip04.c b/drivers/irqchip/irq-hip04.c
index 7d6ffb5..c8778a5 100644
--- a/drivers/irqchip/irq-hip04.c
+++ b/drivers/irqchip/irq-hip04.c
@@ -304,11 +304,11 @@ static int hip04_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_percpu_devid(irq);
irq_set_chip_and_handler(irq, &hip04_irq_chip,
handle_percpu_devid_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+ irq_set_status_flags(irq, IRQ_NOAUTOEN);
} else {
irq_set_chip_and_handler(irq, &hip04_irq_chip,
handle_fasteoi_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);
}
irq_set_chip_data(irq, d->host_data);
return 0;
diff --git a/drivers/irqchip/irq-keystone.c b/drivers/irqchip/irq-keystone.c
index 78e8b3c..870c416 100644
--- a/drivers/irqchip/irq-keystone.c
+++ b/drivers/irqchip/irq-keystone.c
@@ -127,7 +127,7 @@ static int keystone_irq_map(struct irq_domain *h, unsigned int virq,

irq_set_chip_data(virq, kirq);
irq_set_chip_and_handler(virq, &kirq->chip, handle_level_irq);
- set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(virq);
return 0;
}

diff --git a/drivers/irqchip/irq-mmp.c b/drivers/irqchip/irq-mmp.c
index c0da57b..3dfef63 100644
--- a/drivers/irqchip/irq-mmp.c
+++ b/drivers/irqchip/irq-mmp.c
@@ -164,7 +164,6 @@ static int mmp_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_hw_number_t hw)
{
irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq);
- set_irq_flags(irq, IRQF_VALID);
return 0;
}

@@ -234,7 +233,6 @@ void __init icu_init_irq(void)
for (irq = 0; irq < 64; irq++) {
icu_mask_irq(irq_get_irq_data(irq));
irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq);
- set_irq_flags(irq, IRQF_VALID);
}
irq_set_default_host(icu_data[0].domain);
set_handle_irq(mmp_handle_irq);
@@ -337,7 +335,6 @@ void __init mmp2_init_icu(void)
irq_set_chip_and_handler(irq, &icu_irq_chip,
handle_level_irq);
}
- set_irq_flags(irq, IRQF_VALID);
}
irq_set_default_host(icu_data[0].domain);
set_handle_irq(mmp2_handle_irq);
diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c
index e4acf1e..0b8f981 100644
--- a/drivers/irqchip/irq-mxs.c
+++ b/drivers/irqchip/irq-mxs.c
@@ -85,7 +85,6 @@ static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq,
irq_hw_number_t hw)
{
irq_set_chip_and_handler(virq, &mxs_icoll_chip, handle_level_irq);
- set_irq_flags(virq, IRQF_VALID);

return 0;
}
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c
index 9a0767b..d7bcb7a 100644
--- a/drivers/irqchip/irq-renesas-intc-irqpin.c
+++ b/drivers/irqchip/irq-renesas-intc-irqpin.c
@@ -343,7 +343,6 @@ static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq,
intc_irqpin_dbg(&p->irq[hw], "map");
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
- set_irq_flags(virq, IRQF_VALID); /* kill me now */
return 0;
}

diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index cdf80b7..648053c 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -164,7 +164,6 @@ static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq,
irqc_dbg(&p->irq[hw], "map");
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
- set_irq_flags(virq, IRQF_VALID); /* kill me now */
return 0;
}

diff --git a/drivers/irqchip/irq-s3c24xx.c b/drivers/irqchip/irq-s3c24xx.c
index c8d373f..0df7452 100644
--- a/drivers/irqchip/irq-s3c24xx.c
+++ b/drivers/irqchip/irq-s3c24xx.c
@@ -469,13 +469,11 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,

irq_set_chip_data(virq, irq_data);

- set_irq_flags(virq, IRQF_VALID);
-
if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) {
if (irq_data->parent_irq > 31) {
pr_err("irq-s3c24xx: parent irq %lu is out of range\n",
irq_data->parent_irq);
- goto err;
+ return -EINVAL;
}

parent_irq_data = &parent_intc->irqs[irq_data->parent_irq];
@@ -488,18 +486,12 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
if (!irqno) {
pr_err("irq-s3c24xx: could not find mapping for parent irq %lu\n",
irq_data->parent_irq);
- goto err;
+ return -EINVAL;
}
irq_set_chained_handler(irqno, s3c_irq_demux);
}

return 0;
-
-err:
- set_irq_flags(virq, 0);
-
- /* the only error can result from bad mapping data*/
- return -EINVAL;
}

static struct irq_domain_ops s3c24xx_irq_ops = {
@@ -1177,8 +1169,6 @@ static int s3c24xx_irq_map_of(struct irq_domain *h, unsigned int virq,

irq_set_chip_data(virq, irq_data);

- set_irq_flags(virq, IRQF_VALID);
-
return 0;
}

diff --git a/drivers/irqchip/irq-sun4i.c b/drivers/irqchip/irq-sun4i.c
index 64155b6..71f2b54 100644
--- a/drivers/irqchip/irq-sun4i.c
+++ b/drivers/irqchip/irq-sun4i.c
@@ -84,7 +84,7 @@ static int sun4i_irq_map(struct irq_domain *d, unsigned int virq,
irq_hw_number_t hw)
{
irq_set_chip_and_handler(virq, &sun4i_irq_chip, handle_fasteoi_irq);
- set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(virq);

return 0;
}
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c
index 1ab4517..e81a946 100644
--- a/drivers/irqchip/irq-versatile-fpga.c
+++ b/drivers/irqchip/irq-versatile-fpga.c
@@ -128,7 +128,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, f);
irq_set_chip_and_handler(irq, &f->chip,
handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);
return 0;
}

diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c
index 54089de..0bb5225 100644
--- a/drivers/irqchip/irq-vic.c
+++ b/drivers/irqchip/irq-vic.c
@@ -202,7 +202,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
return -EPERM;
irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
irq_set_chip_data(irq, v->base);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_set_noprobe(irq);
return 0;
}

diff --git a/drivers/irqchip/irq-vt8500.c b/drivers/irqchip/irq-vt8500.c
index b7af816..4a66101 100644
--- a/drivers/irqchip/irq-vt8500.c
+++ b/drivers/irqchip/irq-vt8500.c
@@ -168,7 +168,6 @@ static int vt8500_irq_map(struct irq_domain *h, unsigned int virq,
irq_hw_number_t hw)
{
irq_set_chip_and_handler(virq, &vt8500_irq_chip, handle_level_irq);
- set_irq_flags(virq, IRQF_VALID);

return 0;
}
diff --git a/drivers/irqchip/spear-shirq.c b/drivers/irqchip/spear-shirq.c
index 9c145a7..6db93a8 100644
--- a/drivers/irqchip/spear-shirq.c
+++ b/drivers/irqchip/spear-shirq.c
@@ -213,7 +213,6 @@ static void __init spear_shirq_register(struct spear_shirq *shirq,
for (i = 0; i < shirq->nr_irqs; i++) {
irq_set_chip_and_handler(shirq->virq_base + i,
shirq->irq_chip, handle_simple_irq);
- set_irq_flags(shirq->virq_base + i, IRQF_VALID);
irq_set_chip_data(shirq->virq_base + i, shirq);
}
}
--
2.1.0

2015-06-09 18:58:10

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 08/15] memory: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: [email protected]
---
drivers/memory/omap-gpmc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index c94ea0d..0c833e2 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -1176,8 +1176,8 @@ static int gpmc_setup_irq(void)
gpmc_client_irq[i].irq = gpmc_irq_start + i;
irq_set_chip_and_handler(gpmc_client_irq[i].irq,
&gpmc_irq_chip, handle_simple_irq);
- set_irq_flags(gpmc_client_irq[i].irq,
- IRQF_VALID | IRQF_NOAUTOEN);
+ irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
+ IRQ_NOAUTOEN);
}

/* Disable interrupts */
@@ -1200,7 +1200,6 @@ static int gpmc_free_irq(void)
for (i = 0; i < GPMC_NR_IRQ; i++) {
irq_set_handler(gpmc_client_irq[i].irq, NULL);
irq_set_chip(gpmc_client_irq[i].irq, &no_irq_chip);
- irq_modify_status(gpmc_client_irq[i].irq, 0, 0);
}

irq_free_descs(gpmc_irq_start, GPMC_NR_IRQ);
--
2.1.0

2015-06-09 18:34:13

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 09/15] mfd: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Milo Kim <[email protected]>
Cc: Kumar Gala <[email protected]>
Cc: Andy Gross <[email protected]>
Cc: David Brown <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/mfd/88pm860x-core.c | 4 ----
drivers/mfd/ab8500-core.c | 4 ----
drivers/mfd/arizona-irq.c | 7 -------
drivers/mfd/asic3.c | 4 ++--
drivers/mfd/db8500-prcmu.c | 1 -
drivers/mfd/ezx-pcap.c | 6 +-----
drivers/mfd/htc-egpio.c | 4 ++--
drivers/mfd/htc-i2cpld.c | 6 +-----
drivers/mfd/lp8788-irq.c | 5 -----
drivers/mfd/max8925-core.c | 5 +----
drivers/mfd/max8997-irq.c | 5 +----
drivers/mfd/max8998-irq.c | 5 +----
drivers/mfd/mt6397-core.c | 4 ----
drivers/mfd/pm8921-core.c | 5 +----
drivers/mfd/rc5t583-irq.c | 4 +---
drivers/mfd/stmpe.c | 7 -------
drivers/mfd/t7l66xb.c | 6 ------
drivers/mfd/tc3589x.c | 7 -------
drivers/mfd/tc6393xb.c | 4 ++--
drivers/mfd/tps6586x.c | 7 -------
drivers/mfd/tps65912-irq.c | 8 +-------
drivers/mfd/twl4030-irq.c | 11 +----------
drivers/mfd/twl6030-irq.c | 13 -------------
drivers/mfd/ucb1x00-core.c | 2 +-
drivers/mfd/wm831x-irq.c | 7 -------
drivers/mfd/wm8350-irq.c | 8 +-------
drivers/mfd/wm8994-irq.c | 7 -------
27 files changed, 17 insertions(+), 139 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index d2a85cd..17984d65 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -558,11 +558,7 @@ static int pm860x_irq_domain_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, d->host_data);
irq_set_chip_and_handler(virq, &pm860x_irq_chip, handle_edge_irq);
irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif
return 0;
}

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index c80a292..24a159b 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -565,11 +565,7 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_and_handler(virq, &ab8500_irq_chip,
handle_simple_irq);
irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index d063b94..d32673d 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -174,14 +174,7 @@ static int arizona_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, data);
irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, 1);
-
- /* ARM needs us to explicitly flag the IRQ as valid
- * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 977bd3a..54a133c 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -411,7 +411,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev)

irq_set_chip_data(irq, asic);
irq_set_handler(irq, handle_level_irq);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK),
@@ -432,7 +432,7 @@ static void asic3_irq_remove(struct platform_device *pdev)
irq_base = asic->irq_base;

for (irq = irq_base; irq < irq_base + ASIC3_NR_IRQS; irq++) {
- set_irq_flags(irq, 0);
+ irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
irq_set_chip_and_handler(irq, NULL, NULL);
irq_set_chip_data(irq, NULL);
}
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index cc1a404..f533717 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -2654,7 +2654,6 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
{
irq_set_chip_and_handler(virq, &prcmu_irq_chip,
handle_simple_irq);
- set_irq_flags(virq, IRQF_VALID);

return 0;
}
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 5991fad..19e55dd 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -463,11 +463,7 @@ static int ezx_pcap_probe(struct spi_device *spi)
for (i = pcap->irq_base; i < (pcap->irq_base + PCAP_NIRQS); i++) {
irq_set_chip_and_handler(i, &pcap_irq_chip, handle_simple_irq);
irq_set_chip_data(i, pcap);
-#ifdef CONFIG_ARM
- set_irq_flags(i, IRQF_VALID);
-#else
- irq_set_noprobe(i);
-#endif
+ irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
}

/* mask/ack all PCAP interrupts */
diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c
index 49f39fe..c9d5e3f 100644
--- a/drivers/mfd/htc-egpio.c
+++ b/drivers/mfd/htc-egpio.c
@@ -350,7 +350,7 @@ static int __init egpio_probe(struct platform_device *pdev)
irq_set_chip_and_handler(irq, &egpio_muxed_chip,
handle_simple_irq);
irq_set_chip_data(irq, ei);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
irq_set_irq_type(ei->chained_irq, IRQ_TYPE_EDGE_RISING);
irq_set_handler_data(ei->chained_irq, ei);
@@ -376,7 +376,7 @@ static int __exit egpio_remove(struct platform_device *pdev)
irq_end = ei->irq_start + ei->nirqs;
for (irq = ei->irq_start; irq < irq_end; irq++) {
irq_set_chip_and_handler(irq, NULL, NULL);
- set_irq_flags(irq, 0);
+ irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
irq_set_chained_handler(ei->chained_irq, NULL);
device_init_wakeup(&pdev->dev, 0);
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index ebb9cf1..0467c08 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -330,11 +330,7 @@ static int htcpld_setup_chip_irq(
irq_set_chip_and_handler(irq, &htcpld_muxed_chip,
handle_simple_irq);
irq_set_chip_data(irq, chip);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-#else
- irq_set_probe(irq);
-#endif
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

return ret;
diff --git a/drivers/mfd/lp8788-irq.c b/drivers/mfd/lp8788-irq.c
index 23982db..6476b4f 100644
--- a/drivers/mfd/lp8788-irq.c
+++ b/drivers/mfd/lp8788-irq.c
@@ -141,12 +141,7 @@ static int lp8788_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, irqd);
irq_set_chip_and_handler(virq, chip, handle_edge_irq);
irq_set_nested_thread(virq, 1);
-
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}
diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c
index 97a787a..d755ef8 100644
--- a/drivers/mfd/max8925-core.c
+++ b/drivers/mfd/max8925-core.c
@@ -650,11 +650,8 @@ static int max8925_irq_domain_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, d->host_data);
irq_set_chip_and_handler(virq, &max8925_irq_chip, handle_edge_irq);
irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif
+
return 0;
}

diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
index 43fa614..ce025b2f 100644
--- a/drivers/mfd/max8997-irq.c
+++ b/drivers/mfd/max8997-irq.c
@@ -295,11 +295,8 @@ static int max8997_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, max8997);
irq_set_chip_and_handler(irq, &max8997_irq_chip, handle_edge_irq);
irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif
+
return 0;
}

diff --git a/drivers/mfd/max8998-irq.c b/drivers/mfd/max8998-irq.c
index c469477..8a37cf1 100644
--- a/drivers/mfd/max8998-irq.c
+++ b/drivers/mfd/max8998-irq.c
@@ -206,11 +206,8 @@ static int max8998_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, max8998);
irq_set_chip_and_handler(irq, &max8998_irq_chip, handle_edge_irq);
irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif
+
return 0;
}

diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 09bc780..c076e48 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -121,11 +121,7 @@ static int mt6397_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, mt6397);
irq_set_chip_and_handler(irq, &mt6397_irq_chip, handle_level_irq);
irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif

return 0;
}
diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c
index 5a92646..8ef8d71 100644
--- a/drivers/mfd/pm8921-core.c
+++ b/drivers/mfd/pm8921-core.c
@@ -251,11 +251,8 @@ static int pm8xxx_irq_domain_map(struct irq_domain *d, unsigned int irq,

irq_set_chip_and_handler(irq, &pm8xxx_irq_chip, handle_level_irq);
irq_set_chip_data(irq, chip);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif
+
return 0;
}

diff --git a/drivers/mfd/rc5t583-irq.c b/drivers/mfd/rc5t583-irq.c
index bb85020..3f8812d 100644
--- a/drivers/mfd/rc5t583-irq.c
+++ b/drivers/mfd/rc5t583-irq.c
@@ -386,9 +386,7 @@ int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base)
irq_set_chip_and_handler(__irq, &rc5t583_irq_chip,
handle_simple_irq);
irq_set_nested_thread(__irq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(__irq, IRQF_VALID);
-#endif
+ irq_clear_status_flags(__irq, IRQ_NOREQUEST);
}

ret = request_threaded_irq(irq, NULL, rc5t583_irq, IRQF_ONESHOT,
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 2d7fae9..ef3edd7 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -971,20 +971,13 @@ static int stmpe_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, stmpe);
irq_set_chip_and_handler(virq, chip, handle_edge_irq);
irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}

static void stmpe_irq_unmap(struct irq_domain *d, unsigned int virq)
{
-#ifdef CONFIG_ARM
- set_irq_flags(virq, 0);
-#endif
irq_set_chip_and_handler(virq, NULL, NULL);
irq_set_chip_data(virq, NULL);
}
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index c09fb5d..01af111 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -246,9 +246,6 @@ static void t7l66xb_attach_irq(struct platform_device *dev)
for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) {
irq_set_chip_and_handler(irq, &t7l66xb_chip, handle_level_irq);
irq_set_chip_data(irq, t7l66xb);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-#endif
}

irq_set_irq_type(t7l66xb->irq, IRQ_TYPE_EDGE_FALLING);
@@ -267,9 +264,6 @@ static void t7l66xb_detach_irq(struct platform_device *dev)
irq_set_handler_data(t7l66xb->irq, NULL);

for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) {
-#ifdef CONFIG_ARM
- set_irq_flags(irq, 0);
-#endif
irq_set_chip(irq, NULL);
irq_set_chip_data(irq, NULL);
}
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index cf35639..e7d14e5 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -215,20 +215,13 @@ static int tc3589x_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_and_handler(virq, &dummy_irq_chip,
handle_edge_irq);
irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}

static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq)
{
-#ifdef CONFIG_ARM
- set_irq_flags(virq, 0);
-#endif
irq_set_chip_and_handler(virq, NULL, NULL);
irq_set_chip_data(virq, NULL);
}
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 63458b3..c108472 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -586,7 +586,7 @@ static void tc6393xb_attach_irq(struct platform_device *dev)
for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) {
irq_set_chip_and_handler(irq, &tc6393xb_chip, handle_edge_irq);
irq_set_chip_data(irq, tc6393xb);
- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

irq_set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING);
@@ -605,7 +605,7 @@ static void tc6393xb_detach_irq(struct platform_device *dev)
irq_base = tc6393xb->irq_base;

for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) {
- set_irq_flags(irq, 0);
+ irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
irq_set_chip(irq, NULL);
irq_set_chip_data(irq, NULL);
}
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 8e1dbc4..a4f0251 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -299,14 +299,7 @@ static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, tps6586x);
irq_set_chip_and_handler(virq, &tps6586x_irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, 1);
-
- /* ARM needs us to explicitly flag the IRQ as valid
- * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}
diff --git a/drivers/mfd/tps65912-irq.c b/drivers/mfd/tps65912-irq.c
index fbecec7..db2c29cb 100644
--- a/drivers/mfd/tps65912-irq.c
+++ b/drivers/mfd/tps65912-irq.c
@@ -197,13 +197,7 @@ int tps65912_irq_init(struct tps65912 *tps65912, int irq,
irq_set_chip_and_handler(cur_irq, &tps65912_irq_chip,
handle_edge_irq);
irq_set_nested_thread(cur_irq, 1);
- /* ARM needs us to explicitly flag the IRQ as valid
- * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
- set_irq_flags(cur_irq, IRQF_VALID);
-#else
- irq_set_noprobe(cur_irq);
-#endif
+ irq_clear_status_flags(cur_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

ret = request_threaded_irq(irq, NULL, tps65912_irq, flags,
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index 1b772ef..7c36fc0 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -419,16 +419,7 @@ static int twl4030_init_sih_modules(unsigned line)

static inline void activate_irq(int irq)
{
-#ifdef CONFIG_ARM
- /*
- * ARM requires an extra step to clear IRQ_NOREQUEST, which it
- * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
- */
- set_irq_flags(irq, IRQF_VALID);
-#else
- /* same effect on other architectures */
- irq_set_noprobe(irq);
-#endif
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

/*----------------------------------------------------------------------*/
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
index 2807e1a..f7ea098 100644
--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -352,26 +352,13 @@ static int twl6030_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_and_handler(virq, &pdata->irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, true);
irq_set_parent(virq, pdata->twl_irq);
-
-#ifdef CONFIG_ARM
- /*
- * ARM requires an extra step to clear IRQ_NOREQUEST, which it
- * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
- */
- set_irq_flags(virq, IRQF_VALID);
-#else
- /* same effect on other architectures */
irq_set_noprobe(virq);
-#endif

return 0;
}

static void twl6030_irq_unmap(struct irq_domain *d, unsigned int virq)
{
-#ifdef CONFIG_ARM
- set_irq_flags(virq, 0);
-#endif
irq_set_chip_and_handler(virq, NULL, NULL);
irq_set_chip_data(virq, NULL);
}
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 58ea9fd..c706ead 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -562,7 +562,7 @@ static int ucb1x00_probe(struct mcp *mcp)

irq_set_chip_and_handler(irq, &ucb1x00_irqchip, handle_edge_irq);
irq_set_chip_data(irq, ucb);
- set_irq_flags(irq, IRQF_VALID | IRQ_NOREQUEST);
+ irq_clear_status_flags(irq, IRQ_NOREQUEST);
}

irq_set_irq_type(ucb->irq, IRQ_TYPE_EDGE_RISING);
diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c
index 64e512e..0edf213 100644
--- a/drivers/mfd/wm831x-irq.c
+++ b/drivers/mfd/wm831x-irq.c
@@ -552,14 +552,7 @@ static int wm831x_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &wm831x_irq_chip, handle_edge_irq);
irq_set_nested_thread(virq, 1);
-
- /* ARM needs us to explicitly flag the IRQ as valid
- * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}
diff --git a/drivers/mfd/wm8350-irq.c b/drivers/mfd/wm8350-irq.c
index 813ff50..27054f3 100644
--- a/drivers/mfd/wm8350-irq.c
+++ b/drivers/mfd/wm8350-irq.c
@@ -526,13 +526,7 @@ int wm8350_irq_init(struct wm8350 *wm8350, int irq,
handle_edge_irq);
irq_set_nested_thread(cur_irq, 1);

- /* ARM needs us to explicitly flag the IRQ as valid
- * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
- set_irq_flags(cur_irq, IRQF_VALID);
-#else
- irq_set_noprobe(cur_irq);
-#endif
+ irq_clear_status_flags(cur_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

ret = request_threaded_irq(irq, NULL, wm8350_irq, flags,
diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c
index a14407e..6dbf108 100644
--- a/drivers/mfd/wm8994-irq.c
+++ b/drivers/mfd/wm8994-irq.c
@@ -172,14 +172,7 @@ static int wm8994_edge_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, wm8994);
irq_set_chip_and_handler(virq, &wm8994_edge_irq_chip, handle_edge_irq);
irq_set_nested_thread(virq, 1);
-
- /* ARM needs us to explicitly flag the IRQ as valid
- * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
- set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
}
--
2.1.0

2015-06-09 18:28:32

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 10/15] PCI: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Kishon Vijay Abraham I <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Murali Karicheri <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Jingoo Han <[email protected]>
Cc: Pratyush Anand <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: "Sören Brinkmann" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/pci/host/pci-dra7xx.c | 1 -
drivers/pci/host/pci-keystone-dw.c | 2 --
drivers/pci/host/pci-tegra.c | 1 -
drivers/pci/host/pcie-designware.c | 1 -
drivers/pci/host/pcie-rcar.c | 1 -
drivers/pci/host/pcie-xilinx.c | 2 --
6 files changed, 8 deletions(-)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 2d57e19..94cbc4d 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -160,7 +160,6 @@ static int dra7xx_pcie_intx_map(struct irq_domain *domain, unsigned int irq,
{
irq_set_chip_and_handler(irq, &dummy_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain->host_data);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/drivers/pci/host/pci-keystone-dw.c b/drivers/pci/host/pci-keystone-dw.c
index f34892e..f1d0749 100644
--- a/drivers/pci/host/pci-keystone-dw.c
+++ b/drivers/pci/host/pci-keystone-dw.c
@@ -196,7 +196,6 @@ static int ks_dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
irq_set_chip_and_handler(irq, &ks_dw_pcie_msi_irq_chip,
handle_level_irq);
irq_set_chip_data(irq, domain->host_data);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
@@ -277,7 +276,6 @@ static int ks_dw_pcie_init_legacy_irq_map(struct irq_domain *d,
irq_set_chip_and_handler(irq, &ks_dw_pcie_legacy_irq_chip,
handle_level_irq);
irq_set_chip_data(irq, d->host_data);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 00e9272..36bd700 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1263,7 +1263,6 @@ static int tegra_msi_map(struct irq_domain *domain, unsigned int irq,
{
irq_set_chip_and_handler(irq, &tegra_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain->host_data);
- set_irq_flags(irq, IRQF_VALID);

tegra_cpuidle_pcie_irqs_in_use();

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 2e9f84f..5caa94d 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -333,7 +333,6 @@ static int dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
{
irq_set_chip_and_handler(irq, &dw_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain->host_data);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index c086210..7678fe0 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -664,7 +664,6 @@ static int rcar_msi_map(struct irq_domain *domain, unsigned int irq,
{
irq_set_chip_and_handler(irq, &rcar_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain->host_data);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index f1a06a0..72015119 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -338,7 +338,6 @@ static int xilinx_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
{
irq_set_chip_and_handler(irq, &xilinx_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain->host_data);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
@@ -377,7 +376,6 @@ static int xilinx_pcie_intx_map(struct irq_domain *domain, unsigned int irq,
{
irq_set_chip_and_handler(irq, &dummy_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain->host_data);
- set_irq_flags(irq, IRQF_VALID);

return 0;
}
--
2.1.0

2015-06-09 18:27:58

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 11/15] pinctrl: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Tomasz Figa <[email protected]>
Cc: Thomas Abraham <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/pinctrl/bcm/pinctrl-bcm2835.c | 1 -
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 --
drivers/pinctrl/pinctrl-single.c | 5 -----
drivers/pinctrl/samsung/pinctrl-exynos.c | 1 -
drivers/pinctrl/samsung/pinctrl-exynos5440.c | 1 -
drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 --
drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 --
7 files changed, 14 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 8d908e3..de34017 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -987,7 +987,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
irq_set_chip_and_handler(irq, &bcm2835_gpio_irq_chip,
handle_level_irq);
irq_set_chip_data(irq, pc);
- set_irq_flags(irq, IRQF_VALID);
}

for (i = 0; i < BCM2835_NUM_BANKS; i++) {
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 474812e..e80cd1a 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -1239,12 +1239,10 @@ int mtk_pctrl_init(struct platform_device *pdev,
irq_set_chip_and_handler(virq, &mtk_pinctrl_irq_chip,
handle_level_irq);
irq_set_chip_data(virq, pctl);
- set_irq_flags(virq, IRQF_VALID);
};

irq_set_chained_handler(irq, mtk_eint_irq_handler);
irq_set_handler_data(irq, pctl);
- set_irq_flags(irq, IRQF_VALID);
return 0;

chip_error:
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 13b45f2..6f0da84 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1716,12 +1716,7 @@ static int pcs_irqdomain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, pcs_soc);
irq_set_chip_and_handler(irq, &pcs->chip,
handle_level_irq);
-
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
irq_set_noprobe(irq);
-#endif

return 0;
}
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index 0b7afa5..9996183 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -256,7 +256,6 @@ static int exynos_eint_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, b);
irq_set_chip_and_handler(virq, &b->irq_chip->chip,
handle_level_irq);
- set_irq_flags(virq, IRQF_VALID);
return 0;
}

diff --git a/drivers/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c
index 86192be..3eb7b11 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c
@@ -929,7 +929,6 @@ static int exynos5440_gpio_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, d);
irq_set_chip_and_handler(virq, &exynos5440_gpio_irq_chip,
handle_level_irq);
- set_irq_flags(virq, IRQF_VALID);
return 0;
}

diff --git a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
index f1993f42..189f15b 100644
--- a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
+++ b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
@@ -437,7 +437,6 @@ static int s3c24xx_gpf_irq_map(struct irq_domain *h, unsigned int virq,
handle_edge_irq);
}
irq_set_chip_data(virq, bank);
- set_irq_flags(virq, IRQF_VALID);
return 0;
}

@@ -457,7 +456,6 @@ static int s3c24xx_gpg_irq_map(struct irq_domain *h, unsigned int virq,

irq_set_chip_and_handler(virq, &s3c24xx_eint_chip, handle_edge_irq);
irq_set_chip_data(virq, bank);
- set_irq_flags(virq, IRQF_VALID);
return 0;
}

diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
index 7756c1e..1134f18 100644
--- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
+++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
@@ -395,7 +395,6 @@ static int s3c64xx_gpio_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_and_handler(virq,
&s3c64xx_gpio_irq_chip, handle_level_irq);
irq_set_chip_data(virq, bank);
- set_irq_flags(virq, IRQF_VALID);

return 0;
}
@@ -674,7 +673,6 @@ static int s3c64xx_eint0_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_and_handler(virq,
&s3c64xx_eint0_irq_chip, handle_level_irq);
irq_set_chip_data(virq, ddata);
- set_irq_flags(virq, IRQF_VALID);

return 0;
}
--
2.1.0

2015-06-09 18:27:44

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 12/15] SH: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: [email protected]
---
drivers/sh/intc/internals.h | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
index 7dff08e..897ffb1 100644
--- a/drivers/sh/intc/internals.h
+++ b/drivers/sh/intc/internals.h
@@ -99,15 +99,7 @@ static inline struct intc_desc_int *get_intc_desc(unsigned int irq)
*/
static inline void activate_irq(int irq)
{
-#ifdef CONFIG_ARM
- /* ARM requires an extra step to clear IRQ_NOREQUEST, which it
- * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
- */
- set_irq_flags(irq, IRQF_VALID);
-#else
- /* same effect on other architectures */
- irq_set_noprobe(irq);
-#endif
+ irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

static inline int intc_handle_int_cmp(const void *a, const void *b)
--
2.1.0

2015-06-09 18:52:08

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 13/15] tty/serial: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Barry Song <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/tty/serial/serial_ks8695.c | 2 +-
drivers/tty/serial/sirfsoc_uart.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c
index 5c79bda..b4decf8 100644
--- a/drivers/tty/serial/serial_ks8695.c
+++ b/drivers/tty/serial/serial_ks8695.c
@@ -328,7 +328,7 @@ static int ks8695uart_startup(struct uart_port *port)
{
int retval;

- set_irq_flags(KS8695_IRQ_UART_TX, IRQF_VALID | IRQF_NOAUTOEN);
+ irq_modify_status(KS8695_IRQ_UART_TX, IRQ_NOREQUEST, IRQ_NOAUTOEN);
tx_enable(port, 0);
rx_enable(port, 1);
ms_enable(port, 1);
diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c
index 9de3eab..bcc298d 100644
--- a/drivers/tty/serial/sirfsoc_uart.c
+++ b/drivers/tty/serial/sirfsoc_uart.c
@@ -1053,7 +1053,7 @@ static int sirfsoc_uart_startup(struct uart_port *port)
struct sirfsoc_register *ureg = &sirfport->uart_reg->uart_reg;
unsigned int index = port->line;
int ret;
- set_irq_flags(port->irq, IRQF_VALID | IRQF_NOAUTOEN);
+ irq_modify_status(port->irq, IRQ_NOREQUEST, IRQ_NOAUTOEN);
ret = request_irq(port->irq,
sirfsoc_uart_isr,
0,
@@ -1100,8 +1100,8 @@ static int sirfsoc_uart_startup(struct uart_port *port)
sirfport->ms_enabled = false;
if (sirfport->uart_reg->uart_type == SIRF_USP_UART &&
sirfport->hw_flow_ctrl) {
- set_irq_flags(gpio_to_irq(sirfport->cts_gpio),
- IRQF_VALID | IRQF_NOAUTOEN);
+ irq_modify_status(gpio_to_irq(sirfport->cts_gpio),
+ IRQ_NOREQUEST, IRQ_NOAUTOEN);
ret = request_irq(gpio_to_irq(sirfport->cts_gpio),
sirfsoc_uart_usp_cts_handler, IRQF_TRIGGER_FALLING |
IRQF_TRIGGER_RISING, "usp_cts_irq", sirfport);
--
2.1.0

2015-06-09 18:57:01

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 14/15] ARM: remove ununsed set_irq_flags

Now that all users of set_irq_flags and custom flags are converted to
genirq functions, the ARM specific set_irq_flags can be removed.

Signed-off-by: Rob Herring <[email protected]>
Cc: Russell King <[email protected]>
Cc: [email protected]
---
arch/arm/include/asm/hw_irq.h | 6 ------
arch/arm/kernel/irq.c | 20 --------------------
2 files changed, 26 deletions(-)

diff --git a/arch/arm/include/asm/hw_irq.h b/arch/arm/include/asm/hw_irq.h
index af79da4..9beb929 100644
--- a/arch/arm/include/asm/hw_irq.h
+++ b/arch/arm/include/asm/hw_irq.h
@@ -11,12 +11,6 @@ static inline void ack_bad_irq(int irq)
pr_crit("unexpected IRQ trap at vector %02x\n", irq);
}

-void set_irq_flags(unsigned int irq, unsigned int flags);
-
-#define IRQF_VALID (1 << 0)
-#define IRQF_PROBE (1 << 1)
-#define IRQF_NOAUTOEN (1 << 2)
-
#define ARCH_IRQ_INIT_FLAGS (IRQ_NOREQUEST | IRQ_NOPROBE)

#endif
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 350f188..4072266 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -78,26 +78,6 @@ asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
handle_IRQ(irq, regs);
}

-void set_irq_flags(unsigned int irq, unsigned int iflags)
-{
- unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
-
- if (irq >= nr_irqs) {
- pr_err("Trying to set irq flags for IRQ%d\n", irq);
- return;
- }
-
- if (iflags & IRQF_VALID)
- clr |= IRQ_NOREQUEST;
- if (iflags & IRQF_PROBE)
- clr |= IRQ_NOPROBE;
- if (!(iflags & IRQF_NOAUTOEN))
- clr |= IRQ_NOAUTOEN;
- /* Order is clear bits in "clr" then set bits in "set" */
- irq_modify_status(irq, clr, set & ~clr);
-}
-EXPORT_SYMBOL_GPL(set_irq_flags);
-
void __init init_IRQ(void)
{
int ret;
--
2.1.0

2015-06-09 18:49:48

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 15/15] arm64: remove ununsed set_irq_flags

Now that all users of set_irq_flags and custom flags are converted to
genirq functions, the ARM specific set_irq_flags can be removed.

Signed-off-by: Rob Herring <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: [email protected]
---
arch/arm64/include/asm/hardirq.h | 5 -----
1 file changed, 5 deletions(-)

diff --git a/arch/arm64/include/asm/hardirq.h b/arch/arm64/include/asm/hardirq.h
index 6aae421..1679d22 100644
--- a/arch/arm64/include/asm/hardirq.h
+++ b/arch/arm64/include/asm/hardirq.h
@@ -47,9 +47,4 @@ static inline void ack_bad_irq(unsigned int irq)
irq_err_count++;
}

-/*
- * No arch-specific IRQ flags.
- */
-#define set_irq_flags(irq, flags)
-
#endif /* __ASM_HARDIRQ_H */
--
2.1.0

2015-06-09 18:44:52

by Boris Brezillon

[permalink] [raw]
Subject: Re: [PATCH 03/15] clk: kill off set_irq_flags usage

On Tue, 9 Jun 2015 13:26:29 -0500
Rob Herring <[email protected]> wrote:

> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>

Acked-by: Boris Brezillon <[email protected]>

> Cc: Boris Brezillon <[email protected]>
> Cc: Mike Turquette <[email protected]>
> Cc: Stephen Boyd <[email protected]>
> Cc: [email protected]
> ---
> drivers/clk/at91/pmc.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
> index 3f27d21..828b196 100644
> --- a/drivers/clk/at91/pmc.c
> +++ b/drivers/clk/at91/pmc.c
> @@ -125,7 +125,6 @@ static int pmc_irq_map(struct irq_domain *h, unsigned int virq,
>
> irq_set_chip_and_handler(virq, &pmc_irq,
> handle_level_irq);
> - set_irq_flags(virq, IRQF_VALID);
> irq_set_chip_data(virq, pmc);
>
> return 0;



--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

2015-06-09 18:52:25

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 03/15] clk: kill off set_irq_flags usage

On 06/09, Rob Herring wrote:
> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Boris Brezillon <[email protected]>
> Cc: Mike Turquette <[email protected]>
> Cc: Stephen Boyd <[email protected]>
> Cc: [email protected]
> ---

Acked-by: Stephen Boyd <[email protected]>

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

2015-06-09 19:12:59

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 02/15] regmap: kill off set_irq_flags usage

On Tue, Jun 09, 2015 at 01:26:28PM -0500, Rob Herring wrote:

> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.

Well, I don't think it's blind - IIRC it's just that this code all
predates the genirq flags and ARM had the opposite default to x86 (I
guess because of being conservative about all the random interrupt
controllers you get and what might be hanging off them) so we needed to
do this dance to get interrupts to work.

Anyway, I've applied this - thanks.


Attachments:
(No filename) (520.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments

2015-06-09 20:30:42

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 00/15] Kill off set_irq_flags

On Tue, Jun 09, 2015 at 01:26:26PM -0500, Rob Herring wrote:
> This series converts all users of ARM specific set_irq_flags to use
> common genirq functions. In many cases where irqdomains are used, the
> set_irq_flags calls were redundant, so I've removed them.
>
> This is not intended for 4.2, but if any subsystem maintainers want to
> pick up their subsystem's change that is fine. All but the last 2
> patches stand on their own. Any new drivers going into 4.2 may need a
> similar change, but I'm sure people are told not to use set_irq_flags in
> reviews. ;)

So what are you doing about the initial state of IRQs on legacy ARM where
IRQs start off being un-requestable, and need the set_irq_flags() to make
them requestable. I think you could be introducing a massive regression
by making this change.

Unless you can prove that this isn't the case, you shouldn't be removing
this stuff, especially not from legacy platforms.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

2015-06-09 21:23:34

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 00/15] Kill off set_irq_flags

On Tue, Jun 9, 2015 at 3:28 PM, Russell King - ARM Linux
<[email protected]> wrote:
> On Tue, Jun 09, 2015 at 01:26:26PM -0500, Rob Herring wrote:
>> This series converts all users of ARM specific set_irq_flags to use
>> common genirq functions. In many cases where irqdomains are used, the
>> set_irq_flags calls were redundant, so I've removed them.
>>
>> This is not intended for 4.2, but if any subsystem maintainers want to
>> pick up their subsystem's change that is fine. All but the last 2
>> patches stand on their own. Any new drivers going into 4.2 may need a
>> similar change, but I'm sure people are told not to use set_irq_flags in
>> reviews. ;)
>
> So what are you doing about the initial state of IRQs on legacy ARM where
> IRQs start off being un-requestable, and need the set_irq_flags() to make
> them requestable. I think you could be introducing a massive regression
> by making this change.

None of that changes. The initial state is set by ARCH_IRQ_INIT_FLAGS
which I've not changed:

#define ARCH_IRQ_INIT_FLAGS (IRQ_NOREQUEST | IRQ_NOPROBE)

> Unless you can prove that this isn't the case, you shouldn't be removing
> this stuff, especially not from legacy platforms.

set_irq_flags() only does a translation from custom ARM IRQF_* flags
to standard flags and then calls irq_modify_status(). This only
removes the translation and users set/clear standard flags directly.
It is a straight-forward removal of a wrapper function.

I *would* like to get rid of ARCH_IRQ_INIT_FLAGS and have the same
defaults across arches, but yes that would likely cause regressions.

Rob

2015-06-09 21:27:29

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 02/15] regmap: kill off set_irq_flags usage

On Tue, Jun 09, 2015 at 08:12:11PM +0100, Mark Brown wrote:
> On Tue, Jun 09, 2015 at 01:26:28PM -0500, Rob Herring wrote:
>
> > clear that is really needed. There appears to be a great deal of blind
> > copy and paste of this code.
>
> Well, I don't think it's blind - IIRC it's just that this code all
> predates the genirq flags and ARM had the opposite default to x86 (I
> guess because of being conservative about all the random interrupt
> controllers you get and what might be hanging off them) so we needed to
> do this dance to get interrupts to work.

It's because there exist platforms where specific IRQs are permanently
asserted, and unexpectedly claiming such an interrupt (eg, through IRQ
probing) would lock the system - at least before we ended up with the
detection in genirq (which has its roots in the ARM code.)

The problem is we're dealing with history here, and flipping ARM from
defaulting to "IRQs not valid" to "All IRQs valid" is a far from
trivial task.

I'd suggest people think carefully about applying these patches. They
have only been around for a matter of hours, so to rush to apply them
when they haven't been revewied as a whole to assess whether the approach
is the right one is rather hasty.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

2015-06-09 23:21:04

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 02/15] regmap: kill off set_irq_flags usage

On Tue, Jun 09, 2015 at 10:27:09PM +0100, Russell King - ARM Linux wrote:

> It's because there exist platforms where specific IRQs are permanently
> asserted, and unexpectedly claiming such an interrupt (eg, through IRQ
> probing) would lock the system - at least before we ended up with the
> detection in genirq (which has its roots in the ARM code.)

Ah, yes - now I remember. I just had a vauge recollection of broken
probing.

> I'd suggest people think carefully about applying these patches. They
> have only been around for a matter of hours, so to rush to apply them
> when they haven't been revewied as a whole to assess whether the approach
> is the right one is rather hasty.

I'm fairly comfortable with the patch for regmap as that code is
architecture neutral, should already have been consistent and the
non-ARM path has definitely been tested (I've done it myself).


Attachments:
(No filename) (886.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments

2015-06-10 12:42:12

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 11/15] pinctrl: kill off set_irq_flags usage

On Tue, Jun 9, 2015 at 8:26 PM, Rob Herring <[email protected]> wrote:

> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Linus Walleij <[email protected]>
> Cc: Stephen Warren <[email protected]>
> Cc: Lee Jones <[email protected]>
> Cc: Matthias Brugger <[email protected]>
> Cc: Tomasz Figa <[email protected]>
> Cc: Thomas Abraham <[email protected]>
> Cc: Kukjin Kim <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2015-06-10 12:43:15

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 05/15] gpio: kill off set_irq_flags usage

On Tue, Jun 9, 2015 at 8:26 PM, Rob Herring <[email protected]> wrote:

> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Michael Hennerich <[email protected]>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: Ray Jui <[email protected]>
> Cc: Stephen Warren <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2015-06-10 12:44:03

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 09/15] mfd: kill off set_irq_flags usage

On Tue, Jun 9, 2015 at 8:26 PM, Rob Herring <[email protected]> wrote:

> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Samuel Ortiz <[email protected]>
> Cc: Lee Jones <[email protected]>
> Cc: Linus Walleij <[email protected]>
> Cc: Milo Kim <[email protected]>
> Cc: Kumar Gala <[email protected]>
> Cc: Andy Gross <[email protected]>
> Cc: David Brown <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2015-06-10 16:56:21

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH 15/15] arm64: remove ununsed set_irq_flags

On Tue, Jun 09, 2015 at 01:26:41PM -0500, Rob Herring wrote:
> Now that all users of set_irq_flags and custom flags are converted to
> genirq functions, the ARM specific set_irq_flags can be removed.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Catalin Marinas <[email protected]>
> Cc: Will Deacon <[email protected]>
> Cc: [email protected]
> ---
> arch/arm64/include/asm/hardirq.h | 5 -----
> 1 file changed, 5 deletions(-)

Acked-by: Catalin Marinas <[email protected]>

2015-06-10 17:14:00

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 07/15] irqchip: kill off set_irq_flags usage

On Tue, Jun 9, 2015 at 1:26 PM, Rob Herring <[email protected]> wrote:
> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.

[...]

> diff --git a/drivers/irqchip/irq-clps711x.c b/drivers/irqchip/irq-clps711x.c
> index 33127f1..e3609ae 100644
> --- a/drivers/irqchip/irq-clps711x.c
> +++ b/drivers/irqchip/irq-clps711x.c
> @@ -133,14 +133,14 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq,
> irq_hw_number_t hw)
> {
> irq_flow_handler_t handler = handle_level_irq;
> - unsigned int flags = IRQF_VALID | IRQF_PROBE;
> + unsigned int flags = 0;
>
> if (!clps711x_irqs[hw].flags)
> return 0;
>
> if (clps711x_irqs[hw].flags & CLPS711X_FLAG_FIQ) {
> handler = handle_bad_irq;
> - flags |= IRQF_NOAUTOEN;
> + flags |= IRQ_NOAUTOEN;
> } else if (clps711x_irqs[hw].eoi) {
> handler = handle_fasteoi_irq;
> }
> @@ -150,7 +150,7 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq,
> writel_relaxed(0, clps711x_intc->base + clps711x_irqs[hw].eoi);
>
> irq_set_chip_and_handler(virq, &clps711x_intc_chip, handler);
> - set_irq_flags(virq, flags);
> + irq_modify_status_flags(irq, IRQ_NOPROBE, flags);

One fix needed here:

diff --git a/drivers/irqchip/irq-clps711x.c b/drivers/irqchip/irq-clps711x.c
index e3609ae..2e74e81 100644
--- a/drivers/irqchip/irq-clps711x.c
+++ b/drivers/irqchip/irq-clps711x.c
@@ -150,7 +150,7 @@ static int __init clps711x_intc_irq_map(struct
irq_domain *h, unsigned int virq,
writel_relaxed(0, clps711x_intc->base + clps711x_irqs[hw].eoi);

irq_set_chip_and_handler(virq, &clps711x_intc_chip, handler);
- irq_modify_status_flags(irq, IRQ_NOPROBE, flags);
+ irq_modify_status(virq, IRQ_NOPROBE, flags);

return 0;
}

2015-06-10 23:32:20

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 00/15] Kill off set_irq_flags

Rob Herring <[email protected]> writes:

> On Tue, Jun 9, 2015 at 3:28 PM, Russell King - ARM Linux
> <[email protected]> wrote:
>> On Tue, Jun 09, 2015 at 01:26:26PM -0500, Rob Herring wrote:
>>> This series converts all users of ARM specific set_irq_flags to use
>>> common genirq functions. In many cases where irqdomains are used, the
>>> set_irq_flags calls were redundant, so I've removed them.
>>>
>>> This is not intended for 4.2, but if any subsystem maintainers want to
>>> pick up their subsystem's change that is fine. All but the last 2
>>> patches stand on their own. Any new drivers going into 4.2 may need a
>>> similar change, but I'm sure people are told not to use set_irq_flags in
>>> reviews. ;)
>>
>> So what are you doing about the initial state of IRQs on legacy ARM where
>> IRQs start off being un-requestable, and need the set_irq_flags() to make
>> them requestable. I think you could be introducing a massive regression
>> by making this change.
>
> None of that changes. The initial state is set by ARCH_IRQ_INIT_FLAGS
> which I've not changed:
>
> #define ARCH_IRQ_INIT_FLAGS (IRQ_NOREQUEST | IRQ_NOPROBE)
>
>> Unless you can prove that this isn't the case, you shouldn't be removing
>> this stuff, especially not from legacy platforms.
>
> set_irq_flags() only does a translation from custom ARM IRQF_* flags
> to standard flags and then calls irq_modify_status(). This only
> removes the translation and users set/clear standard flags directly.
> It is a straight-forward removal of a wrapper function.
>
> I *would* like to get rid of ARCH_IRQ_INIT_FLAGS and have the same
> defaults across arches, but yes that would likely cause regressions.

For some reason, I don't have 00/15 in my inbox or list folders, so
replying here...

I gave this series a spin through the kernelci.org build/boot bot where
it was booted on ~20 different ARM SoC families and mulitple different
defconfigs, and there were no boot failures, so it at least passes a
basic boot sanity check.

If you think it's appropriate, feel free to add :

Tested-by: Kevin Hilman <[email protected]>

Kevin

[1] http://kernelci.org/boot/all/job/khilman/kernel/v4.1-rc7-15-g64b9a5c929f7/

2015-06-11 08:51:24

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 09/15] mfd: kill off set_irq_flags usage

On Tue, 09 Jun 2015, Rob Herring wrote:

> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Samuel Ortiz <[email protected]>
> Cc: Lee Jones <[email protected]>
> Cc: Linus Walleij <[email protected]>
> Cc: Milo Kim <[email protected]>
> Cc: Kumar Gala <[email protected]>
> Cc: Andy Gross <[email protected]>
> Cc: David Brown <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> ---
> drivers/mfd/88pm860x-core.c | 4 ----
> drivers/mfd/ab8500-core.c | 4 ----
> drivers/mfd/arizona-irq.c | 7 -------
> drivers/mfd/asic3.c | 4 ++--
> drivers/mfd/db8500-prcmu.c | 1 -
> drivers/mfd/ezx-pcap.c | 6 +-----
> drivers/mfd/htc-egpio.c | 4 ++--
> drivers/mfd/htc-i2cpld.c | 6 +-----
> drivers/mfd/lp8788-irq.c | 5 -----
> drivers/mfd/max8925-core.c | 5 +----
> drivers/mfd/max8997-irq.c | 5 +----
> drivers/mfd/max8998-irq.c | 5 +----
> drivers/mfd/mt6397-core.c | 4 ----
> drivers/mfd/pm8921-core.c | 5 +----
> drivers/mfd/rc5t583-irq.c | 4 +---
> drivers/mfd/stmpe.c | 7 -------
> drivers/mfd/t7l66xb.c | 6 ------
> drivers/mfd/tc3589x.c | 7 -------
> drivers/mfd/tc6393xb.c | 4 ++--
> drivers/mfd/tps6586x.c | 7 -------
> drivers/mfd/tps65912-irq.c | 8 +-------
> drivers/mfd/twl4030-irq.c | 11 +----------
> drivers/mfd/twl6030-irq.c | 13 -------------
> drivers/mfd/ucb1x00-core.c | 2 +-
> drivers/mfd/wm831x-irq.c | 7 -------
> drivers/mfd/wm8350-irq.c | 8 +-------
> drivers/mfd/wm8994-irq.c | 7 -------
> 27 files changed, 17 insertions(+), 139 deletions(-)

Acked-by: Lee Jones <[email protected]>

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2015-06-11 12:19:31

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH 08/15] memory: kill off set_irq_flags usage

Rob,

On Tue, 9 Jun 2015 13:26:34 -0500
Rob Herring <[email protected]> wrote:

> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Roger Quadros <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: [email protected]
> ---
> drivers/memory/omap-gpmc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index c94ea0d..0c833e2 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -1176,8 +1176,8 @@ static int gpmc_setup_irq(void)
> gpmc_client_irq[i].irq = gpmc_irq_start + i;
> irq_set_chip_and_handler(gpmc_client_irq[i].irq,
> &gpmc_irq_chip, handle_simple_irq);
> - set_irq_flags(gpmc_client_irq[i].irq,
> - IRQF_VALID | IRQF_NOAUTOEN);
> + irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
> + IRQ_NOAUTOEN);

Shouldn't this be
irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
IRQ_NOAUTOEN | IRQ_NOPROBE);
?

> }
>
> /* Disable interrupts */
> @@ -1200,7 +1200,6 @@ static int gpmc_free_irq(void)
> for (i = 0; i < GPMC_NR_IRQ; i++) {
> irq_set_handler(gpmc_client_irq[i].irq, NULL);
> irq_set_chip(gpmc_client_irq[i].irq, &no_irq_chip);
> - irq_modify_status(gpmc_client_irq[i].irq, 0, 0);
> }
>
> irq_free_descs(gpmc_irq_start, GPMC_NR_IRQ);

cheers,
-roger

2015-06-11 13:18:12

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 08/15] memory: kill off set_irq_flags usage

On Thu, Jun 11, 2015 at 7:18 AM, Roger Quadros <[email protected]> wrote:
> Rob,
>
> On Tue, 9 Jun 2015 13:26:34 -0500
> Rob Herring <[email protected]> wrote:
>
>> set_irq_flags is ARM specific with custom flags which have genirq
>> equivalents. Convert drivers to use the genirq interfaces directly, so we
>> can kill off set_irq_flags. The translation of flags is as follows:
>>
>> IRQF_VALID -> !IRQ_NOREQUEST
>> IRQF_PROBE -> !IRQ_NOPROBE
>> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>>
>> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
>> and setting IRQ_NOREQUEST already, so there is no need to do this in
>> .map() functions and we can simply remove the set_irq_flags calls. Some
>> users also set IRQ_NOPROBE and this has been maintained although it is not
>> clear that is really needed. There appears to be a great deal of blind
>> copy and paste of this code.
>>
>> Signed-off-by: Rob Herring <[email protected]>
>> Cc: Roger Quadros <[email protected]>
>> Cc: Tony Lindgren <[email protected]>
>> Cc: [email protected]
>> ---
>> drivers/memory/omap-gpmc.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
>> index c94ea0d..0c833e2 100644
>> --- a/drivers/memory/omap-gpmc.c
>> +++ b/drivers/memory/omap-gpmc.c
>> @@ -1176,8 +1176,8 @@ static int gpmc_setup_irq(void)
>> gpmc_client_irq[i].irq = gpmc_irq_start + i;
>> irq_set_chip_and_handler(gpmc_client_irq[i].irq,
>> &gpmc_irq_chip, handle_simple_irq);
>> - set_irq_flags(gpmc_client_irq[i].irq,
>> - IRQF_VALID | IRQF_NOAUTOEN);
>> + irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
>> + IRQ_NOAUTOEN);
>
> Shouldn't this be
> irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
> IRQ_NOAUTOEN | IRQ_NOPROBE);
> ?

Only if this needs to work on !ARM. The default for ARM is IRQ_NOPROBE set.

Rob

2015-06-11 14:01:26

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH 08/15] memory: kill off set_irq_flags usage

On Thu, 11 Jun 2015 08:17:45 -0500
Rob Herring <[email protected]> wrote:

> On Thu, Jun 11, 2015 at 7:18 AM, Roger Quadros <[email protected]> wrote:
> > Rob,
> >
> > On Tue, 9 Jun 2015 13:26:34 -0500
> > Rob Herring <[email protected]> wrote:
> >
> >> set_irq_flags is ARM specific with custom flags which have genirq
> >> equivalents. Convert drivers to use the genirq interfaces directly, so we
> >> can kill off set_irq_flags. The translation of flags is as follows:
> >>
> >> IRQF_VALID -> !IRQ_NOREQUEST
> >> IRQF_PROBE -> !IRQ_NOPROBE
> >> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
> >>
> >> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> >> and setting IRQ_NOREQUEST already, so there is no need to do this in
> >> .map() functions and we can simply remove the set_irq_flags calls. Some
> >> users also set IRQ_NOPROBE and this has been maintained although it is not
> >> clear that is really needed. There appears to be a great deal of blind
> >> copy and paste of this code.
> >>
> >> Signed-off-by: Rob Herring <[email protected]>
> >> Cc: Roger Quadros <[email protected]>
> >> Cc: Tony Lindgren <[email protected]>
> >> Cc: [email protected]
> >> ---
> >> drivers/memory/omap-gpmc.c | 5 ++---
> >> 1 file changed, 2 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> >> index c94ea0d..0c833e2 100644
> >> --- a/drivers/memory/omap-gpmc.c
> >> +++ b/drivers/memory/omap-gpmc.c
> >> @@ -1176,8 +1176,8 @@ static int gpmc_setup_irq(void)
> >> gpmc_client_irq[i].irq = gpmc_irq_start + i;
> >> irq_set_chip_and_handler(gpmc_client_irq[i].irq,
> >> &gpmc_irq_chip, handle_simple_irq);
> >> - set_irq_flags(gpmc_client_irq[i].irq,
> >> - IRQF_VALID | IRQF_NOAUTOEN);
> >> + irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
> >> + IRQ_NOAUTOEN);
> >
> > Shouldn't this be
> > irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
> > IRQ_NOAUTOEN | IRQ_NOPROBE);
> > ?
>
> Only if this needs to work on !ARM. The default for ARM is IRQ_NOPROBE set.

OK. In that case.

Acked-by: Roger Quadros <[email protected]>

cheers,
-roger

2015-06-12 09:30:28

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 01/15] ARM: kill off set_irq_flags usage

On 10.06.2015 03:26, Rob Herring wrote:
> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Russell King <[email protected]>
> Cc: Sekhar Nori <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Andrew Lunn <[email protected]>
> Cc: Sebastian Hesselbarth <[email protected]>
> Cc: Gregory Clement <[email protected]>
> Cc: Hans Ulli Kroll <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Sascha Hauer <[email protected]>
> Cc: Imre Kaloz <[email protected]>
> Cc: Krzysztof Halasa <[email protected]>
> Cc: Greg Ungerer <[email protected]>
> Cc: Roland Stigge <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Cc: Daniel Mack <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: Robert Jarzmik <[email protected]>
> Cc: Simtec Linux Team <[email protected]>
> Cc: Kukjin Kim <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: Wan ZongShun <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> ---
> arch/arm/common/it8152.c | 2 +-
> arch/arm/common/locomo.c | 2 +-
> arch/arm/common/sa1111.c | 4 ++--
> arch/arm/mach-davinci/cp_intc.c | 2 +-
> arch/arm/mach-dove/irq.c | 2 +-
> arch/arm/mach-ebsa110/core.c | 2 +-
> arch/arm/mach-footbridge/common.c | 2 +-
> arch/arm/mach-footbridge/isa-irq.c | 8 ++++----
> arch/arm/mach-gemini/gpio.c | 2 +-
> arch/arm/mach-gemini/irq.c | 2 +-
> arch/arm/mach-imx/3ds_debugboard.c | 2 +-
> arch/arm/mach-imx/mach-mx31ads.c | 2 +-
> arch/arm/mach-iop13xx/irq.c | 2 +-
> arch/arm/mach-iop32x/irq.c | 2 +-
> arch/arm/mach-iop33x/irq.c | 2 +-
> arch/arm/mach-ixp4xx/common.c | 2 +-
> arch/arm/mach-ks8695/irq.c | 2 +-
> arch/arm/mach-lpc32xx/irq.c | 2 +-
> arch/arm/mach-netx/generic.c | 2 +-
> arch/arm/mach-omap1/fpga.c | 2 +-
> arch/arm/mach-omap1/irq.c | 2 +-
> arch/arm/mach-pxa/balloon3.c | 2 +-
> arch/arm/mach-pxa/irq.c | 1 -
> arch/arm/mach-pxa/lpd270.c | 2 +-
> arch/arm/mach-pxa/pcm990-baseboard.c | 2 +-
> arch/arm/mach-pxa/pxa3xx.c | 2 +-
> arch/arm/mach-pxa/viper.c | 2 +-
> arch/arm/mach-pxa/zeus.c | 2 +-
> arch/arm/mach-rpc/ecard.c | 2 +-
> arch/arm/mach-rpc/irq.c | 16 ++++++++--------
> arch/arm/mach-s3c24xx/bast-irq.c | 2 +-
> arch/arm/mach-s3c64xx/common.c | 2 +-
> arch/arm/mach-sa1100/irq.c | 1 -
> arch/arm/mach-sa1100/neponset.c | 4 ++--
> arch/arm/mach-w90x900/irq.c | 2 +-
> 35 files changed, 45 insertions(+), 47 deletions(-)

For the s3c24xx and s3c64xx it looks fine:
Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2015-06-12 14:05:55

by Hans Ulli Kroll

[permalink] [raw]
Subject: Re: [PATCH 01/15] ARM: kill off set_irq_flags usage



On Tue, 9 Jun 2015, Rob Herring wrote:

> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>

for mach-gemini
Signed-off-by: Hans Ulli Kroll <[email protected]>
y

2015-06-12 14:35:57

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 01/15] ARM: kill off set_irq_flags usage

On Fri, Jun 12, 2015 at 9:05 AM, Hans Ulli Kroll
<[email protected]> wrote:
>
>
> On Tue, 9 Jun 2015, Rob Herring wrote:
>
>> set_irq_flags is ARM specific with custom flags which have genirq
>> equivalents. Convert drivers to use the genirq interfaces directly, so we
>> can kill off set_irq_flags. The translation of flags is as follows:
>>
>> IRQF_VALID -> !IRQ_NOREQUEST
>> IRQF_PROBE -> !IRQ_NOPROBE
>> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>>
>> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
>> and setting IRQ_NOREQUEST already, so there is no need to do this in
>> .map() functions and we can simply remove the set_irq_flags calls. Some
>> users also set IRQ_NOPROBE and this has been maintained although it is not
>> clear that is really needed. There appears to be a great deal of blind
>> copy and paste of this code.
>>
>
> for mach-gemini
> Signed-off-by: Hans Ulli Kroll <[email protected]>

You mean acked-by, right?

Rob

2015-06-12 16:23:10

by Hans Ulli Kroll

[permalink] [raw]
Subject: Re: [PATCH 01/15] ARM: kill off set_irq_flags usage



On Fri, 12 Jun 2015, Rob Herring wrote:

> On Fri, Jun 12, 2015 at 9:05 AM, Hans Ulli Kroll
> <[email protected]> wrote:
> >
> >
> > On Tue, 9 Jun 2015, Rob Herring wrote:
> >
> >> set_irq_flags is ARM specific with custom flags which have genirq
> >> equivalents. Convert drivers to use the genirq interfaces directly, so we
> >> can kill off set_irq_flags. The translation of flags is as follows:
> >>
> >> IRQF_VALID -> !IRQ_NOREQUEST
> >> IRQF_PROBE -> !IRQ_NOPROBE
> >> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
> >>
> >> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> >> and setting IRQ_NOREQUEST already, so there is no need to do this in
> >> .map() functions and we can simply remove the set_irq_flags calls. Some
> >> users also set IRQ_NOPROBE and this has been maintained although it is not
> >> clear that is really needed. There appears to be a great deal of blind
> >> copy and paste of this code.
> >>
> >
> > for mach-gemini
> > Signed-off-by: Hans Ulli Kroll <[email protected]>
>
> You mean acked-by, right?
>
> Rob
>

Yeah

Acked-by: Hans Ulli Kroll <[email protected]>

Ulli

2015-06-13 11:32:51

by Wan ZongShun

[permalink] [raw]
Subject: Re: [PATCH 01/15] ARM: kill off set_irq_flags usage

2015-06-10 2:26 GMT+08:00 Rob Herring <[email protected]>:
> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> Cc: Robert Jarzmik <[email protected]>
> Cc: Simtec Linux Team <[email protected]>
> Cc: Kukjin Kim <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Cc: Wan ZongShun <[email protected]>

For Nuvoton W90x900
Acked-by: Wan ZongShun <[email protected]>

> Cc: [email protected]
> Cc: [email protected]
> +++ b/arch/arm/mach-w90x900/irq.c
> @@ -211,6 +211,6 @@ void __init nuc900_init_irq(void)
> for (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) {
> irq_set_chip_and_handler(irqno, &nuc900_irq_chip,
> handle_level_irq);
> - set_irq_flags(irqno, IRQF_VALID);
> + irq_clear_status_flags(irqno, IRQ_NOREQUEST);
> }
> }
> --
> 2.1.0
>



--
---
Vincent Wan(Zongshun)
http://www.mcuos.com

2015-06-18 17:00:06

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 10/15] PCI: kill off set_irq_flags usage

On Tue, Jun 09, 2015 at 01:26:36PM -0500, Rob Herring wrote:
> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Kishon Vijay Abraham I <[email protected]>
> Cc: Bjorn Helgaas <[email protected]>
> Cc: Murali Karicheri <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: Stephen Warren <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: Jingoo Han <[email protected]>
> Cc: Pratyush Anand <[email protected]>
> Cc: Simon Horman <[email protected]>
> Cc: Michal Simek <[email protected]>
> Cc: "S?ren Brinkmann" <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]

This is the only part of the series on linux-pci, so I assume this will be
merged by somebody else along with the rest.

Acked-by: Bjorn Helgaas <[email protected]>

> ---
> drivers/pci/host/pci-dra7xx.c | 1 -
> drivers/pci/host/pci-keystone-dw.c | 2 --
> drivers/pci/host/pci-tegra.c | 1 -
> drivers/pci/host/pcie-designware.c | 1 -
> drivers/pci/host/pcie-rcar.c | 1 -
> drivers/pci/host/pcie-xilinx.c | 2 --
> 6 files changed, 8 deletions(-)
>
> diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
> index 2d57e19..94cbc4d 100644
> --- a/drivers/pci/host/pci-dra7xx.c
> +++ b/drivers/pci/host/pci-dra7xx.c
> @@ -160,7 +160,6 @@ static int dra7xx_pcie_intx_map(struct irq_domain *domain, unsigned int irq,
> {
> irq_set_chip_and_handler(irq, &dummy_irq_chip, handle_simple_irq);
> irq_set_chip_data(irq, domain->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> return 0;
> }
> diff --git a/drivers/pci/host/pci-keystone-dw.c b/drivers/pci/host/pci-keystone-dw.c
> index f34892e..f1d0749 100644
> --- a/drivers/pci/host/pci-keystone-dw.c
> +++ b/drivers/pci/host/pci-keystone-dw.c
> @@ -196,7 +196,6 @@ static int ks_dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
> irq_set_chip_and_handler(irq, &ks_dw_pcie_msi_irq_chip,
> handle_level_irq);
> irq_set_chip_data(irq, domain->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> return 0;
> }
> @@ -277,7 +276,6 @@ static int ks_dw_pcie_init_legacy_irq_map(struct irq_domain *d,
> irq_set_chip_and_handler(irq, &ks_dw_pcie_legacy_irq_chip,
> handle_level_irq);
> irq_set_chip_data(irq, d->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> return 0;
> }
> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 00e9272..36bd700 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -1263,7 +1263,6 @@ static int tegra_msi_map(struct irq_domain *domain, unsigned int irq,
> {
> irq_set_chip_and_handler(irq, &tegra_msi_irq_chip, handle_simple_irq);
> irq_set_chip_data(irq, domain->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> tegra_cpuidle_pcie_irqs_in_use();
>
> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
> index 2e9f84f..5caa94d 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -333,7 +333,6 @@ static int dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
> {
> irq_set_chip_and_handler(irq, &dw_msi_irq_chip, handle_simple_irq);
> irq_set_chip_data(irq, domain->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> return 0;
> }
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index c086210..7678fe0 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -664,7 +664,6 @@ static int rcar_msi_map(struct irq_domain *domain, unsigned int irq,
> {
> irq_set_chip_and_handler(irq, &rcar_msi_irq_chip, handle_simple_irq);
> irq_set_chip_data(irq, domain->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> return 0;
> }
> diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
> index f1a06a0..72015119 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -338,7 +338,6 @@ static int xilinx_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
> {
> irq_set_chip_and_handler(irq, &xilinx_msi_irq_chip, handle_simple_irq);
> irq_set_chip_data(irq, domain->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> return 0;
> }
> @@ -377,7 +376,6 @@ static int xilinx_pcie_intx_map(struct irq_domain *domain, unsigned int irq,
> {
> irq_set_chip_and_handler(irq, &dummy_irq_chip, handle_simple_irq);
> irq_set_chip_data(irq, domain->host_data);
> - set_irq_flags(irq, IRQF_VALID);
>
> return 0;
> }
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2015-06-18 20:09:04

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 10/15] PCI: kill off set_irq_flags usage

On Thu, Jun 18, 2015 at 11:59 AM, Bjorn Helgaas <[email protected]> wrote:
> On Tue, Jun 09, 2015 at 01:26:36PM -0500, Rob Herring wrote:
>> set_irq_flags is ARM specific with custom flags which have genirq
>> equivalents. Convert drivers to use the genirq interfaces directly, so we
>> can kill off set_irq_flags. The translation of flags is as follows:
>>
>> IRQF_VALID -> !IRQ_NOREQUEST
>> IRQF_PROBE -> !IRQ_NOPROBE
>> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>>
>> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
>> and setting IRQ_NOREQUEST already, so there is no need to do this in
>> .map() functions and we can simply remove the set_irq_flags calls. Some
>> users also set IRQ_NOPROBE and this has been maintained although it is not
>> clear that is really needed. There appears to be a great deal of blind
>> copy and paste of this code.
>>
>> Signed-off-by: Rob Herring <[email protected]>
>> Cc: Kishon Vijay Abraham I <[email protected]>
>> Cc: Bjorn Helgaas <[email protected]>
>> Cc: Murali Karicheri <[email protected]>
>> Cc: Thierry Reding <[email protected]>
>> Cc: Stephen Warren <[email protected]>
>> Cc: Alexandre Courbot <[email protected]>
>> Cc: Jingoo Han <[email protected]>
>> Cc: Pratyush Anand <[email protected]>
>> Cc: Simon Horman <[email protected]>
>> Cc: Michal Simek <[email protected]>
>> Cc: "Sören Brinkmann" <[email protected]>
>> Cc: [email protected]
>> Cc: [email protected]
>> Cc: [email protected]
>> Cc: [email protected]
>> Cc: [email protected]
>
> This is the only part of the series on linux-pci, so I assume this will be
> merged by somebody else along with the rest.

I copied you on the intro, but all the lists and all the maintainers
was too long to cc. Being late in the cycle I didn't really intend for
this to be for 4.2, but you can pick up this patch if you want to as
it doesn't have any dependencies. If you don't, then I will submit the
whole series for 4.3.

> Acked-by: Bjorn Helgaas <[email protected]>

Thanks.

Rob

2015-06-18 20:11:11

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 10/15] PCI: kill off set_irq_flags usage

On Thu, Jun 18, 2015 at 3:08 PM, Rob Herring <[email protected]> wrote:
> On Thu, Jun 18, 2015 at 11:59 AM, Bjorn Helgaas <[email protected]> wrote:
>> On Tue, Jun 09, 2015 at 01:26:36PM -0500, Rob Herring wrote:
>>> set_irq_flags is ARM specific with custom flags which have genirq
>>> equivalents. Convert drivers to use the genirq interfaces directly, so we
>>> can kill off set_irq_flags. The translation of flags is as follows:
>>>
>>> IRQF_VALID -> !IRQ_NOREQUEST
>>> IRQF_PROBE -> !IRQ_NOPROBE
>>> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>>>
>>> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
>>> and setting IRQ_NOREQUEST already, so there is no need to do this in
>>> .map() functions and we can simply remove the set_irq_flags calls. Some
>>> users also set IRQ_NOPROBE and this has been maintained although it is not
>>> clear that is really needed. There appears to be a great deal of blind
>>> copy and paste of this code.
>>>
>>> Signed-off-by: Rob Herring <[email protected]>
>>> Cc: Kishon Vijay Abraham I <[email protected]>
>>> Cc: Bjorn Helgaas <[email protected]>
>>> Cc: Murali Karicheri <[email protected]>
>>> Cc: Thierry Reding <[email protected]>
>>> Cc: Stephen Warren <[email protected]>
>>> Cc: Alexandre Courbot <[email protected]>
>>> Cc: Jingoo Han <[email protected]>
>>> Cc: Pratyush Anand <[email protected]>
>>> Cc: Simon Horman <[email protected]>
>>> Cc: Michal Simek <[email protected]>
>>> Cc: "Sören Brinkmann" <[email protected]>
>>> Cc: [email protected]
>>> Cc: [email protected]
>>> Cc: [email protected]
>>> Cc: [email protected]
>>> Cc: [email protected]
>>
>> This is the only part of the series on linux-pci, so I assume this will be
>> merged by somebody else along with the rest.
>
> I copied you on the intro, but all the lists and all the maintainers
> was too long to cc. Being late in the cycle I didn't really intend for
> this to be for 4.2, but you can pick up this patch if you want to as
> it doesn't have any dependencies. If you don't, then I will submit the
> whole series for 4.3.

OK, why don't you just include this with the rest of the series, since
I assume the whole series is related even if there's no actual
dependency.

Bjorn

2015-07-07 00:53:52

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH 12/15] SH: kill off set_irq_flags usage

On Tue, Jun 09, 2015 at 01:26:38PM -0500, Rob Herring wrote:
> set_irq_flags is ARM specific with custom flags which have genirq
> equivalents. Convert drivers to use the genirq interfaces directly, so we
> can kill off set_irq_flags. The translation of flags is as follows:
>
> IRQF_VALID -> !IRQ_NOREQUEST
> IRQF_PROBE -> !IRQ_NOPROBE
> IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>
> For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> and setting IRQ_NOREQUEST already, so there is no need to do this in
> .map() functions and we can simply remove the set_irq_flags calls. Some
> users also set IRQ_NOPROBE and this has been maintained although it is not
> clear that is really needed. There appears to be a great deal of blind
> copy and paste of this code.
>
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Simon Horman <[email protected]>
> Cc: Magnus Damm <[email protected]>
> Cc: [email protected]

I am trusting the description above coupled with the comments in
the original code (that this patch removes). Assuming those ducks are
aligned:

Acked-by: Simon Horman <[email protected]>

> ---
> drivers/sh/intc/internals.h | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
> index 7dff08e..897ffb1 100644
> --- a/drivers/sh/intc/internals.h
> +++ b/drivers/sh/intc/internals.h
> @@ -99,15 +99,7 @@ static inline struct intc_desc_int *get_intc_desc(unsigned int irq)
> */
> static inline void activate_irq(int irq)
> {
> -#ifdef CONFIG_ARM
> - /* ARM requires an extra step to clear IRQ_NOREQUEST, which it
> - * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
> - */
> - set_irq_flags(irq, IRQF_VALID);
> -#else
> - /* same effect on other architectures */
> - irq_set_noprobe(irq);
> -#endif
> + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
> }
>
> static inline int intc_handle_int_cmp(const void *a, const void *b)
> --
> 2.1.0
>

2015-07-07 01:55:10

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH 12/15] SH: kill off set_irq_flags usage

On Tue, Jul 07, 2015 at 09:53:39AM +0900, Simon Horman wrote:
> On Tue, Jun 09, 2015 at 01:26:38PM -0500, Rob Herring wrote:
> > set_irq_flags is ARM specific with custom flags which have genirq
> > equivalents. Convert drivers to use the genirq interfaces directly, so we
> > can kill off set_irq_flags. The translation of flags is as follows:
> >
> > IRQF_VALID -> !IRQ_NOREQUEST
> > IRQF_PROBE -> !IRQ_NOPROBE
> > IRQF_NOAUTOEN -> IRQ_NOAUTOEN
> >
> > For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> > and setting IRQ_NOREQUEST already, so there is no need to do this in
> > .map() functions and we can simply remove the set_irq_flags calls. Some
> > users also set IRQ_NOPROBE and this has been maintained although it is not
> > clear that is really needed. There appears to be a great deal of blind
> > copy and paste of this code.
> >
> > Signed-off-by: Rob Herring <[email protected]>
> > Cc: Simon Horman <[email protected]>
> > Cc: Magnus Damm <[email protected]>
> > Cc: [email protected]
>
> I am trusting the description above coupled with the comments in
> the original code (that this patch removes). Assuming those ducks are
> aligned:
>
> Acked-by: Simon Horman <[email protected]>

As I usually take patches for drivers/sh/ (there have not been many of late)
please let me know if you would like me to pick up this change.

Also, a very minor nit, the prefix for patches to this file is usually
'sh:' rather than 'SH:'.

>
> > ---
> > drivers/sh/intc/internals.h | 10 +---------
> > 1 file changed, 1 insertion(+), 9 deletions(-)
> >
> > diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
> > index 7dff08e..897ffb1 100644
> > --- a/drivers/sh/intc/internals.h
> > +++ b/drivers/sh/intc/internals.h
> > @@ -99,15 +99,7 @@ static inline struct intc_desc_int *get_intc_desc(unsigned int irq)
> > */
> > static inline void activate_irq(int irq)
> > {
> > -#ifdef CONFIG_ARM
> > - /* ARM requires an extra step to clear IRQ_NOREQUEST, which it
> > - * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
> > - */
> > - set_irq_flags(irq, IRQF_VALID);
> > -#else
> > - /* same effect on other architectures */
> > - irq_set_noprobe(irq);
> > -#endif
> > + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
> > }
> >
> > static inline int intc_handle_int_cmp(const void *a, const void *b)
> > --
> > 2.1.0
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2015-07-07 14:39:22

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 12/15] SH: kill off set_irq_flags usage

On Mon, Jul 6, 2015 at 8:55 PM, Simon Horman <[email protected]> wrote:
> On Tue, Jul 07, 2015 at 09:53:39AM +0900, Simon Horman wrote:
>> On Tue, Jun 09, 2015 at 01:26:38PM -0500, Rob Herring wrote:
>> > set_irq_flags is ARM specific with custom flags which have genirq
>> > equivalents. Convert drivers to use the genirq interfaces directly, so we
>> > can kill off set_irq_flags. The translation of flags is as follows:
>> >
>> > IRQF_VALID -> !IRQ_NOREQUEST
>> > IRQF_PROBE -> !IRQ_NOPROBE
>> > IRQF_NOAUTOEN -> IRQ_NOAUTOEN
>> >
>> > For IRQs managed by an irqdomain, the irqdomain core code handles clearing
>> > and setting IRQ_NOREQUEST already, so there is no need to do this in
>> > .map() functions and we can simply remove the set_irq_flags calls. Some
>> > users also set IRQ_NOPROBE and this has been maintained although it is not
>> > clear that is really needed. There appears to be a great deal of blind
>> > copy and paste of this code.
>> >
>> > Signed-off-by: Rob Herring <[email protected]>
>> > Cc: Simon Horman <[email protected]>
>> > Cc: Magnus Damm <[email protected]>
>> > Cc: [email protected]
>>
>> I am trusting the description above coupled with the comments in
>> the original code (that this patch removes). Assuming those ducks are
>> aligned:
>>
>> Acked-by: Simon Horman <[email protected]>
>
> As I usually take patches for drivers/sh/ (there have not been many of late)
> please let me know if you would like me to pick up this change.

This is a dependency for removing set_irq_flags from ARM, so I plan to
send the whole series to arm-soc.

> Also, a very minor nit, the prefix for patches to this file is usually
> 'sh:' rather than 'SH:'.

Okay, will fix-up.

Rob

>
>>
>> > ---
>> > drivers/sh/intc/internals.h | 10 +---------
>> > 1 file changed, 1 insertion(+), 9 deletions(-)
>> >
>> > diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
>> > index 7dff08e..897ffb1 100644
>> > --- a/drivers/sh/intc/internals.h
>> > +++ b/drivers/sh/intc/internals.h
>> > @@ -99,15 +99,7 @@ static inline struct intc_desc_int *get_intc_desc(unsigned int irq)
>> > */
>> > static inline void activate_irq(int irq)
>> > {
>> > -#ifdef CONFIG_ARM
>> > - /* ARM requires an extra step to clear IRQ_NOREQUEST, which it
>> > - * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
>> > - */
>> > - set_irq_flags(irq, IRQF_VALID);
>> > -#else
>> > - /* same effect on other architectures */
>> > - irq_set_noprobe(irq);
>> > -#endif
>> > + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
>> > }
>> >
>> > static inline int intc_handle_int_cmp(const void *a, const void *b)
>> > --
>> > 2.1.0
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>

2015-07-08 01:04:47

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH 12/15] SH: kill off set_irq_flags usage

On Tue, Jul 07, 2015 at 09:38:53AM -0500, Rob Herring wrote:
> On Mon, Jul 6, 2015 at 8:55 PM, Simon Horman <[email protected]> wrote:
> > On Tue, Jul 07, 2015 at 09:53:39AM +0900, Simon Horman wrote:
> >> On Tue, Jun 09, 2015 at 01:26:38PM -0500, Rob Herring wrote:
> >> > set_irq_flags is ARM specific with custom flags which have genirq
> >> > equivalents. Convert drivers to use the genirq interfaces directly, so we
> >> > can kill off set_irq_flags. The translation of flags is as follows:
> >> >
> >> > IRQF_VALID -> !IRQ_NOREQUEST
> >> > IRQF_PROBE -> !IRQ_NOPROBE
> >> > IRQF_NOAUTOEN -> IRQ_NOAUTOEN
> >> >
> >> > For IRQs managed by an irqdomain, the irqdomain core code handles clearing
> >> > and setting IRQ_NOREQUEST already, so there is no need to do this in
> >> > .map() functions and we can simply remove the set_irq_flags calls. Some
> >> > users also set IRQ_NOPROBE and this has been maintained although it is not
> >> > clear that is really needed. There appears to be a great deal of blind
> >> > copy and paste of this code.
> >> >
> >> > Signed-off-by: Rob Herring <[email protected]>
> >> > Cc: Simon Horman <[email protected]>
> >> > Cc: Magnus Damm <[email protected]>
> >> > Cc: [email protected]
> >>
> >> I am trusting the description above coupled with the comments in
> >> the original code (that this patch removes). Assuming those ducks are
> >> aligned:
> >>
> >> Acked-by: Simon Horman <[email protected]>
> >
> > As I usually take patches for drivers/sh/ (there have not been many of late)
> > please let me know if you would like me to pick up this change.
>
> This is a dependency for removing set_irq_flags from ARM, so I plan to
> send the whole series to arm-soc.

Thanks, that is fine by me.

> > Also, a very minor nit, the prefix for patches to this file is usually
> > 'sh:' rather than 'SH:'.
>
> Okay, will fix-up.
>
> Rob
>
> >
> >>
> >> > ---
> >> > drivers/sh/intc/internals.h | 10 +---------
> >> > 1 file changed, 1 insertion(+), 9 deletions(-)
> >> >
> >> > diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
> >> > index 7dff08e..897ffb1 100644
> >> > --- a/drivers/sh/intc/internals.h
> >> > +++ b/drivers/sh/intc/internals.h
> >> > @@ -99,15 +99,7 @@ static inline struct intc_desc_int *get_intc_desc(unsigned int irq)
> >> > */
> >> > static inline void activate_irq(int irq)
> >> > {
> >> > -#ifdef CONFIG_ARM
> >> > - /* ARM requires an extra step to clear IRQ_NOREQUEST, which it
> >> > - * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
> >> > - */
> >> > - set_irq_flags(irq, IRQF_VALID);
> >> > -#else
> >> > - /* same effect on other architectures */
> >> > - irq_set_noprobe(irq);
> >> > -#endif
> >> > + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
> >> > }
> >> >
> >> > static inline int intc_handle_int_cmp(const void *a, const void *b)
> >> > --
> >> > 2.1.0
> >> >
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> >> the body of a message to [email protected]
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>
>