* [PATCH 00/18] genirq: Remove setup_irq()
@ 2020-02-12 8:01 afzal mohammed
2020-02-12 8:05 ` [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() afzal mohammed
2020-02-27 10:31 ` [PATCH 00/18] genirq: Remove setup_irq() Thomas Gleixner
0 siblings, 2 replies; 11+ messages in thread
From: afzal mohammed @ 2020-02-12 8:01 UTC (permalink / raw)
To: linux-kernel, linux-rpi-kernel, linux-arm-kernel,
linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev,
linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon,
linux-c6x-dev, linux-omap, linux-alpha
Cc: Thomas Gleixner, Julia Lawall, Gilles Muller, Nicolas Palix,
Michal Marek
While trying to understand internals of irq handling, came across a
thread [1] in which tglx was referring to avoid usage of setup_irq().
Existing callers of setup_irq() reached mostly via 'init_IRQ()' &
'time_init()', while memory allocators are ready by 'mm_init()'.
Hence instances of setup_irq() is replaced by request_irq() &
setup_irq() (along with remove_irq()) definition deleted in the last
patch.
Seldom remove_irq() usage has been observed coupled with setup_irq(),
wherever that has been found, it too has been replaced by free_irq().
Build & boot tested on ARM & x86_64 platforms (ensured that on the
machines used for testing there was an existing setup_irq()
invocation occuring at runtime)
Much of the changes were created using Coccinelle with an intention
to learn it. spatch command was directly run w/ semantic patch below.
But not everything could be automated.
Searching with 'git grep -n '\Wsetup_irq('' & avoiding the irrelevant
ones, 153 invocation's of setup_irq() were found. 112 could be replaced
w/ cocci, of which in a few files some desired hunks were missing or
not as expected, these were fixed up manually. Also the remaining 41
had to be done manually.
Although cocci could replace 112, because of line continue not
happening at paranthesis for request_irq(), around 80 had to be
manually aligned in the request_irq() statement. Problem was with my
below cocci snippet,
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,f_flags,f_name,f_dev_id))
+ pr_err("request_irq() on %s failed\n", f_name);
Instead of the above, if below is used, line continue happens exactly
at paranthesis, but it lacks addition of printing on request_irq()
failure where existing setup_irq() failure was not doing it.
- setup_irq(E1,&act)
+ request_irq(E1,f_handler,f_flags,f_name,f_dev_id)
Above had an additional advantage of replacing instances of
if (setup_irq()) & BUG(setup_irq()), but luckily those instances were
very few.
So though many changes could be automated, there are a considerable
amount of manual changes, please review carefully especially mips &
alpha.
Usage of setup_percpu_irq() is untouched w/ this series.
There are 2 checkpatch warning about usage of BUG() [which was already
there w/ setup_irq()], they are left as is as it seems appropriate for
tick timer interrupt.
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
--->8---
@r1@
identifier ret;
@@
(
setup_irq(...);
|
ret = setup_irq(...);
)
@r2 depends on r1@
identifier act;
@@
static struct irqaction act = {
};
@r11 depends on r2@
identifier r2.act;
identifier f_handler;
@@
(
- act.handler = f_handler;
|
static struct irqaction act = {
.handler = f_handler,
};
)
@r12 depends on r2@
identifier r2.act;
expression f_name;
@@
(
- act.name = f_name;
|
static struct irqaction act = {
.name = f_name,
};
)
@r15 depends on r2@
identifier r2.act;
expression f_dev_id;
@@
(
- act.dev_id = f_dev_id;
|
static struct irqaction act = {
.dev_id = f_dev_id,
};
)
@r16 depends on r2@
identifier r2.act;
expression f_flags;
@@
(
- act.flags = f_flags;
|
static struct irqaction act = {
.flags = f_flags,
};
)
@r21 depends on r2@
identifier r2.act;
@@
- static struct irqaction act = {
- ...
- };
@r22 depends on r2 && r11 && r12 && r15 && r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression r15.f_dev_id;
expression r16.f_flags;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,f_flags,f_name,f_dev_id))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,f_flags,f_name,f_dev_id);
)
@r23 depends on r2 && r11 && r12 && !r15 && r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression r16.f_flags;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,f_flags,f_name,NULL))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,f_flags,f_name,NULL);
)
@r24 depends on r2 && r11 && r12 && r15 && !r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression r15.f_dev_id;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,0,f_name,f_dev_id))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,0,f_name,f_dev_id);
)
@r25 depends on r2 && r11 && r12 && !r15 && !r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,0,f_name,NULL))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,0,f_name,NULL);
)
--->8---
afzal mohammed (18):
alpha: replace setup_irq() by request_irq()
ARM: replace setup_irq() by request_irq()
c6x: replace setup_irq() by request_irq()
hexagon: replace setup_irq() by request_irq()
ia64: replace setup_irq() by request_irq()
m68k: Replace setup_irq() by request_irq()
microblaze: Replace setup_irq() by request_irq()
MIPS: Replace setup_irq() by request_irq()
parisc: Replace setup_irq() by request_irq()
powerpc: Replace setup_irq() by request_irq()
s390: replace setup_irq() by request_irq()
sh: replace setup_irq() by request_irq()
unicore32: replace setup_irq() by request_irq()
x86: Replace setup_irq() by request_irq()
xtensa: replace setup_irq() by request_irq()
clocksource: Replace setup_irq() by request_irq()
irqchip: Replace setup_irq() by request_irq()
genirq: Remove setup_irq() and remove_irq()
arch/alpha/kernel/irq_alpha.c | 29 ++-------
arch/alpha/kernel/irq_i8259.c | 8 +--
arch/alpha/kernel/irq_impl.h | 7 +--
arch/alpha/kernel/irq_pyxis.c | 3 +-
arch/alpha/kernel/sys_alcor.c | 3 +-
arch/alpha/kernel/sys_cabriolet.c | 3 +-
arch/alpha/kernel/sys_eb64p.c | 3 +-
arch/alpha/kernel/sys_marvel.c | 2 +-
arch/alpha/kernel/sys_miata.c | 6 +-
arch/alpha/kernel/sys_ruffian.c | 3 +-
arch/alpha/kernel/sys_rx164.c | 3 +-
arch/alpha/kernel/sys_sx164.c | 3 +-
arch/alpha/kernel/sys_wildfire.c | 7 +--
arch/alpha/kernel/time.c | 6 +-
arch/arm/mach-cns3xxx/core.c | 10 +---
arch/arm/mach-ebsa110/core.c | 10 +---
arch/arm/mach-ep93xx/timer-ep93xx.c | 12 ++--
arch/arm/mach-footbridge/dc21285-timer.c | 11 +---
arch/arm/mach-footbridge/isa-irq.c | 8 +--
arch/arm/mach-footbridge/isa-timer.c | 11 +---
arch/arm/mach-iop32x/time.c | 12 ++--
arch/arm/mach-mmp/time.c | 11 +---
arch/arm/mach-omap1/pm.c | 22 ++++---
arch/arm/mach-omap1/time.c | 10 +---
arch/arm/mach-omap1/timer32k.c | 10 +---
arch/arm/mach-omap2/timer.c | 11 +---
arch/arm/mach-rpc/time.c | 8 +--
arch/arm/mach-spear/time.c | 9 +--
arch/arm/plat-orion/time.c | 10 +---
arch/c6x/platforms/timer64.c | 11 +---
arch/hexagon/kernel/smp.c | 17 +++---
arch/hexagon/kernel/time.c | 11 +---
arch/ia64/kernel/irq_ia64.c | 42 +++++--------
arch/ia64/kernel/mca.c | 51 +++++-----------
arch/m68k/68000/timers.c | 9 +--
arch/m68k/coldfire/pit.c | 9 +--
arch/m68k/coldfire/sltimers.c | 19 ++----
arch/m68k/coldfire/timers.c | 19 ++----
arch/microblaze/kernel/timer.c | 10 +---
arch/mips/alchemy/common/time.c | 11 +---
arch/mips/ar7/irq.c | 18 +++---
arch/mips/ath25/ar2315.c | 9 +--
arch/mips/ath25/ar5312.c | 9 +--
arch/mips/bcm63xx/irq.c | 38 +++++-------
arch/mips/cobalt/irq.c | 14 ++---
arch/mips/dec/setup.c | 59 ++++++++-----------
arch/mips/emma/markeins/irq.c | 20 +++----
arch/mips/include/asm/sni.h | 2 +-
arch/mips/jazz/irq.c | 12 +---
arch/mips/kernel/cevt-bcm1480.c | 11 +---
arch/mips/kernel/cevt-ds1287.c | 9 +--
arch/mips/kernel/cevt-gt641xx.c | 9 +--
arch/mips/kernel/cevt-r4k.c | 4 +-
arch/mips/kernel/cevt-sb1250.c | 11 +---
arch/mips/kernel/cevt-txx9.c | 11 +---
arch/mips/kernel/i8253.c | 10 +---
arch/mips/kernel/rtlx-mt.c | 8 +--
arch/mips/kernel/smp.c | 33 ++++-------
arch/mips/lasat/interrupt.c | 10 +---
arch/mips/loongson2ef/common/bonito-irq.c | 9 +--
.../loongson2ef/common/cs5536/cs5536_mfgpt.c | 10 +---
arch/mips/loongson2ef/fuloong-2e/irq.c | 14 ++---
arch/mips/loongson2ef/lemote-2f/irq.c | 20 ++-----
arch/mips/loongson32/common/irq.c | 21 ++++---
arch/mips/loongson32/common/time.c | 12 ++--
arch/mips/loongson64/hpet.c | 10 +---
arch/mips/mti-malta/malta-int.c | 10 +---
arch/mips/netlogic/xlr/fmn.c | 9 +--
arch/mips/pmcs-msp71xx/msp_irq.c | 28 ++++-----
arch/mips/pmcs-msp71xx/msp_smp.c | 22 ++-----
arch/mips/pmcs-msp71xx/msp_time.c | 7 ++-
arch/mips/ralink/cevt-rt3352.c | 17 +++---
arch/mips/sgi-ip22/ip22-eisa.c | 8 +--
arch/mips/sgi-ip22/ip22-int.c | 49 +++++----------
arch/mips/sgi-ip32/ip32-irq.c | 18 ++----
arch/mips/sni/a20r.c | 4 +-
arch/mips/sni/irq.c | 8 +--
arch/mips/sni/pcit.c | 8 ++-
arch/mips/sni/rm200.c | 23 +++-----
arch/mips/sni/time.c | 10 +---
arch/mips/vr41xx/common/irq.c | 9 +--
arch/parisc/kernel/irq.c | 21 ++-----
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 10 +---
arch/powerpc/platforms/8xx/cpm1.c | 9 +--
arch/powerpc/platforms/8xx/m8xx_setup.c | 9 +--
arch/powerpc/platforms/chrp/setup.c | 14 ++---
arch/powerpc/platforms/powermac/pic.c | 31 ++++------
arch/powerpc/platforms/powermac/smp.c | 9 +--
arch/s390/kernel/irq.c | 8 +--
arch/sh/boards/mach-cayman/irq.c | 18 ++----
arch/sh/drivers/dma/dma-pvr2.c | 9 +--
arch/unicore32/kernel/time.c | 11 +---
arch/x86/kernel/irqinit.c | 18 +++---
arch/x86/kernel/time.c | 10 +---
arch/xtensa/kernel/smp.c | 8 +--
arch/xtensa/kernel/time.c | 10 +---
drivers/clocksource/bcm2835_timer.c | 8 +--
drivers/clocksource/bcm_kona_timer.c | 10 +---
drivers/clocksource/dw_apb_timer.c | 11 +---
drivers/clocksource/exynos_mct.c | 12 ++--
drivers/clocksource/mxs_timer.c | 10 +---
drivers/clocksource/nomadik-mtu.c | 11 +---
drivers/clocksource/samsung_pwm_timer.c | 12 ++--
drivers/clocksource/timer-atlas7.c | 50 ++++++++--------
drivers/clocksource/timer-cs5535.c | 10 +---
drivers/clocksource/timer-efm32.c | 10 +---
drivers/clocksource/timer-fsl-ftm.c | 10 +---
drivers/clocksource/timer-imx-gpt.c | 10 +---
drivers/clocksource/timer-integrator-ap.c | 11 +---
drivers/clocksource/timer-meson6.c | 11 +---
drivers/clocksource/timer-orion.c | 9 +--
drivers/clocksource/timer-prima2.c | 11 +---
drivers/clocksource/timer-pxa.c | 10 +---
drivers/clocksource/timer-sp804.c | 11 +---
drivers/clocksource/timer-u300.c | 9 +--
drivers/clocksource/timer-vf-pit.c | 10 +---
drivers/clocksource/timer-vt8500.c | 11 +---
drivers/clocksource/timer-zevio.c | 13 ++--
drivers/irqchip/irq-i8259.c | 9 +--
drivers/irqchip/irq-ingenic.c | 11 ++--
drivers/parisc/eisa.c | 8 +--
drivers/s390/cio/airq.c | 8 +--
drivers/s390/cio/cio.c | 8 +--
include/linux/dw_apb_timer.h | 1 -
include/linux/irq.h | 2 -
kernel/irq/manage.c | 44 --------------
126 files changed, 528 insertions(+), 1111 deletions(-)
base-commit: v5.6-rc1
--
2.24.1
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() 2020-02-12 8:01 [PATCH 00/18] genirq: Remove setup_irq() afzal mohammed @ 2020-02-12 8:05 ` afzal mohammed 2020-02-20 11:13 ` Daniel Lezcano 2020-02-20 14:48 ` Linus Walleij 2020-02-27 10:31 ` [PATCH 00/18] genirq: Remove setup_irq() Thomas Gleixner 1 sibling, 2 replies; 11+ messages in thread From: afzal mohammed @ 2020-02-12 8:05 UTC (permalink / raw) To: linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-samsung-soc, linux-amlogic Cc: Daniel Lezcano, Thomas Gleixner, Florian Fainelli, Ray Jui, Scott Branden, bcm-kernel-feedback-list, Nicolas Saenz Julienne, Kukjin Kim, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, Barry Song, Uwe Kleine-König, Kevin Hilman, Linus Walleij, Tony Prisk, Allison Randal, Enrico Weigelt, Greg Kroah-Hartman, Kate Stewart request_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized. Hence replace setup_irq() by request_irq(). Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq(). [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com> --- Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter, https://lkml.kernel.org/r/cover.1581478323.git.afzal.mohd.ma@gmail.com drivers/clocksource/bcm2835_timer.c | 8 +--- drivers/clocksource/bcm_kona_timer.c | 10 ++--- drivers/clocksource/dw_apb_timer.c | 11 ++--- drivers/clocksource/exynos_mct.c | 12 ++---- drivers/clocksource/mxs_timer.c | 10 +---- drivers/clocksource/nomadik-mtu.c | 11 ++--- drivers/clocksource/samsung_pwm_timer.c | 12 ++---- drivers/clocksource/timer-atlas7.c | 50 +++++++++++------------ drivers/clocksource/timer-cs5535.c | 10 ++--- drivers/clocksource/timer-efm32.c | 10 +---- drivers/clocksource/timer-fsl-ftm.c | 10 +---- drivers/clocksource/timer-imx-gpt.c | 10 +---- drivers/clocksource/timer-integrator-ap.c | 11 ++--- drivers/clocksource/timer-meson6.c | 11 ++--- drivers/clocksource/timer-orion.c | 9 +--- drivers/clocksource/timer-prima2.c | 11 +---- drivers/clocksource/timer-pxa.c | 10 +---- drivers/clocksource/timer-sp804.c | 11 ++--- drivers/clocksource/timer-u300.c | 9 +--- drivers/clocksource/timer-vf-pit.c | 10 +---- drivers/clocksource/timer-vt8500.c | 11 ++--- drivers/clocksource/timer-zevio.c | 13 +++--- include/linux/dw_apb_timer.h | 1 - 23 files changed, 81 insertions(+), 190 deletions(-) diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c index b235f446ee50..1592650b2c92 100644 --- a/drivers/clocksource/bcm2835_timer.c +++ b/drivers/clocksource/bcm2835_timer.c @@ -31,7 +31,6 @@ struct bcm2835_timer { void __iomem *compare; int match_mask; struct clock_event_device evt; - struct irqaction act; }; static void __iomem *system_clock __read_mostly; @@ -113,12 +112,9 @@ static int __init bcm2835_timer_init(struct device_node *node) timer->evt.features = CLOCK_EVT_FEAT_ONESHOT; timer->evt.set_next_event = bcm2835_time_set_next_event; timer->evt.cpumask = cpumask_of(0); - timer->act.name = node->name; - timer->act.flags = IRQF_TIMER | IRQF_SHARED; - timer->act.dev_id = timer; - timer->act.handler = bcm2835_time_interrupt; - ret = setup_irq(irq, &timer->act); + ret = request_irq(irq, bcm2835_time_interrupt, IRQF_TIMER | IRQF_SHARED, + node->name, timer); if (ret) { pr_err("Can't set up timer IRQ\n"); goto err_timer_free; diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c index 5c40be9880f5..b57b2fbdac33 100644 --- a/drivers/clocksource/bcm_kona_timer.c +++ b/drivers/clocksource/bcm_kona_timer.c @@ -160,12 +160,6 @@ static irqreturn_t kona_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction kona_timer_irq = { - .name = "Kona Timer Tick", - .flags = IRQF_TIMER, - .handler = kona_timer_interrupt, -}; - static int __init kona_timer_init(struct device_node *node) { u32 freq; @@ -192,7 +186,9 @@ static int __init kona_timer_init(struct device_node *node) kona_timer_disable_and_clear(timers.tmr_regs); kona_timer_clockevents_init(); - setup_irq(timers.tmr_irq, &kona_timer_irq); + if (request_irq(timers.tmr_irq, kona_timer_interrupt, IRQF_TIMER, + "Kona Timer Tick", NULL)) + pr_err("request_irq() on %s failed\n", "Kona Timer Tick"); kona_timer_set_next_event((arch_timer_rate / HZ), NULL); return 0; diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c index 654766538f93..b207a77b0831 100644 --- a/drivers/clocksource/dw_apb_timer.c +++ b/drivers/clocksource/dw_apb_timer.c @@ -270,15 +270,10 @@ dw_apb_clockevent_init(int cpu, const char *name, unsigned rating, dw_ced->ced.rating = rating; dw_ced->ced.name = name; - dw_ced->irqaction.name = dw_ced->ced.name; - dw_ced->irqaction.handler = dw_apb_clockevent_irq; - dw_ced->irqaction.dev_id = &dw_ced->ced; - dw_ced->irqaction.irq = irq; - dw_ced->irqaction.flags = IRQF_TIMER | IRQF_IRQPOLL | - IRQF_NOBALANCING; - dw_ced->eoi = apbt_eoi; - err = setup_irq(irq, &dw_ced->irqaction); + err = request_irq(irq, dw_apb_clockevent_irq, + IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING, + dw_ced->ced.name, &dw_ced->ced); if (err) { pr_err("failed to request timer irq\n"); kfree(dw_ced); diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index a267fe31ef13..cde7c00dbcff 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -329,19 +329,15 @@ static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction mct_comp_event_irq = { - .name = "mct_comp_irq", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = exynos4_mct_comp_isr, - .dev_id = &mct_comp_device, -}; - static int exynos4_clockevent_init(void) { mct_comp_device.cpumask = cpumask_of(0); clockevents_config_and_register(&mct_comp_device, clk_rate, 0xf, 0xffffffff); - setup_irq(mct_irqs[MCT_G0_IRQ], &mct_comp_event_irq); + if (request_irq(mct_irqs[MCT_G0_IRQ], exynos4_mct_comp_isr, + IRQF_TIMER | IRQF_IRQPOLL, "mct_comp_irq", + &mct_comp_device)) + pr_err("request_irq() on %s failed\n", "mct_comp_irq"); return 0; } diff --git a/drivers/clocksource/mxs_timer.c b/drivers/clocksource/mxs_timer.c index f6ddae30933f..bc96a4cbf26c 100644 --- a/drivers/clocksource/mxs_timer.c +++ b/drivers/clocksource/mxs_timer.c @@ -117,13 +117,6 @@ static irqreturn_t mxs_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction mxs_timer_irq = { - .name = "MXS Timer Tick", - .dev_id = &mxs_clockevent_device, - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = mxs_timer_interrupt, -}; - static void mxs_irq_clear(char *state) { /* Disable interrupt in timer module */ @@ -277,6 +270,7 @@ static int __init mxs_timer_init(struct device_node *np) if (irq <= 0) return -EINVAL; - return setup_irq(irq, &mxs_timer_irq); + return request_irq(irq, mxs_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, + "MXS Timer Tick", &mxs_clockevent_device); } TIMER_OF_DECLARE(mxs, "fsl,timrot", mxs_timer_init); diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c index 3f7fa8c01367..8faa6616c5e5 100644 --- a/drivers/clocksource/nomadik-mtu.c +++ b/drivers/clocksource/nomadik-mtu.c @@ -181,13 +181,6 @@ static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction nmdk_timer_irq = { - .name = "Nomadik Timer Tick", - .flags = IRQF_TIMER, - .handler = nmdk_timer_interrupt, - .dev_id = &nmdk_clkevt, -}; - static int __init nmdk_timer_init(void __iomem *base, int irq, struct clk *pclk, struct clk *clk) { @@ -232,7 +225,9 @@ static int __init nmdk_timer_init(void __iomem *base, int irq, sched_clock_register(nomadik_read_sched_clock, 32, rate); /* Timer 1 is used for events, register irq and clockevents */ - setup_irq(irq, &nmdk_timer_irq); + if (request_irq(irq, nmdk_timer_interrupt, IRQF_TIMER, + "Nomadik Timer Tick", &nmdk_clkevt)) + pr_err("request_irq() on %s failed\n", "Nomadik Timer Tick"); nmdk_clkevt.cpumask = cpumask_of(0); nmdk_clkevt.irq = irq; clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU); diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c index dae1b2b5a0c5..bad1d3bad532 100644 --- a/drivers/clocksource/samsung_pwm_timer.c +++ b/drivers/clocksource/samsung_pwm_timer.c @@ -256,13 +256,6 @@ static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction samsung_clock_event_irq = { - .name = "samsung_time_irq", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = samsung_clock_event_isr, - .dev_id = &time_event_device, -}; - static void __init samsung_clockevent_init(void) { unsigned long pclk; @@ -282,7 +275,10 @@ static void __init samsung_clockevent_init(void) clock_rate, 1, pwm.tcnt_max); irq_number = pwm.irq[pwm.event_id]; - setup_irq(irq_number, &samsung_clock_event_irq); + if (request_irq(irq_number, samsung_clock_event_isr, + IRQF_TIMER | IRQF_IRQPOLL, "samsung_time_irq", + &time_event_device)) + pr_err("request_irq() on %s failed\n", "samsung_time_irq"); if (pwm.variant.has_tint_cstat) { u32 mask = (1 << pwm.event_id); diff --git a/drivers/clocksource/timer-atlas7.c b/drivers/clocksource/timer-atlas7.c index 93c3ac6d72bd..c21c91c2bc56 100644 --- a/drivers/clocksource/timer-atlas7.c +++ b/drivers/clocksource/timer-atlas7.c @@ -159,29 +159,23 @@ static struct clocksource sirfsoc_clocksource = { .resume = sirfsoc_clocksource_resume, }; -static struct irqaction sirfsoc_timer_irq = { - .name = "sirfsoc_timer0", - .flags = IRQF_TIMER | IRQF_NOBALANCING, - .handler = sirfsoc_timer_interrupt, -}; - -static struct irqaction sirfsoc_timer1_irq = { - .name = "sirfsoc_timer1", - .flags = IRQF_TIMER | IRQF_NOBALANCING, - .handler = sirfsoc_timer_interrupt, -}; +static unsigned int sirfsoc_timer_irq, sirfsoc_timer1_irq; static int sirfsoc_local_timer_starting_cpu(unsigned int cpu) { struct clock_event_device *ce = per_cpu_ptr(sirfsoc_clockevent, cpu); - struct irqaction *action; - - if (cpu == 0) - action = &sirfsoc_timer_irq; - else - action = &sirfsoc_timer1_irq; + unsigned int irq; + const char *name; + + if (cpu == 0) { + irq = sirfsoc_timer_irq; + name = "sirfsoc_timer0"; + } else { + irq = sirfsoc_timer1_irq; + name = "sirfsoc_timer1"; + } - ce->irq = action->irq; + ce->irq = irq; ce->name = "local_timer"; ce->features = CLOCK_EVT_FEAT_ONESHOT; ce->rating = 200; @@ -196,9 +190,9 @@ static int sirfsoc_local_timer_starting_cpu(unsigned int cpu) ce->min_delta_ticks = 2; ce->cpumask = cpumask_of(cpu); - action->dev_id = ce; - BUG_ON(setup_irq(ce->irq, action)); - irq_force_affinity(action->irq, cpumask_of(cpu)); + BUG_ON(request_irq(ce->irq, sirfsoc_timer_interrupt, + IRQF_TIMER | IRQF_NOBALANCING, name, ce)); + irq_force_affinity(ce->irq, cpumask_of(cpu)); clockevents_register_device(ce); return 0; @@ -206,12 +200,14 @@ static int sirfsoc_local_timer_starting_cpu(unsigned int cpu) static int sirfsoc_local_timer_dying_cpu(unsigned int cpu) { + struct clock_event_device *ce = per_cpu_ptr(sirfsoc_clockevent, cpu); + sirfsoc_timer_count_disable(1); if (cpu == 0) - remove_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq); + free_irq(sirfsoc_timer_irq, ce); else - remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); + free_irq(sirfsoc_timer1_irq, ce); return 0; } @@ -268,14 +264,14 @@ static int __init sirfsoc_of_timer_init(struct device_node *np) return -ENXIO; } - sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0); - if (!sirfsoc_timer_irq.irq) { + sirfsoc_timer_irq = irq_of_parse_and_map(np, 0); + if (!sirfsoc_timer_irq) { pr_err("No irq passed for timer0 via DT\n"); return -EINVAL; } - sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1); - if (!sirfsoc_timer1_irq.irq) { + sirfsoc_timer1_irq = irq_of_parse_and_map(np, 1); + if (!sirfsoc_timer1_irq) { pr_err("No irq passed for timer1 via DT\n"); return -EINVAL; } diff --git a/drivers/clocksource/timer-cs5535.c b/drivers/clocksource/timer-cs5535.c index 8f6bc536bef2..51ea0509fb25 100644 --- a/drivers/clocksource/timer-cs5535.c +++ b/drivers/clocksource/timer-cs5535.c @@ -131,12 +131,6 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction mfgptirq = { - .handler = mfgpt_tick, - .flags = IRQF_NOBALANCING | IRQF_TIMER | IRQF_SHARED, - .name = DRV_NAME, -}; - static int __init cs5535_mfgpt_init(void) { struct cs5535_mfgpt_timer *timer; @@ -158,7 +152,9 @@ static int __init cs5535_mfgpt_init(void) } /* And register it with the kernel */ - ret = setup_irq(timer_irq, &mfgptirq); + ret = request_irq(timer_irq, mfgpt_tick, + IRQF_NOBALANCING | IRQF_TIMER | IRQF_SHARED, + DRV_NAME, NULL); if (ret) { printk(KERN_ERR DRV_NAME ": Unable to set up the interrupt.\n"); goto err_irq; diff --git a/drivers/clocksource/timer-efm32.c b/drivers/clocksource/timer-efm32.c index 5a22cb079ad3..441a4b916841 100644 --- a/drivers/clocksource/timer-efm32.c +++ b/drivers/clocksource/timer-efm32.c @@ -119,13 +119,6 @@ static struct efm32_clock_event_ddata clock_event_ddata = { }, }; -static struct irqaction efm32_clock_event_irq = { - .name = "efm32 clockevent", - .flags = IRQF_TIMER, - .handler = efm32_clock_event_handler, - .dev_id = &clock_event_ddata, -}; - static int __init efm32_clocksource_init(struct device_node *np) { struct clk *clk; @@ -230,7 +223,8 @@ static int __init efm32_clockevent_init(struct device_node *np) DIV_ROUND_CLOSEST(rate, 1024), 0xf, 0xffff); - ret = setup_irq(irq, &efm32_clock_event_irq); + ret = request_irq(irq, efm32_clock_event_handler, IRQF_TIMER, + "efm32 clockevent", &clock_event_ddata); if (ret) { pr_err("Failed setup irq\n"); goto err_setup_irq; diff --git a/drivers/clocksource/timer-fsl-ftm.c b/drivers/clocksource/timer-fsl-ftm.c index a9d9a3ca5996..12a2ed7cfaff 100644 --- a/drivers/clocksource/timer-fsl-ftm.c +++ b/drivers/clocksource/timer-fsl-ftm.c @@ -176,13 +176,6 @@ static struct clock_event_device ftm_clockevent = { .rating = 300, }; -static struct irqaction ftm_timer_irq = { - .name = "Freescale ftm timer", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = ftm_evt_interrupt, - .dev_id = &ftm_clockevent, -}; - static int __init ftm_clockevent_init(unsigned long freq, int irq) { int err; @@ -192,7 +185,8 @@ static int __init ftm_clockevent_init(unsigned long freq, int irq) ftm_reset_counter(priv->clkevt_base); - err = setup_irq(irq, &ftm_timer_irq); + err = request_irq(irq, ftm_evt_interrupt, IRQF_TIMER | IRQF_IRQPOLL, + "Freescale ftm timer", &ftm_clockevent); if (err) { pr_err("ftm: setup irq failed: %d\n", err); return err; diff --git a/drivers/clocksource/timer-imx-gpt.c b/drivers/clocksource/timer-imx-gpt.c index 706c0d0ff56c..7b2c70f2f353 100644 --- a/drivers/clocksource/timer-imx-gpt.c +++ b/drivers/clocksource/timer-imx-gpt.c @@ -67,7 +67,6 @@ struct imx_timer { struct clk *clk_ipg; const struct imx_gpt_data *gpt; struct clock_event_device ced; - struct irqaction act; }; struct imx_gpt_data { @@ -273,7 +272,6 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id) static int __init mxc_clockevent_init(struct imx_timer *imxtm) { struct clock_event_device *ced = &imxtm->ced; - struct irqaction *act = &imxtm->act; ced->name = "mxc_timer1"; ced->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_DYNIRQ; @@ -287,12 +285,8 @@ static int __init mxc_clockevent_init(struct imx_timer *imxtm) clockevents_config_and_register(ced, clk_get_rate(imxtm->clk_per), 0xff, 0xfffffffe); - act->name = "i.MX Timer Tick"; - act->flags = IRQF_TIMER | IRQF_IRQPOLL; - act->handler = mxc_timer_interrupt; - act->dev_id = ced; - - return setup_irq(imxtm->irq, act); + return request_irq(imxtm->irq, mxc_timer_interrupt, + IRQF_TIMER | IRQF_IRQPOLL, "i.MX Timer Tick", ced); } static void imx1_gpt_setup_tctl(struct imx_timer *imxtm) diff --git a/drivers/clocksource/timer-integrator-ap.c b/drivers/clocksource/timer-integrator-ap.c index c90a69c7b5fa..b0fcbaac58b0 100644 --- a/drivers/clocksource/timer-integrator-ap.c +++ b/drivers/clocksource/timer-integrator-ap.c @@ -123,13 +123,6 @@ static struct clock_event_device integrator_clockevent = { .rating = 300, }; -static struct irqaction integrator_timer_irq = { - .name = "timer", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = integrator_timer_interrupt, - .dev_id = &integrator_clockevent, -}; - static int integrator_clockevent_init(unsigned long inrate, void __iomem *base, int irq) { @@ -149,7 +142,9 @@ static int integrator_clockevent_init(unsigned long inrate, timer_reload = rate / HZ; writel(ctrl, clkevt_base + TIMER_CTRL); - ret = setup_irq(irq, &integrator_timer_irq); + ret = request_irq(irq, integrator_timer_interrupt, + IRQF_TIMER | IRQF_IRQPOLL, "timer", + &integrator_clockevent); if (ret) return ret; diff --git a/drivers/clocksource/timer-meson6.c b/drivers/clocksource/timer-meson6.c index 9e8b467c71da..99f5510a2b56 100644 --- a/drivers/clocksource/timer-meson6.c +++ b/drivers/clocksource/timer-meson6.c @@ -150,13 +150,6 @@ static irqreturn_t meson6_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction meson6_timer_irq = { - .name = "meson6_timer", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = meson6_timer_interrupt, - .dev_id = &meson6_clockevent, -}; - static int __init meson6_timer_init(struct device_node *node) { u32 val; @@ -194,7 +187,9 @@ static int __init meson6_timer_init(struct device_node *node) /* Stop the timer A */ meson6_clkevt_time_stop(); - ret = setup_irq(irq, &meson6_timer_irq); + ret = request_irq(irq, meson6_timer_interrupt, + IRQF_TIMER | IRQF_IRQPOLL, "meson6_timer", + &meson6_clockevent); if (ret) { pr_warn("failed to setup irq %d\n", irq); return ret; diff --git a/drivers/clocksource/timer-orion.c b/drivers/clocksource/timer-orion.c index 7d487107e3cd..d01ff4181867 100644 --- a/drivers/clocksource/timer-orion.c +++ b/drivers/clocksource/timer-orion.c @@ -114,12 +114,6 @@ static irqreturn_t orion_clkevt_irq_handler(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction orion_clkevt_irq = { - .name = "orion_event", - .flags = IRQF_TIMER, - .handler = orion_clkevt_irq_handler, -}; - static int __init orion_timer_init(struct device_node *np) { unsigned long rate; @@ -172,7 +166,8 @@ static int __init orion_timer_init(struct device_node *np) sched_clock_register(orion_read_sched_clock, 32, rate); /* setup timer1 as clockevent timer */ - ret = setup_irq(irq, &orion_clkevt_irq); + ret = request_irq(irq, orion_clkevt_irq_handler, IRQF_TIMER, + "orion_event", NULL); if (ret) { pr_err("%pOFn: unable to setup irq\n", np); return ret; diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c index d4a9dcf5fba2..3d202813f992 100644 --- a/drivers/clocksource/timer-prima2.c +++ b/drivers/clocksource/timer-prima2.c @@ -165,14 +165,6 @@ static struct clocksource sirfsoc_clocksource = { .resume = sirfsoc_clocksource_resume, }; -static struct irqaction sirfsoc_timer_irq = { - .name = "sirfsoc_timer0", - .flags = IRQF_TIMER, - .irq = 0, - .handler = sirfsoc_timer_interrupt, - .dev_id = &sirfsoc_clockevent, -}; - /* Overwrite weak default sched_clock with more precise one */ static u64 notrace sirfsoc_read_sched_clock(void) { @@ -234,7 +226,8 @@ static int __init sirfsoc_prima2_timer_init(struct device_node *np) sched_clock_register(sirfsoc_read_sched_clock, 64, PRIMA2_CLOCK_FREQ); - ret = setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq); + ret = request_irq(sirfsoc_timer_irq.irq, sirfsoc_timer_interrupt, + IRQF_TIMER, "sirfsoc_timer0", &sirfsoc_clockevent); if (ret) { pr_err("Failed to setup irq\n"); return ret; diff --git a/drivers/clocksource/timer-pxa.c b/drivers/clocksource/timer-pxa.c index 913a5d354a1f..7ad0e5adb2ff 100644 --- a/drivers/clocksource/timer-pxa.c +++ b/drivers/clocksource/timer-pxa.c @@ -143,13 +143,6 @@ static struct clock_event_device ckevt_pxa_osmr0 = { .resume = pxa_timer_resume, }; -static struct irqaction pxa_ost0_irq = { - .name = "ost0", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = pxa_ost0_interrupt, - .dev_id = &ckevt_pxa_osmr0, -}; - static int __init pxa_timer_common_init(int irq, unsigned long clock_tick_rate) { int ret; @@ -161,7 +154,8 @@ static int __init pxa_timer_common_init(int irq, unsigned long clock_tick_rate) ckevt_pxa_osmr0.cpumask = cpumask_of(0); - ret = setup_irq(irq, &pxa_ost0_irq); + ret = request_irq(irq, pxa_ost0_interrupt, IRQF_TIMER | IRQF_IRQPOLL, + "ost0", &ckevt_pxa_osmr0); if (ret) { pr_err("Failed to setup irq\n"); return ret; diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c index 9c841980eed1..ae0b26879ca9 100644 --- a/drivers/clocksource/timer-sp804.c +++ b/drivers/clocksource/timer-sp804.c @@ -168,13 +168,6 @@ static struct clock_event_device sp804_clockevent = { .rating = 300, }; -static struct irqaction sp804_timer_irq = { - .name = "timer", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = sp804_timer_interrupt, - .dev_id = &sp804_clockevent, -}; - int __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struct clk *clk, const char *name) { struct clock_event_device *evt = &sp804_clockevent; @@ -200,7 +193,9 @@ int __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struct writel(0, base + TIMER_CTRL); - setup_irq(irq, &sp804_timer_irq); + if (request_irq(irq, sp804_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, + "timer", &sp804_clockevent)) + pr_err("request_irq() on %s failed\n", "timer"); clockevents_config_and_register(evt, rate, 0xf, 0xffffffff); return 0; diff --git a/drivers/clocksource/timer-u300.c b/drivers/clocksource/timer-u300.c index 32adc3057dda..37cba8dfd45f 100644 --- a/drivers/clocksource/timer-u300.c +++ b/drivers/clocksource/timer-u300.c @@ -330,12 +330,6 @@ static irqreturn_t u300_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction u300_timer_irq = { - .name = "U300 Timer Tick", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = u300_timer_interrupt, -}; - /* * Override the global weak sched_clock symbol with this * local implementation which uses the clocksource to get some @@ -420,7 +414,8 @@ static int __init u300_timer_init_of(struct device_node *np) u300_timer_base + U300_TIMER_APP_RGPT1); /* Set up the IRQ handler */ - ret = setup_irq(irq, &u300_timer_irq); + ret = request_irq(irq, u300_timer_interrupt, + IRQF_TIMER | IRQF_IRQPOLL, "U300 Timer Tick", NULL); if (ret) return ret; diff --git a/drivers/clocksource/timer-vf-pit.c b/drivers/clocksource/timer-vf-pit.c index fef0bb4e0c8c..7ad4a8b008c2 100644 --- a/drivers/clocksource/timer-vf-pit.c +++ b/drivers/clocksource/timer-vf-pit.c @@ -123,19 +123,13 @@ static struct clock_event_device clockevent_pit = { .rating = 300, }; -static struct irqaction pit_timer_irq = { - .name = "VF pit timer", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = pit_timer_interrupt, - .dev_id = &clockevent_pit, -}; - static int __init pit_clockevent_init(unsigned long rate, int irq) { __raw_writel(0, clkevt_base + PITTCTRL); __raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG); - BUG_ON(setup_irq(irq, &pit_timer_irq)); + BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, + "VF pit timer", &clockevent_pit); clockevent_pit.cpumask = cpumask_of(0); clockevent_pit.irq = irq; diff --git a/drivers/clocksource/timer-vt8500.c b/drivers/clocksource/timer-vt8500.c index bb424bcefbb3..a469b1b5f972 100644 --- a/drivers/clocksource/timer-vt8500.c +++ b/drivers/clocksource/timer-vt8500.c @@ -101,13 +101,6 @@ static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction irq = { - .name = "vt8500_timer", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = vt8500_timer_interrupt, - .dev_id = &clockevent, -}; - static int __init vt8500_timer_init(struct device_node *np) { int timer_irq, ret; @@ -139,7 +132,9 @@ static int __init vt8500_timer_init(struct device_node *np) clockevent.cpumask = cpumask_of(0); - ret = setup_irq(timer_irq, &irq); + ret = request_irq(timer_irq, vt8500_timer_interrupt, + IRQF_TIMER | IRQF_IRQPOLL, "vt8500_timer", + &clockevent); if (ret) { pr_err("%s: setup_irq failed for %s\n", __func__, clockevent.name); diff --git a/drivers/clocksource/timer-zevio.c b/drivers/clocksource/timer-zevio.c index c0041561f1be..381c3e8fb900 100644 --- a/drivers/clocksource/timer-zevio.c +++ b/drivers/clocksource/timer-zevio.c @@ -53,7 +53,6 @@ struct zevio_timer { struct clk *clk; struct clock_event_device clkevt; - struct irqaction clkevt_irq; char clocksource_name[64]; char clockevent_name[64]; @@ -172,12 +171,12 @@ static int __init zevio_timer_add(struct device_node *node) /* Interrupt to occur when timer value matches 0 */ writel(0, timer->base + IO_MATCH(TIMER_MATCH)); - timer->clkevt_irq.name = timer->clockevent_name; - timer->clkevt_irq.handler = zevio_timer_interrupt; - timer->clkevt_irq.dev_id = timer; - timer->clkevt_irq.flags = IRQF_TIMER | IRQF_IRQPOLL; - - setup_irq(irqnr, &timer->clkevt_irq); + if (request_irq(irqnr, zevio_timer_interrupt, + IRQF_TIMER | IRQF_IRQPOLL, + timer->clockevent_name, timer)) { + pr_err("request_irq() on %s failed\n", + timer->clockevent_name); + } clockevents_config_and_register(&timer->clkevt, clk_get_rate(timer->clk), 0x0001, 0xffff); diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h index 14f072edbca5..82ebf9223948 100644 --- a/include/linux/dw_apb_timer.h +++ b/include/linux/dw_apb_timer.h @@ -25,7 +25,6 @@ struct dw_apb_timer { struct dw_apb_clock_event_device { struct clock_event_device ced; struct dw_apb_timer timer; - struct irqaction irqaction; void (*eoi)(struct dw_apb_timer *); }; -- 2.24.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() 2020-02-12 8:05 ` [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() afzal mohammed @ 2020-02-20 11:13 ` Daniel Lezcano 2020-02-20 14:48 ` Linus Walleij 1 sibling, 0 replies; 11+ messages in thread From: Daniel Lezcano @ 2020-02-20 11:13 UTC (permalink / raw) To: afzal mohammed, linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-samsung-soc, linux-amlogic Cc: Thomas Gleixner, Florian Fainelli, Ray Jui, Scott Branden, bcm-kernel-feedback-list, Nicolas Saenz Julienne, Kukjin Kim, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, Barry Song, Uwe Kleine-König, Kevin Hilman, Linus Walleij, Tony Prisk, Allison Randal, Enrico Weigelt, Greg Kroah-Hartman, Kate Stewart On 12/02/2020 09:05, afzal mohammed wrote: > request_irq() is preferred over setup_irq(). Existing callers of > setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while > memory allocators are ready by 'mm_init()'. > > Per tglx[1], setup_irq() existed in olden days when allocators were not > ready by the time early interrupts were initialized. > > Hence replace setup_irq() by request_irq(). > > Seldom remove_irq() usage has been observed coupled with setup_irq(), > wherever that has been found, it too has been replaced by free_irq(). > > [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos > > Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com> Nice, thanks for this cleanup Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> [ ... ] -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() 2020-02-12 8:05 ` [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() afzal mohammed 2020-02-20 11:13 ` Daniel Lezcano @ 2020-02-20 14:48 ` Linus Walleij 1 sibling, 0 replies; 11+ messages in thread From: Linus Walleij @ 2020-02-20 14:48 UTC (permalink / raw) To: afzal mohammed Cc: linux-kernel@vger.kernel.org, linux-rpi-kernel, Linux ARM, linux-samsung-soc, open list:ARM/Amlogic Meson..., Daniel Lezcano, Thomas Gleixner, Florian Fainelli, Ray Jui, Scott Branden, bcm-kernel-feedback-list, Nicolas Saenz Julienne, Kukjin Kim, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, Barry Song, Uwe Kleine-König, Kevin Hilman, Tony Prisk, Allison Randal, Enrico Weigelt, Greg Kroah-Hartman, Kate Stewart On Wed, Feb 12, 2020 at 9:05 AM afzal mohammed <afzal.mohd.ma@gmail.com> wrote: > request_irq() is preferred over setup_irq(). Existing callers of > setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while > memory allocators are ready by 'mm_init()'. > > Per tglx[1], setup_irq() existed in olden days when allocators were not > ready by the time early interrupts were initialized. > > Hence replace setup_irq() by request_irq(). > > Seldom remove_irq() usage has been observed coupled with setup_irq(), > wherever that has been found, it too has been replaced by free_irq(). > > [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos > > Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com> This makes the kernel a better place. Acked-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 00/18] genirq: Remove setup_irq() 2020-02-12 8:01 [PATCH 00/18] genirq: Remove setup_irq() afzal mohammed 2020-02-12 8:05 ` [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() afzal mohammed @ 2020-02-27 10:31 ` Thomas Gleixner 2020-02-27 11:07 ` afzal mohammed 1 sibling, 1 reply; 11+ messages in thread From: Thomas Gleixner @ 2020-02-27 10:31 UTC (permalink / raw) To: afzal mohammed, linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev, linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon, linux-c6x-dev, linux-omap, linux-alpha Cc: Julia Lawall, Gilles Muller, Nicolas Palix, Michal Marek Afzal, afzal mohammed <afzal.mohd.ma@gmail.com> writes: > While trying to understand internals of irq handling, came across a > thread [1] in which tglx was referring to avoid usage of setup_irq(). > Existing callers of setup_irq() reached mostly via 'init_IRQ()' & > 'time_init()', while memory allocators are ready by 'mm_init()'. > > Hence instances of setup_irq() is replaced by request_irq() & > setup_irq() (along with remove_irq()) definition deleted in the last > patch. > > Seldom remove_irq() usage has been observed coupled with setup_irq(), > wherever that has been found, it too has been replaced by free_irq(). thanks a lot for tackling this! Vs. merging this series, I suggest the following approach: - Resubmit the individual changes as single patches or small series to the relevant maintainers and subsystem mailing lists. They have no dependency on a core change and can be applied where they belong to. - After 5.6-rc6, verify which parts have made their way into linux-next and resubmit the ignored ones as a series to me along with the removal of the core parts. That way we can avoid conflicting changes between subsystems and the tip irq/core branch as much as possible. Thanks, tglx ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 00/18] genirq: Remove setup_irq() 2020-02-27 10:31 ` [PATCH 00/18] genirq: Remove setup_irq() Thomas Gleixner @ 2020-02-27 11:07 ` afzal mohammed 2020-03-21 17:43 ` afzal mohammed 0 siblings, 1 reply; 11+ messages in thread From: afzal mohammed @ 2020-02-27 11:07 UTC (permalink / raw) To: Thomas Gleixner Cc: linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev, linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon, linux-c6x-dev, linux-omap, linux-alpha, Julia Lawall, Gilles Muller, Nicolas Palix, Michal Marek Hi Thomas, On Thu, Feb 27, 2020 at 11:31:15AM +0100, Thomas Gleixner wrote: > Vs. merging this series, I suggest the following approach: > > - Resubmit the individual changes as single patches or small series > to the relevant maintainers and subsystem mailing lists. They have > no dependency on a core change and can be applied where they belong > to. > > - After 5.6-rc6, verify which parts have made their way into > linux-next and resubmit the ignored ones as a series to me along > with the removal of the core parts. > > That way we can avoid conflicting changes between subsystems and the tip > irq/core branch as much as possible. Okay, i will do accordingly. [ your mail crossed my v3 (only one patch) posting ] Regards afzal ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 00/18] genirq: Remove setup_irq() 2020-02-27 11:07 ` afzal mohammed @ 2020-03-21 17:43 ` afzal mohammed 2020-03-27 16:08 ` [PATCH 0/6] Kill setup_irq() afzal mohammed 0 siblings, 1 reply; 11+ messages in thread From: afzal mohammed @ 2020-03-21 17:43 UTC (permalink / raw) To: Thomas Gleixner Cc: linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev, linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon, linux-c6x-dev, linux-omap, linux-alpha, Julia Lawall, Gilles Muller, Nicolas Palix, Michal Marek Hi Thomas, On Thu, Feb 27, 2020 at 04:37:13PM +0530, afzal mohammed wrote: > On Thu, Feb 27, 2020 at 11:31:15AM +0100, Thomas Gleixner wrote: > > Vs. merging this series, I suggest the following approach: > > > > - Resubmit the individual changes as single patches or small series > > to the relevant maintainers and subsystem mailing lists. They have > > no dependency on a core change and can be applied where they belong > > to. > > > > - After 5.6-rc6, verify which parts have made their way into > > linux-next and resubmit the ignored ones as a series to me along > > with the removal of the core parts. > > > > That way we can avoid conflicting changes between subsystems and the tip > > irq/core branch as much as possible. > > Okay, i will do accordingly. i am on it, is delayed due to the reason as mentioned at, https://lkml.kernel.org/r/20200321172626.GA6323@afzalpc [ not repeating contents here since other mail was sent just now, cc'ing you ] Regards afzal ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/6] Kill setup_irq() 2020-03-21 17:43 ` afzal mohammed @ 2020-03-27 16:08 ` afzal mohammed 2020-03-28 2:48 ` Brian Cain 0 siblings, 1 reply; 11+ messages in thread From: afzal mohammed @ 2020-03-27 16:08 UTC (permalink / raw) To: Thomas Gleixner Cc: linux-kernel, linux-arm-kernel, linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev, linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon, linux-c6x-dev, linux-omap, linux-alpha Hi Thomas, As compared to the situation mentioned earlier[1], now powerpc patch is also in -next, and the pending ARM patches has been picked up by ARM SoC maintainers today and is expected to show up in next -next. All other subsytem patches has been picked by relevant maintainers & are already in -next except alpha, c6x, hexagon, unicore32 & sh. As it is the case, i am sending you patches for the above 5 architecture's plus the core removal patch. Status of 5 arch's: ------------------- alpha: received ack from Matt Turner, build test success c6x: did receive ack from Mark Salter in v1, the final version (v3) was with minor changes, hence removed his ack & cc'ed him, build test success hexagon: build test success unicore32: couldn't get toolchain from kernel.org, 0day test robot or Segher's buildall sh: To compile the relevant changes sh64 compiler is required, couldn't get it from above mentioned 3 sources. Note 1: sh toolchain is available, but that will not make the relevant changes compile as it has dependency of 64bit arch toolchain, did try a Kconfig hack to make it compile w/ 32bit sh toolchain, but it failed due to other reasons (unknown operands), so gave up on that. Note 2: hexagon final image creation fails even w/o my patch, but it has been ensured that w/ my changes relevant object files are getting built w/o warnings. Regards afzal [1] https://lkml.kernel.org/r/20200321172626.GA6323@afzalpc afzal mohammed (6): alpha: Replace setup_irq() by request_irq() c6x: replace setup_irq() by request_irq() hexagon: replace setup_irq() by request_irq() sh: replace setup_irq() by request_irq() unicore32: replace setup_irq() by request_irq() genirq: Remove setup_irq() and remove_irq() arch/alpha/kernel/irq_alpha.c | 29 ++++---------------- arch/alpha/kernel/irq_i8259.c | 8 ++---- arch/alpha/kernel/irq_impl.h | 7 +---- arch/alpha/kernel/irq_pyxis.c | 3 ++- arch/alpha/kernel/sys_alcor.c | 3 ++- arch/alpha/kernel/sys_cabriolet.c | 3 ++- arch/alpha/kernel/sys_eb64p.c | 3 ++- arch/alpha/kernel/sys_marvel.c | 2 +- arch/alpha/kernel/sys_miata.c | 6 +++-- arch/alpha/kernel/sys_ruffian.c | 3 ++- arch/alpha/kernel/sys_rx164.c | 3 ++- arch/alpha/kernel/sys_sx164.c | 3 ++- arch/alpha/kernel/sys_wildfire.c | 7 ++--- arch/alpha/kernel/time.c | 6 ++--- arch/c6x/platforms/timer64.c | 11 +++----- arch/hexagon/kernel/smp.c | 22 ++++++++-------- arch/hexagon/kernel/time.c | 11 +++----- arch/sh/boards/mach-cayman/irq.c | 18 +++++-------- arch/sh/drivers/dma/dma-pvr2.c | 9 +++---- arch/unicore32/kernel/time.c | 11 +++----- include/linux/irq.h | 2 -- kernel/irq/manage.c | 44 ------------------------------- 22 files changed, 60 insertions(+), 154 deletions(-) -- 2.25.1 ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH 0/6] Kill setup_irq() 2020-03-27 16:08 ` [PATCH 0/6] Kill setup_irq() afzal mohammed @ 2020-03-28 2:48 ` Brian Cain 2020-03-28 7:32 ` afzal mohammed 0 siblings, 1 reply; 11+ messages in thread From: Brian Cain @ 2020-03-28 2:48 UTC (permalink / raw) To: 'afzal mohammed', 'Thomas Gleixner' Cc: linux-kernel, linux-arm-kernel, linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev, linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon, linux-c6x-dev, linux-omap, linux-alpha > -----Original Message----- > From: linux-hexagon-owner@vger.kernel.org <linux-hexagon- > owner@vger.kernel.org> On Behalf Of afzal mohammed > Sent: Friday, March 27, 2020 11:08 AM > To: Thomas Gleixner <tglx@linutronix.de> > Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > linux-samsung-soc@vger.kernel.org; x86@kernel.org; linux- > sh@vger.kernel.org; linux-s390@vger.kernel.org; linuxppc- > dev@lists.ozlabs.org; linux-parisc@vger.kernel.org; linux- > mips@vger.kernel.org; linux-m68k@lists.linux-m68k.org; linux- > ia64@vger.kernel.org; linux-hexagon@vger.kernel.org; linux-c6x-dev@linux- > c6x.org; linux-omap@vger.kernel.org; linux-alpha@vger.kernel.org > Subject: [PATCH 0/6] Kill setup_irq() ... > Note 1: sh toolchain is available, but that will not make the relevant changes > compile as it has dependency of 64bit arch toolchain, did try a Kconfig hack > to make it compile w/ 32bit sh toolchain, but it failed due to other reasons > (unknown operands), so gave up on that. > Note 2: hexagon final image creation fails even w/o my patch, but it has > been ensured that w/ my changes relevant object files are getting built w/o > warnings. Afzal, What's the nature of the failure in "Note 2"? -Brian ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] Kill setup_irq() 2020-03-28 2:48 ` Brian Cain @ 2020-03-28 7:32 ` afzal mohammed 2020-04-02 15:03 ` Brian Cain 0 siblings, 1 reply; 11+ messages in thread From: afzal mohammed @ 2020-03-28 7:32 UTC (permalink / raw) To: Brian Cain Cc: 'Thomas Gleixner', linux-kernel, linux-arm-kernel, linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev, linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon, linux-c6x-dev, linux-omap, linux-alpha Hi Brian, On Fri, Mar 27, 2020 at 09:48:38PM -0500, Brian Cain wrote: > > Note 2: hexagon final image creation fails even w/o my patch > What's the nature of the failure in "Note 2"? drivers/base/firmware_loader/main.o: In function `fw_is_builtin_firmware': /devel/src/kernel6/drivers/base/firmware_loader/main.c:132:(.text+0xc8): relocation truncated to fit: R_HEX_16_X against symbol `__start_builtin_fw' defined in .modinfo section in .tmp_vmlinux1 Makefile:1077: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 [ i had deleted the toolchain earlier, since you asked, download again & checked ] Regards afzal ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH 0/6] Kill setup_irq() 2020-03-28 7:32 ` afzal mohammed @ 2020-04-02 15:03 ` Brian Cain 0 siblings, 0 replies; 11+ messages in thread From: Brian Cain @ 2020-04-02 15:03 UTC (permalink / raw) To: 'afzal mohammed' Cc: 'Thomas Gleixner', linux-kernel, linux-arm-kernel, linux-samsung-soc, x86, linux-sh, linux-s390, linuxppc-dev, linux-parisc, linux-mips, linux-m68k, linux-ia64, linux-hexagon, linux-c6x-dev, linux-omap, linux-alpha > -----Original Message----- > From: linux-hexagon-owner@vger.kernel.org <linux-hexagon- > owner@vger.kernel.org> On Behalf Of afzal mohammed ... > On Fri, Mar 27, 2020 at 09:48:38PM -0500, Brian Cain wrote: > > > > Note 2: hexagon final image creation fails even w/o my patch > > > What's the nature of the failure in "Note 2"? > > drivers/base/firmware_loader/main.o: In function `fw_is_builtin_firmware': > /devel/src/kernel6/drivers/base/firmware_loader/main.c:132:(.text+0xc8): > relocation truncated to fit: R_HEX_16_X against symbol `__start_builtin_fw' > defined in .modinfo section in .tmp_vmlinux1 > Makefile:1077: recipe for target 'vmlinux' failed > make: *** [vmlinux] Error 1 Thanks for reporting it -- I will make a patch to fix it. -Brian ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-04-02 15:03 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-02-12 8:01 [PATCH 00/18] genirq: Remove setup_irq() afzal mohammed 2020-02-12 8:05 ` [PATCH 16/18] clocksource: Replace setup_irq() by request_irq() afzal mohammed 2020-02-20 11:13 ` Daniel Lezcano 2020-02-20 14:48 ` Linus Walleij 2020-02-27 10:31 ` [PATCH 00/18] genirq: Remove setup_irq() Thomas Gleixner 2020-02-27 11:07 ` afzal mohammed 2020-03-21 17:43 ` afzal mohammed 2020-03-27 16:08 ` [PATCH 0/6] Kill setup_irq() afzal mohammed 2020-03-28 2:48 ` Brian Cain 2020-03-28 7:32 ` afzal mohammed 2020-04-02 15:03 ` Brian Cain
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox