lkml.org 
[lkml]   [2019]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 4/8] powerpc/irq: move set_irq_regs() closer to irq_enter/exit()
Date
set_irq_regs() is called by do_IRQ() while irq_enter() and irq_exit()
are called by __do_irq().

Move set_irq_regs() in __do_irq()

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/kernel/irq.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 410accba865d..28414c6665cc 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -647,6 +647,7 @@ static inline void call_do_irq(struct pt_regs *regs, void *sp)

void __do_irq(struct pt_regs *regs)
{
+ struct pt_regs *old_regs = set_irq_regs(regs);
unsigned int irq;

irq_enter();
@@ -672,11 +673,11 @@ void __do_irq(struct pt_regs *regs)
trace_irq_exit(regs);

irq_exit();
+ set_irq_regs(old_regs);
}

void do_IRQ(struct pt_regs *regs)
{
- struct pt_regs *old_regs = set_irq_regs(regs);
void *cursp, *irqsp, *sirqsp;

/* Switch to the irq stack to handle this */
@@ -686,16 +687,11 @@ void do_IRQ(struct pt_regs *regs)

check_stack_overflow();

- /* Already there ? */
- if (unlikely(cursp == irqsp || cursp == sirqsp)) {
+ /* Already there ? Otherwise switch stack and call */
+ if (unlikely(cursp == irqsp || cursp == sirqsp))
__do_irq(regs);
- set_irq_regs(old_regs);
- return;
- }
- /* Switch stack and call */
- call_do_irq(regs, irqsp);
-
- set_irq_regs(old_regs);
+ else
+ call_do_irq(regs, irqsp);
}

void __init init_IRQ(void)
--
2.13.3
\
 
 \ /
  Last update: 2019-12-23 16:26    [W:0.044 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site