* [PATCH 00/18] genirq: Remove setup_irq()
@ 2020-02-12 8:01 afzal mohammed
2020-02-12 8:02 ` [PATCH 01/18] alpha: 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; 10+ 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] 10+ messages in thread* [PATCH 01/18] alpha: replace setup_irq() by request_irq() 2020-02-12 8:01 [PATCH 00/18] genirq: Remove setup_irq() afzal mohammed @ 2020-02-12 8:02 ` afzal mohammed 2020-02-27 10:31 ` [PATCH 00/18] genirq: Remove setup_irq() Thomas Gleixner 1 sibling, 0 replies; 10+ messages in thread From: afzal mohammed @ 2020-02-12 8:02 UTC (permalink / raw) To: linux-kernel, linux-alpha Cc: Richard Henderson, Ivan Kokshaysky, Thomas Gleixner, Matt Turner 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 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 ++---- 14 files changed, 31 insertions(+), 55 deletions(-) diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c index da3e10d5f7fe..fe46a7bdbf68 100644 --- a/arch/alpha/kernel/irq_alpha.c +++ b/arch/alpha/kernel/irq_alpha.c @@ -213,32 +213,13 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr, * The special RTC interrupt type. The interrupt itself was * processed by PALcode, and comes in via entInt vector 1. */ - -struct irqaction timer_irqaction = { - .handler = rtc_timer_interrupt, - .name = "timer", -}; - void __init -init_rtc_irq(void) +init_rtc_irq(irqreturn_t handler) { irq_set_chip_and_handler_name(RTC_IRQ, &dummy_irq_chip, handle_percpu_irq, "RTC"); - setup_irq(RTC_IRQ, &timer_irqaction); + if (!handler) + handler = rtc_timer_interrupt; + if (request_irq(RTC_IRQ, handler, 0, "timer", NULL)) + pr_err("request_irq() for %s failed\n", "timer"); } - -/* Dummy irqactions. */ -struct irqaction isa_cascade_irqaction = { - .handler = no_action, - .name = "isa-cascade" -}; - -struct irqaction timer_cascade_irqaction = { - .handler = no_action, - .name = "timer-cascade" -}; - -struct irqaction halt_switch_irqaction = { - .handler = no_action, - .name = "halt-switch" -}; diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c index 5d54c076a8ae..29e03a2773b3 100644 --- a/arch/alpha/kernel/irq_i8259.c +++ b/arch/alpha/kernel/irq_i8259.c @@ -82,11 +82,6 @@ struct irq_chip i8259a_irq_type = { void __init init_i8259a_irqs(void) { - static struct irqaction cascade = { - .handler = no_action, - .name = "cascade", - }; - long i; outb(0xff, 0x21); /* mask all of 8259A-1 */ @@ -96,7 +91,8 @@ init_i8259a_irqs(void) irq_set_chip_and_handler(i, &i8259a_irq_type, handle_level_irq); } - setup_irq(2, &cascade); + if (request_irq(2, no_action, 0, "cascade", NULL)) + pr_err("request_irq() on %s failed\n", "cascade"); } diff --git a/arch/alpha/kernel/irq_impl.h b/arch/alpha/kernel/irq_impl.h index 16f2b0276f3a..7ac58be4ccf4 100644 --- a/arch/alpha/kernel/irq_impl.h +++ b/arch/alpha/kernel/irq_impl.h @@ -21,14 +21,9 @@ extern void isa_no_iack_sc_device_interrupt(unsigned long); extern void srm_device_interrupt(unsigned long); extern void pyxis_device_interrupt(unsigned long); -extern struct irqaction timer_irqaction; -extern struct irqaction isa_cascade_irqaction; -extern struct irqaction timer_cascade_irqaction; -extern struct irqaction halt_switch_irqaction; - extern void init_srm_irqs(long, unsigned long); extern void init_pyxis_irqs(unsigned long); -extern void init_rtc_irq(void); +extern void init_rtc_irq(irqreturn_t handler); extern void common_init_isa_dma(void); diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c index a968b10e687d..41b613f44da0 100644 --- a/arch/alpha/kernel/irq_pyxis.c +++ b/arch/alpha/kernel/irq_pyxis.c @@ -107,5 +107,6 @@ init_pyxis_irqs(unsigned long ignore_mask) irq_set_status_flags(i, IRQ_LEVEL); } - setup_irq(16+7, &isa_cascade_irqaction); + if (request_irq(16 + 7, no_action, 0, "isa-cascade", NULL)) + pr_err("request_irq() for %s failed\n", "isa-cascade"); } diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c index e56efd5b855f..2db834bf7a84 100644 --- a/arch/alpha/kernel/sys_alcor.c +++ b/arch/alpha/kernel/sys_alcor.c @@ -133,7 +133,8 @@ alcor_init_irq(void) init_i8259a_irqs(); common_init_isa_dma(); - setup_irq(16+31, &isa_cascade_irqaction); + if (request_irq(16 + 31, no_action, 0, "isa-cascade", NULL)) + pr_err("request_irq() for %s failed\n", "isa-cascade"); } diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c index 10bc46a4ec40..3d4ee60ca930 100644 --- a/arch/alpha/kernel/sys_cabriolet.c +++ b/arch/alpha/kernel/sys_cabriolet.c @@ -112,7 +112,8 @@ common_init_irq(void (*srm_dev_int)(unsigned long v)) } common_init_isa_dma(); - setup_irq(16+4, &isa_cascade_irqaction); + if (request_irq(16 + 4, no_action, 0, "isa-cascade", NULL)) + pr_err("request_irq() for %s failed\n", "isa-cascade"); } #ifndef CONFIG_ALPHA_PC164 diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c index 5251937ec1b4..6c7f15703dad 100644 --- a/arch/alpha/kernel/sys_eb64p.c +++ b/arch/alpha/kernel/sys_eb64p.c @@ -123,7 +123,8 @@ eb64p_init_irq(void) } common_init_isa_dma(); - setup_irq(16+5, &isa_cascade_irqaction); + if (request_irq(16 + 5, no_action, 0, "isa-cascade", NULL)) + pr_err("request_irq() for %s failed\n", "isa-cascade"); } /* diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 8d34cf6e002a..533899a4a1a1 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c @@ -397,7 +397,7 @@ marvel_init_pci(void) static void __init marvel_init_rtc(void) { - init_rtc_irq(); + init_rtc_irq(NULL); } static void diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index 6fa07dc5339d..edff228ae451 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c @@ -81,8 +81,10 @@ miata_init_irq(void) init_pyxis_irqs(0x63b0000); common_init_isa_dma(); - setup_irq(16+2, &halt_switch_irqaction); /* SRM only? */ - setup_irq(16+6, &timer_cascade_irqaction); + if (request_irq(16 + 2, no_action, 0, "halt-switch", NULL)) + pr_err("request_irq() for %s failed\n", "halt-switch"); + if (request_irq(16 + 6, no_action, 0, "timer-cascade", NULL)) + pr_err("request_irq() for %s failed\n", "timer-cascade"); } diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c index 07830cccabf9..f2ff64b6553e 100644 --- a/arch/alpha/kernel/sys_ruffian.c +++ b/arch/alpha/kernel/sys_ruffian.c @@ -82,7 +82,8 @@ ruffian_init_rtc(void) outb(0x31, 0x42); outb(0x13, 0x42); - setup_irq(0, &timer_irqaction); + if (request_irq(0, rtc_timer_interrupt, 0, "timer", NULL)) + pr_err("request_irq() for %s failed\n", "timer"); } static void diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c index a3db719d3c38..46c3bd7ed910 100644 --- a/arch/alpha/kernel/sys_rx164.c +++ b/arch/alpha/kernel/sys_rx164.c @@ -106,7 +106,8 @@ rx164_init_irq(void) init_i8259a_irqs(); common_init_isa_dma(); - setup_irq(16+20, &isa_cascade_irqaction); + if (request_irq(16 + 20, no_action, 0, "isa-cascade", NULL)) + pr_err("request_irq() for %s failed\n", "isa-cascade"); } diff --git a/arch/alpha/kernel/sys_sx164.c b/arch/alpha/kernel/sys_sx164.c index 1ec638a2746a..f6f85b2a9c96 100644 --- a/arch/alpha/kernel/sys_sx164.c +++ b/arch/alpha/kernel/sys_sx164.c @@ -54,7 +54,8 @@ sx164_init_irq(void) else init_pyxis_irqs(0xff00003f0000UL); - setup_irq(16+6, &timer_cascade_irqaction); + if (request_irq(16 + 6, no_action, 0, "timer-cascade", NULL)) + pr_err("request_irq() for %s failed\n", "timer-cascade"); } /* diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c index 8e64052811ab..9e0283857ffc 100644 --- a/arch/alpha/kernel/sys_wildfire.c +++ b/arch/alpha/kernel/sys_wildfire.c @@ -156,10 +156,6 @@ static void __init wildfire_init_irq_per_pca(int qbbno, int pcano) { int i, irq_bias; - static struct irqaction isa_enable = { - .handler = no_action, - .name = "isa_enable", - }; irq_bias = qbbno * (WILDFIRE_PCA_PER_QBB * WILDFIRE_IRQ_PER_PCA) + pcano * WILDFIRE_IRQ_PER_PCA; @@ -198,7 +194,8 @@ wildfire_init_irq_per_pca(int qbbno, int pcano) irq_set_status_flags(i + irq_bias, IRQ_LEVEL); } - setup_irq(32+irq_bias, &isa_enable); + if (request_irq(32 + irq_bias, no_action, 0, "isa_enable", NULL)) + pr_err("request_irq() on %s failed\n", "isa_enable"); } static void __init diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 0069360697ee..4d01c392ab14 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -242,7 +242,7 @@ common_init_rtc(void) outb(0x31, 0x42); outb(0x13, 0x42); - init_rtc_irq(); + init_rtc_irq(NULL); } \f @@ -396,9 +396,7 @@ time_init(void) if (alpha_using_qemu) { clocksource_register_hz(&qemu_cs, NSEC_PER_SEC); init_qemu_clockevent(); - - timer_irqaction.handler = qemu_timer_interrupt; - init_rtc_irq(); + init_rtc_irq(qemu_timer_interrupt); return; } -- 2.24.1 ^ permalink raw reply related [flat|nested] 10+ 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:02 ` [PATCH 01/18] alpha: 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; 10+ 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, Michal Marek, Nicolas Palix, Gilles Muller 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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-27 16:09 ` [PATCH v5 1/6] alpha: Replace setup_irq() by request_irq() afzal mohammed 2020-03-28 2:48 ` [PATCH 0/6] Kill setup_irq() Brian Cain 0 siblings, 2 replies; 10+ 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] 10+ messages in thread
* [PATCH v5 1/6] alpha: Replace setup_irq() by request_irq() 2020-03-27 16:08 ` [PATCH 0/6] Kill setup_irq() afzal mohammed @ 2020-03-27 16:09 ` afzal mohammed 2020-03-28 2:48 ` [PATCH 0/6] Kill setup_irq() Brian Cain 1 sibling, 0 replies; 10+ messages in thread From: afzal mohammed @ 2020-03-27 16:09 UTC (permalink / raw) To: Thomas Gleixner Cc: linux-alpha, linux-kernel, Richard Henderson, Ivan Kokshaysky, Matt Turner request_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready. 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(). [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com> Acked-by: Matt Turner <mattst88@gmail.com> --- Link to v4, v3, v2 & v1, [v4] https://lkml.kernel.org/r/20200305130843.17989-1-afzal.mohd.ma@gmail.com [v3] https://lkml.kernel.org/r/20200304005209.5636-1-afzal.mohd.ma@gmail.com [v2] https://lkml.kernel.org/r/cover.1582471508.git.afzal.mohd.ma@gmail.com [v1] https://lkml.kernel.org/r/cover.1581478323.git.afzal.mohd.ma@gmail.com v5: * Add tag v4: * Fix build error @ init_rtc_irq arg v3: * Split out from tree wide series, as Thomas suggested to get it thr' respective maintainers * Modify pr_err displayed in case of error * Re-arrange code & choose pr_err args as required to improve readability * Remove irrelevant parts from commit message & improve v2: * Replace pr_err("request_irq() on %s failed" by pr_err("%s: request_irq() failed" * Commit message massage 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 ++---- 14 files changed, 31 insertions(+), 55 deletions(-) diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c index da3e10d5f7fe..d17e44c99df9 100644 --- a/arch/alpha/kernel/irq_alpha.c +++ b/arch/alpha/kernel/irq_alpha.c @@ -213,32 +213,13 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr, * The special RTC interrupt type. The interrupt itself was * processed by PALcode, and comes in via entInt vector 1. */ - -struct irqaction timer_irqaction = { - .handler = rtc_timer_interrupt, - .name = "timer", -}; - void __init -init_rtc_irq(void) +init_rtc_irq(irq_handler_t handler) { irq_set_chip_and_handler_name(RTC_IRQ, &dummy_irq_chip, handle_percpu_irq, "RTC"); - setup_irq(RTC_IRQ, &timer_irqaction); + if (!handler) + handler = rtc_timer_interrupt; + if (request_irq(RTC_IRQ, handler, 0, "timer", NULL)) + pr_err("Failed to register timer interrupt\n"); } - -/* Dummy irqactions. */ -struct irqaction isa_cascade_irqaction = { - .handler = no_action, - .name = "isa-cascade" -}; - -struct irqaction timer_cascade_irqaction = { - .handler = no_action, - .name = "timer-cascade" -}; - -struct irqaction halt_switch_irqaction = { - .handler = no_action, - .name = "halt-switch" -}; diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c index 5d54c076a8ae..1dcf0d9038fd 100644 --- a/arch/alpha/kernel/irq_i8259.c +++ b/arch/alpha/kernel/irq_i8259.c @@ -82,11 +82,6 @@ struct irq_chip i8259a_irq_type = { void __init init_i8259a_irqs(void) { - static struct irqaction cascade = { - .handler = no_action, - .name = "cascade", - }; - long i; outb(0xff, 0x21); /* mask all of 8259A-1 */ @@ -96,7 +91,8 @@ init_i8259a_irqs(void) irq_set_chip_and_handler(i, &i8259a_irq_type, handle_level_irq); } - setup_irq(2, &cascade); + if (request_irq(2, no_action, 0, "cascade", NULL)) + pr_err("Failed to request irq 2 (cascade)\n"); } diff --git a/arch/alpha/kernel/irq_impl.h b/arch/alpha/kernel/irq_impl.h index 16f2b0276f3a..fbf21892e66d 100644 --- a/arch/alpha/kernel/irq_impl.h +++ b/arch/alpha/kernel/irq_impl.h @@ -21,14 +21,9 @@ extern void isa_no_iack_sc_device_interrupt(unsigned long); extern void srm_device_interrupt(unsigned long); extern void pyxis_device_interrupt(unsigned long); -extern struct irqaction timer_irqaction; -extern struct irqaction isa_cascade_irqaction; -extern struct irqaction timer_cascade_irqaction; -extern struct irqaction halt_switch_irqaction; - extern void init_srm_irqs(long, unsigned long); extern void init_pyxis_irqs(unsigned long); -extern void init_rtc_irq(void); +extern void init_rtc_irq(irq_handler_t handler); extern void common_init_isa_dma(void); diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c index a968b10e687d..27070b5bd33e 100644 --- a/arch/alpha/kernel/irq_pyxis.c +++ b/arch/alpha/kernel/irq_pyxis.c @@ -107,5 +107,6 @@ init_pyxis_irqs(unsigned long ignore_mask) irq_set_status_flags(i, IRQ_LEVEL); } - setup_irq(16+7, &isa_cascade_irqaction); + if (request_irq(16 + 7, no_action, 0, "isa-cascade", NULL)) + pr_err("Failed to register isa-cascade interrupt\n"); } diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c index e56efd5b855f..ce5430056f65 100644 --- a/arch/alpha/kernel/sys_alcor.c +++ b/arch/alpha/kernel/sys_alcor.c @@ -133,7 +133,8 @@ alcor_init_irq(void) init_i8259a_irqs(); common_init_isa_dma(); - setup_irq(16+31, &isa_cascade_irqaction); + if (request_irq(16 + 31, no_action, 0, "isa-cascade", NULL)) + pr_err("Failed to register isa-cascade interrupt\n"); } diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c index 10bc46a4ec40..0aa6a27d0e2f 100644 --- a/arch/alpha/kernel/sys_cabriolet.c +++ b/arch/alpha/kernel/sys_cabriolet.c @@ -112,7 +112,8 @@ common_init_irq(void (*srm_dev_int)(unsigned long v)) } common_init_isa_dma(); - setup_irq(16+4, &isa_cascade_irqaction); + if (request_irq(16 + 4, no_action, 0, "isa-cascade", NULL)) + pr_err("Failed to register isa-cascade interrupt\n"); } #ifndef CONFIG_ALPHA_PC164 diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c index 5251937ec1b4..1cdfe55fb987 100644 --- a/arch/alpha/kernel/sys_eb64p.c +++ b/arch/alpha/kernel/sys_eb64p.c @@ -123,7 +123,8 @@ eb64p_init_irq(void) } common_init_isa_dma(); - setup_irq(16+5, &isa_cascade_irqaction); + if (request_irq(16 + 5, no_action, 0, "isa-cascade", NULL)) + pr_err("Failed to register isa-cascade interrupt\n"); } /* diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 8d34cf6e002a..533899a4a1a1 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c @@ -397,7 +397,7 @@ marvel_init_pci(void) static void __init marvel_init_rtc(void) { - init_rtc_irq(); + init_rtc_irq(NULL); } static void diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index 6fa07dc5339d..702292af2225 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c @@ -81,8 +81,10 @@ miata_init_irq(void) init_pyxis_irqs(0x63b0000); common_init_isa_dma(); - setup_irq(16+2, &halt_switch_irqaction); /* SRM only? */ - setup_irq(16+6, &timer_cascade_irqaction); + if (request_irq(16 + 2, no_action, 0, "halt-switch", NULL)) + pr_err("Failed to register halt-switch interrupt\n"); + if (request_irq(16 + 6, no_action, 0, "timer-cascade", NULL)) + pr_err("Failed to register timer-cascade interrupt\n"); } diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c index 07830cccabf9..d33074011960 100644 --- a/arch/alpha/kernel/sys_ruffian.c +++ b/arch/alpha/kernel/sys_ruffian.c @@ -82,7 +82,8 @@ ruffian_init_rtc(void) outb(0x31, 0x42); outb(0x13, 0x42); - setup_irq(0, &timer_irqaction); + if (request_irq(0, rtc_timer_interrupt, 0, "timer", NULL)) + pr_err("Failed to request irq 0 (timer)\n"); } static void diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c index a3db719d3c38..4d85eaeb44aa 100644 --- a/arch/alpha/kernel/sys_rx164.c +++ b/arch/alpha/kernel/sys_rx164.c @@ -106,7 +106,8 @@ rx164_init_irq(void) init_i8259a_irqs(); common_init_isa_dma(); - setup_irq(16+20, &isa_cascade_irqaction); + if (request_irq(16 + 20, no_action, 0, "isa-cascade", NULL)) + pr_err("Failed to register isa-cascade interrupt\n"); } diff --git a/arch/alpha/kernel/sys_sx164.c b/arch/alpha/kernel/sys_sx164.c index 1ec638a2746a..17cc203176c8 100644 --- a/arch/alpha/kernel/sys_sx164.c +++ b/arch/alpha/kernel/sys_sx164.c @@ -54,7 +54,8 @@ sx164_init_irq(void) else init_pyxis_irqs(0xff00003f0000UL); - setup_irq(16+6, &timer_cascade_irqaction); + if (request_irq(16 + 6, no_action, 0, "timer-cascade", NULL)) + pr_err("Failed to register timer-cascade interrupt\n"); } /* diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c index 8e64052811ab..2191bde161fd 100644 --- a/arch/alpha/kernel/sys_wildfire.c +++ b/arch/alpha/kernel/sys_wildfire.c @@ -156,10 +156,6 @@ static void __init wildfire_init_irq_per_pca(int qbbno, int pcano) { int i, irq_bias; - static struct irqaction isa_enable = { - .handler = no_action, - .name = "isa_enable", - }; irq_bias = qbbno * (WILDFIRE_PCA_PER_QBB * WILDFIRE_IRQ_PER_PCA) + pcano * WILDFIRE_IRQ_PER_PCA; @@ -198,7 +194,8 @@ wildfire_init_irq_per_pca(int qbbno, int pcano) irq_set_status_flags(i + irq_bias, IRQ_LEVEL); } - setup_irq(32+irq_bias, &isa_enable); + if (request_irq(32 + irq_bias, no_action, 0, "isa_enable", NULL)) + pr_err("Failed to register isa_enable interrupt\n"); } static void __init diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 0069360697ee..4d01c392ab14 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -242,7 +242,7 @@ common_init_rtc(void) outb(0x31, 0x42); outb(0x13, 0x42); - init_rtc_irq(); + init_rtc_irq(NULL); } \f @@ -396,9 +396,7 @@ time_init(void) if (alpha_using_qemu) { clocksource_register_hz(&qemu_cs, NSEC_PER_SEC); init_qemu_clockevent(); - - timer_irqaction.handler = qemu_timer_interrupt; - init_rtc_irq(); + init_rtc_irq(qemu_timer_interrupt); return; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 10+ 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-27 16:09 ` [PATCH v5 1/6] alpha: Replace setup_irq() by request_irq() afzal mohammed @ 2020-03-28 2:48 ` Brian Cain 2020-03-28 7:32 ` afzal mohammed 1 sibling, 1 reply; 10+ messages in thread From: Brian Cain @ 2020-03-28 2:48 UTC (permalink / raw) To: 'afzal mohammed', 'Thomas Gleixner' Cc: linux-s390, linux-samsung-soc, linux-ia64, linux-c6x-dev, linux-parisc, linux-sh, linux-hexagon, x86, linux-kernel, linux-mips, linux-m68k, linux-alpha, linux-omap, linuxppc-dev, linux-arm-kernel > -----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] 10+ messages in thread
* Re: [PATCH 0/6] Kill setup_irq() 2020-03-28 2:48 ` [PATCH 0/6] Kill setup_irq() Brian Cain @ 2020-03-28 7:32 ` afzal mohammed 2020-04-02 15:03 ` Brian Cain 0 siblings, 1 reply; 10+ 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] 10+ 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; 10+ 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] 10+ messages in thread
end of thread, other threads:[~2020-04-02 15:03 UTC | newest] Thread overview: 10+ 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:02 ` [PATCH 01/18] alpha: replace setup_irq() by request_irq() afzal mohammed 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-27 16:09 ` [PATCH v5 1/6] alpha: Replace setup_irq() by request_irq() afzal mohammed 2020-03-28 2:48 ` [PATCH 0/6] Kill setup_irq() 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; as well as URLs for NNTP newsgroup(s).