Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <guoren@linux.alibaba.com>
Cc: Arnd Bergmann <arnd@arndb.de>

Guo Ren 2c81b076 667b9324

+23
+11
arch/csky/include/asm/irq_work.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef __ASM_CSKY_IRQ_WORK_H 4 + #define __ASM_CSKY_IRQ_WORK_H 5 + 6 + static inline bool arch_irq_work_has_interrupt(void) 7 + { 8 + return true; 9 + } 10 + extern void arch_irq_work_raise(void); 11 + #endif /* __ASM_CSKY_IRQ_WORK_H */
+12
arch/csky/kernel/smp.c
··· 12 12 #include <linux/delay.h> 13 13 #include <linux/err.h> 14 14 #include <linux/irq.h> 15 + #include <linux/irq_work.h> 15 16 #include <linux/irqdomain.h> 16 17 #include <linux/of.h> 17 18 #include <linux/sched/task_stack.h> ··· 36 35 IPI_EMPTY, 37 36 IPI_RESCHEDULE, 38 37 IPI_CALL_FUNC, 38 + IPI_IRQ_WORK, 39 39 IPI_MAX 40 40 }; 41 41 ··· 54 52 55 53 if (ops & (1 << IPI_CALL_FUNC)) 56 54 generic_smp_call_function_interrupt(); 55 + 56 + if (ops & (1 << IPI_IRQ_WORK)) 57 + irq_work_run(); 57 58 58 59 BUG_ON((ops >> IPI_MAX) != 0); 59 60 } ··· 112 107 { 113 108 send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE); 114 109 } 110 + 111 + #ifdef CONFIG_IRQ_WORK 112 + void arch_irq_work_raise(void) 113 + { 114 + send_ipi_message(cpumask_of(smp_processor_id()), IPI_IRQ_WORK); 115 + } 116 + #endif 115 117 116 118 void __init smp_prepare_boot_cpu(void) 117 119 {