All of lore.kernel.org
 help / color / mirror / Atom feed
From: afzal mohammed <afzal.mohd.ma@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
	Richard Henderson <rth@twiddle.net>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>
Subject: [PATCH v5 1/6] alpha: Replace setup_irq() by request_irq()
Date: Fri, 27 Mar 2020 21:39:01 +0530	[thread overview]
Message-ID: <51f8ae7da9f47a23596388141933efa2bdef317b.1585320721.git.afzal.mohd.ma@gmail.com> (raw)
In-Reply-To: <cover.1585320721.git.afzal.mohd.ma@gmail.com>

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


  reply	other threads:[~2020-03-27 16:09 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12  8:01 [PATCH 00/18] genirq: Remove setup_irq() afzal mohammed
2020-02-12  8:13 ` afzal mohammed
2020-02-12  8:01 ` afzal mohammed
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-12  8:02 ` [PATCH 02/18] ARM: " afzal mohammed
2020-02-12  8:02   ` afzal mohammed
2020-02-12  8:10   ` Viresh Kumar
2020-02-12  8:10     ` Viresh Kumar
2020-02-12  8:10     ` Viresh Kumar
2020-02-12 23:27   ` Alexander Sverdlin
2020-02-12 23:27     ` Alexander Sverdlin
2020-02-12 23:27     ` Alexander Sverdlin
2020-02-12  8:02 ` [PATCH 03/18] c6x: " afzal mohammed
2020-02-13 17:37   ` Mark Salter
2020-02-12  8:03 ` [PATCH 04/18] hexagon: " afzal mohammed
2020-02-12  8:03 ` [PATCH 05/18] ia64: " afzal mohammed
2020-02-12  8:15   ` afzal mohammed
2020-02-12  8:03 ` [PATCH 06/18] m68k: Replace " afzal mohammed
2020-02-12 22:25   ` Finn Thain
2020-02-13  2:03     ` afzal mohammed
2020-02-13  7:11   ` Greg Ungerer
2020-02-14 13:07     ` afzal mohammed
2020-02-12  8:03 ` [PATCH 07/18] microblaze: " afzal mohammed
2020-02-12  8:04 ` [PATCH 08/18] MIPS: " afzal mohammed
2020-02-12  8:04   ` afzal mohammed
2020-02-12  8:04 ` [PATCH 09/18] parisc: " afzal mohammed
2020-02-12  8:04 ` [PATCH 10/18] powerpc: " afzal mohammed
2020-02-12  8:04   ` afzal mohammed
2020-02-13 10:59   ` Christophe Leroy
2020-02-13 10:59     ` Christophe Leroy
2020-02-12  8:04 ` [PATCH 11/18] s390: replace " afzal mohammed
2020-02-12  8:04 ` [PATCH 12/18] sh: " afzal mohammed
2020-02-12  8:16   ` afzal mohammed
2020-02-12  8:05 ` [PATCH 13/18] unicore32: " afzal mohammed
2020-02-12  8:05 ` [PATCH 14/18] x86: Replace " afzal mohammed
2020-02-27 10:49   ` Thomas Gleixner
2020-02-27 11:36     ` afzal mohammed
2020-02-27 13:29       ` Thomas Gleixner
2020-02-27 14:26         ` afzal mohammed
2020-02-12  8:05 ` [PATCH 15/18] xtensa: replace " afzal mohammed
2020-02-12  9:10   ` Max Filippov
2020-02-12  8:05 ` [PATCH 16/18] clocksource: Replace " afzal mohammed
2020-02-12  8:05   ` afzal mohammed
2020-02-12  8:05   ` afzal mohammed
2020-02-20 11:13   ` Daniel Lezcano
2020-02-20 11:13     ` Daniel Lezcano
2020-02-20 11:13     ` Daniel Lezcano
2020-02-20 14:48   ` Linus Walleij
2020-02-20 14:48     ` Linus Walleij
2020-02-20 14:48     ` Linus Walleij
2020-02-12  8:05 ` [PATCH 17/18] irqchip: " afzal mohammed
     [not found]   ` <8e00874d072f32496c2d0da05423bda1cadd6975.1581478324.git.afzal.mohd.ma@gmail. com>
2020-02-13 16:02     ` Paul Cercueil
2020-02-12  8:06 ` [PATCH 18/18] genirq: Remove setup_irq() and remove_irq() afzal mohammed
2020-02-20 14:49   ` Linus Walleij
2020-02-27 10:31 ` [PATCH 00/18] genirq: Remove setup_irq() Thomas Gleixner
2020-02-27 10:31   ` Thomas Gleixner
2020-02-27 10:31   ` Thomas Gleixner
2020-02-27 10:31   ` Thomas Gleixner
2020-02-27 11:07   ` afzal mohammed
2020-02-27 11:19     ` afzal mohammed
2020-02-27 11:07     ` afzal mohammed
2020-02-27 11:07     ` afzal mohammed
2020-03-21 17:43     ` afzal mohammed
2020-03-21 17:55       ` afzal mohammed
2020-03-21 17:43       ` 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:20         ` afzal mohammed
2020-03-27 16:08         ` afzal mohammed
2020-03-27 16:08         ` afzal mohammed
2020-03-27 16:09         ` afzal mohammed [this message]
2020-03-27 16:09         ` [PATCH v5 2/6] c6x: replace setup_irq() by request_irq() afzal mohammed
2020-03-27 16:09         ` [PATCH v5 3/6] hexagon: " afzal mohammed
2020-03-27 16:10         ` [PATCH v5 4/6] sh: " afzal mohammed
2020-03-27 16:22           ` afzal mohammed
2020-03-27 16:10         ` [PATCH v5 5/6] unicore32: " afzal mohammed
2020-03-27 16:11         ` [PATCH v5 6/6] genirq: Remove setup_irq() and remove_irq() afzal mohammed
2020-04-11 14:10           ` afzal mohammed
2020-03-28  2:48         ` [PATCH 0/6] Kill setup_irq() Brian Cain
2020-03-28  2:48           ` Brian Cain
2020-03-28  2:48           ` Brian Cain
2020-03-28  2:48           ` Brian Cain
2020-03-28  2:48           ` Brian Cain
2020-03-28  7:32           ` afzal mohammed
2020-03-28  7:44             ` afzal mohammed
2020-03-28  7:32             ` afzal mohammed
2020-03-28  7:32             ` afzal mohammed
2020-04-02 15:03             ` Brian Cain
2020-04-02 15:03               ` Brian Cain
2020-04-02 15:03               ` Brian Cain
2020-04-02 15:03               ` Brian Cain
2020-04-02 15:03               ` Brian Cain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51f8ae7da9f47a23596388141933efa2bdef317b.1585320721.git.afzal.mohd.ma@gmail.com \
    --to=afzal.mohd.ma@gmail.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=rth@twiddle.net \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.