summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-08-04 04:23:13 -0400
committerPalmer Dabbelt <palmer@sifive.com>2018-08-13 11:31:30 -0400
commitb9d5535746e306a456691177228a08f04b923a7b (patch)
treee30a22b55379bd8019eee87c48d9b9f8bf9e1fc9
parentb9490350f751e5d17a24d0ae5af1f9e7f55c7c31 (diff)
RISC-V: simplify software interrupt / IPI code
Rename handle_ipi to riscv_software_interrupt, drop the unused return value and move the prototype to irq.h together with riscv_timer_interupt. This allows simplifying the upcoming interrupt handling support. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
-rw-r--r--arch/riscv/include/asm/irq.h1
-rw-r--r--arch/riscv/include/asm/smp.h3
-rw-r--r--arch/riscv/kernel/smp.c6
3 files changed, 3 insertions, 7 deletions
diff --git a/arch/riscv/include/asm/irq.h b/arch/riscv/include/asm/irq.h
index 4dee9d4c13c0..c871661c9df4 100644
--- a/arch/riscv/include/asm/irq.h
+++ b/arch/riscv/include/asm/irq.h
@@ -22,6 +22,7 @@
22#define INTERRUPT_CAUSE_EXTERNAL 9 22#define INTERRUPT_CAUSE_EXTERNAL 9
23 23
24void riscv_timer_interrupt(void); 24void riscv_timer_interrupt(void);
25void riscv_software_interrupt(void);
25 26
26#include <asm-generic/irq.h> 27#include <asm-generic/irq.h>
27 28
diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h
index 85e4220839b0..c9395fff246f 100644
--- a/arch/riscv/include/asm/smp.h
+++ b/arch/riscv/include/asm/smp.h
@@ -44,9 +44,6 @@ void arch_send_call_function_single_ipi(int cpu);
44 */ 44 */
45#define raw_smp_processor_id() (*((int*)((char*)get_current() + TASK_TI_CPU))) 45#define raw_smp_processor_id() (*((int*)((char*)get_current() + TASK_TI_CPU)))
46 46
47/* Interprocessor interrupt handler */
48irqreturn_t handle_ipi(void);
49
50#endif /* CONFIG_SMP */ 47#endif /* CONFIG_SMP */
51 48
52#endif /* _ASM_RISCV_SMP_H */ 49#endif /* _ASM_RISCV_SMP_H */
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index 6d3962435720..906fe21ea21b 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -45,7 +45,7 @@ int setup_profiling_timer(unsigned int multiplier)
45 return -EINVAL; 45 return -EINVAL;
46} 46}
47 47
48irqreturn_t handle_ipi(void) 48void riscv_software_interrupt(void)
49{ 49{
50 unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits; 50 unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
51 51
@@ -60,7 +60,7 @@ irqreturn_t handle_ipi(void)
60 60
61 ops = xchg(pending_ipis, 0); 61 ops = xchg(pending_ipis, 0);
62 if (ops == 0) 62 if (ops == 0)
63 return IRQ_HANDLED; 63 return;
64 64
65 if (ops & (1 << IPI_RESCHEDULE)) 65 if (ops & (1 << IPI_RESCHEDULE))
66 scheduler_ipi(); 66 scheduler_ipi();
@@ -73,8 +73,6 @@ irqreturn_t handle_ipi(void)
73 /* Order data access and bit testing. */ 73 /* Order data access and bit testing. */
74 mb(); 74 mb();
75 } 75 }
76
77 return IRQ_HANDLED;
78} 76}
79 77
80static void 78static void