File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0 */
2
+ #ifndef _ASM_RISCV_IRQ_WORK_H
3
+ #define _ASM_RISCV_IRQ_WORK_H
4
+
5
+ static inline bool arch_irq_work_has_interrupt (void )
6
+ {
7
+ return true;
8
+ }
9
+ extern void arch_irq_work_raise (void );
10
+ #endif /* _ASM_RISCV_IRQ_WORK_H */
Original file line number Diff line number Diff line change 16
16
#include <linux/sched.h>
17
17
#include <linux/seq_file.h>
18
18
#include <linux/delay.h>
19
+ #include <linux/irq_work.h>
19
20
20
21
#include <asm/clint.h>
21
22
#include <asm/sbi.h>
@@ -26,6 +27,7 @@ enum ipi_message_type {
26
27
IPI_RESCHEDULE ,
27
28
IPI_CALL_FUNC ,
28
29
IPI_CPU_STOP ,
30
+ IPI_IRQ_WORK ,
29
31
IPI_MAX
30
32
};
31
33
@@ -123,6 +125,13 @@ static inline void clear_ipi(void)
123
125
clint_clear_ipi (cpuid_to_hartid_map (smp_processor_id ()));
124
126
}
125
127
128
+ #ifdef CONFIG_IRQ_WORK
129
+ void arch_irq_work_raise (void )
130
+ {
131
+ send_ipi_single (smp_processor_id (), IPI_IRQ_WORK );
132
+ }
133
+ #endif
134
+
126
135
void handle_IPI (struct pt_regs * regs )
127
136
{
128
137
struct pt_regs * old_regs = set_irq_regs (regs );
@@ -158,6 +167,11 @@ void handle_IPI(struct pt_regs *regs)
158
167
ipi_stop ();
159
168
}
160
169
170
+ if (ops & (1 << IPI_IRQ_WORK )) {
171
+ stats [IPI_IRQ_WORK ]++ ;
172
+ irq_work_run ();
173
+ }
174
+
161
175
BUG_ON ((ops >> IPI_MAX ) != 0 );
162
176
163
177
/* Order data access and bit testing. */
@@ -173,6 +187,7 @@ static const char * const ipi_names[] = {
173
187
[IPI_RESCHEDULE ] = "Rescheduling interrupts" ,
174
188
[IPI_CALL_FUNC ] = "Function call interrupts" ,
175
189
[IPI_CPU_STOP ] = "CPU stop interrupts" ,
190
+ [IPI_IRQ_WORK ] = "IRQ work interrupts" ,
176
191
};
177
192
178
193
void show_ipi_stats (struct seq_file * p , int prec )
You can’t perform that action at this time.
0 commit comments