From 2c81b0768297fb2fb4d2f39eac49a55f3598375b Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Thu, 30 Jul 2020 17:05:51 +0000 Subject: csky: Add irq_work support Running work in hardware interrupt context for csky. Implement: - arch_irq_work_raise() - arch_irq_work_has_interrupt() Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/csky/include/asm/irq_work.h | 11 +++++++++++ arch/csky/kernel/smp.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 arch/csky/include/asm/irq_work.h (limited to 'arch/csky') diff --git a/arch/csky/include/asm/irq_work.h b/arch/csky/include/asm/irq_work.h new file mode 100644 index 000000000000..33aaf39d6f94 --- /dev/null +++ b/arch/csky/include/asm/irq_work.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __ASM_CSKY_IRQ_WORK_H +#define __ASM_CSKY_IRQ_WORK_H + +static inline bool arch_irq_work_has_interrupt(void) +{ + return true; +} +extern void arch_irq_work_raise(void); +#endif /* __ASM_CSKY_IRQ_WORK_H */ diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c index 1945fb29007d..60f2ab1c5865 100644 --- a/arch/csky/kernel/smp.c +++ b/arch/csky/kernel/smp.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ enum ipi_message_type { IPI_EMPTY, IPI_RESCHEDULE, IPI_CALL_FUNC, + IPI_IRQ_WORK, IPI_MAX }; @@ -53,6 +55,9 @@ static irqreturn_t handle_ipi(int irq, void *dev) if (ops & (1 << IPI_CALL_FUNC)) generic_smp_call_function_interrupt(); + if (ops & (1 << IPI_IRQ_WORK)) + irq_work_run(); + BUG_ON((ops >> IPI_MAX) != 0); } @@ -108,6 +113,13 @@ void smp_send_reschedule(int cpu) send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE); } +#ifdef CONFIG_IRQ_WORK +void arch_irq_work_raise(void) +{ + send_ipi_message(cpumask_of(smp_processor_id()), IPI_IRQ_WORK); +} +#endif + void __init smp_prepare_boot_cpu(void) { } -- cgit v1.2.1