[PATCH] ARC: Support arch_irq_work_raise() via self IPIs

From: Noam Camus
Date: Sat Jun 20 2015 - 18:41:22 EST


This will allow the scheduler tick to be restarted.
It is used if CONFIG_NO_HZ_FULL.

Signed-off-by: Gil Fruchter <gilf@xxxxxxxxxx>
Signed-off-by: Noam Camus <noamc@xxxxxxxxxx>
Signed-off-by: Vineet Gupta <vgupta@xxxxxxxxxxxx>
---
arch/arc/include/asm/Kbuild | 1 -
arch/arc/include/asm/irq_work.h | 8 ++++++++
arch/arc/kernel/smp.c | 16 ++++++++++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 arch/arc/include/asm/irq_work.h

diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild
index 0b10ef2a4372..f83ec8c04feb 100644
--- a/arch/arc/include/asm/Kbuild
+++ b/arch/arc/include/asm/Kbuild
@@ -16,7 +16,6 @@ generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += irq_regs.h
-generic-y += irq_work.h
generic-y += kmap_types.h
generic-y += kvm_para.h
generic-y += local.h
diff --git a/arch/arc/include/asm/irq_work.h b/arch/arc/include/asm/irq_work.h
new file mode 100644
index 000000000000..40d015199ced
--- /dev/null
+++ b/arch/arc/include/asm/irq_work.h
@@ -0,0 +1,8 @@
+#ifndef _ASM_ARC_IRQ_WORK_H
+#define _ASM_ARC_IRQ_WORK_H
+static inline bool arch_irq_work_has_interrupt(void)
+{
+ return true;
+}
+
+#endif /* _ASM_ARC_IRQ_WORK_H */
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index f2cf58b771b2..c2f49db57265 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -22,6 +22,7 @@
#include <linux/atomic.h>
#include <linux/cpumask.h>
#include <linux/reboot.h>
+#include <linux/irq_work.h>
#include <asm/processor.h>
#include <asm/setup.h>
#include <asm/mach_desc.h>
@@ -202,6 +203,7 @@ enum ipi_msg_type {
IPI_RESCHEDULE = 1,
IPI_CALL_FUNC,
IPI_CPU_STOP,
+ IPI_IRQ_WORK,
};

/*
@@ -276,6 +278,14 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
ipi_send_msg(mask, IPI_CALL_FUNC);
}

+#ifdef CONFIG_IRQ_WORK
+void arch_irq_work_raise(void)
+{
+ if (arch_irq_work_has_interrupt())
+ ipi_send_msg_one(smp_processor_id(), IPI_IRQ_WORK);
+}
+#endif
+
/*
* ipi_cpu_stop - handle IPI from smp_send_stop()
*/
@@ -301,6 +311,12 @@ static inline int __do_IPI(unsigned long msg)
ipi_cpu_stop();
break;

+#ifdef CONFIG_IRQ_WORK
+ case IPI_IRQ_WORK:
+ irq_work_run();
+ break;
+#endif
+
default:
rc = 1;
}
--
2.7.4


--------------A6EDCCA24E1B6C74A98DDA9A--