LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v3] microblaze: Replace setup_irq() by request_irq()
@ 2020-03-04  0:49 afzal mohammed
  2020-03-09 11:43 ` Michal Simek
  0 siblings, 1 reply; 2+ messages in thread
From: afzal mohammed @ 2020-03-04  0:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: afzal mohammed, Michal Simek

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>
---
Hi microblaze maintainers,

if okay w/ this change, please consider taking it thr' your tree, else please
let me know.

Regards
afzal

Link to v2 & v1,
[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

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/microblaze/kernel/timer.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index a6683484b3a1..f8832cf49384 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -161,13 +161,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static struct irqaction timer_irqaction = {
-	.handler = timer_interrupt,
-	.flags = IRQF_TIMER,
-	.name = "timer",
-	.dev_id = &clockevent_xilinx_timer,
-};
-
 static __init int xilinx_clockevent_init(void)
 {
 	clockevent_xilinx_timer.mult =
@@ -309,7 +302,8 @@ static int __init xilinx_timer_init(struct device_node *timer)
 
 	freq_div_hz = timer_clock_freq / HZ;
 
-	ret = setup_irq(irq, &timer_irqaction);
+	ret = request_irq(irq, timer_interrupt, IRQF_TIMER, "timer",
+			  &clockevent_xilinx_timer);
 	if (ret) {
 		pr_err("Failed to setup IRQ");
 		return ret;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] microblaze: Replace setup_irq() by request_irq()
  2020-03-04  0:49 [PATCH v3] microblaze: Replace setup_irq() by request_irq() afzal mohammed
@ 2020-03-09 11:43 ` Michal Simek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2020-03-09 11:43 UTC (permalink / raw)
  To: afzal mohammed, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2654 bytes --]

On 04. 03. 20 1:49, afzal mohammed wrote:
> 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>
> ---
> Hi microblaze maintainers,
> 
> if okay w/ this change, please consider taking it thr' your tree, else please
> let me know.
> 
> Regards
> afzal
> 
> Link to v2 & v1,
> [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
> 
> 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/microblaze/kernel/timer.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
> index a6683484b3a1..f8832cf49384 100644
> --- a/arch/microblaze/kernel/timer.c
> +++ b/arch/microblaze/kernel/timer.c
> @@ -161,13 +161,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
>  	return IRQ_HANDLED;
>  }
>  
> -static struct irqaction timer_irqaction = {
> -	.handler = timer_interrupt,
> -	.flags = IRQF_TIMER,
> -	.name = "timer",
> -	.dev_id = &clockevent_xilinx_timer,
> -};
> -
>  static __init int xilinx_clockevent_init(void)
>  {
>  	clockevent_xilinx_timer.mult =
> @@ -309,7 +302,8 @@ static int __init xilinx_timer_init(struct device_node *timer)
>  
>  	freq_div_hz = timer_clock_freq / HZ;
>  
> -	ret = setup_irq(irq, &timer_irqaction);
> +	ret = request_irq(irq, timer_interrupt, IRQF_TIMER, "timer",
> +			  &clockevent_xilinx_timer);
>  	if (ret) {
>  		pr_err("Failed to setup IRQ");
>  		return ret;
> 


Applied.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-09 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  0:49 [PATCH v3] microblaze: Replace setup_irq() by request_irq() afzal mohammed
2020-03-09 11:43 ` Michal Simek

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).