Skip to content

Commit 2c81b07

Browse files
committed
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 <[email protected]> Cc: Arnd Bergmann <[email protected]>
1 parent 667b932 commit 2c81b07

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

arch/csky/include/asm/irq_work.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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 */

arch/csky/kernel/smp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/delay.h>
1313
#include <linux/err.h>
1414
#include <linux/irq.h>
15+
#include <linux/irq_work.h>
1516
#include <linux/irqdomain.h>
1617
#include <linux/of.h>
1718
#include <linux/sched/task_stack.h>
@@ -35,6 +36,7 @@ enum ipi_message_type {
3536
IPI_EMPTY,
3637
IPI_RESCHEDULE,
3738
IPI_CALL_FUNC,
39+
IPI_IRQ_WORK,
3840
IPI_MAX
3941
};
4042

@@ -53,6 +55,9 @@ static irqreturn_t handle_ipi(int irq, void *dev)
5355
if (ops & (1 << IPI_CALL_FUNC))
5456
generic_smp_call_function_interrupt();
5557

58+
if (ops & (1 << IPI_IRQ_WORK))
59+
irq_work_run();
60+
5661
BUG_ON((ops >> IPI_MAX) != 0);
5762
}
5863

@@ -108,6 +113,13 @@ void smp_send_reschedule(int cpu)
108113
send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE);
109114
}
110115

116+
#ifdef CONFIG_IRQ_WORK
117+
void arch_irq_work_raise(void)
118+
{
119+
send_ipi_message(cpumask_of(smp_processor_id()), IPI_IRQ_WORK);
120+
}
121+
#endif
122+
111123
void __init smp_prepare_boot_cpu(void)
112124
{
113125
}

0 commit comments

Comments
 (0)