linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: tglx@linutronix.de, palmer@sifive.com, jason@lakedaemon.net,
	marc.zyngier@arm.com, robh+dt@kernel.org, mark.rutland@arm.com
Cc: devicetree@vger.kernel.org, aou@eecs.berkeley.edu,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	shorne@gmail.com
Subject: [PATCH 1/6] RISC-V: simplify software interrupt / IPI code
Date: Wed, 25 Jul 2018 11:36:44 +0200	[thread overview]
Message-ID: <20180725093649.32332-2-hch@lst.de> (raw)
In-Reply-To: <20180725093649.32332-1-hch@lst.de>

Rename handle_ipi to riscv_software_interrupt, drop the unused return
value and provide a stub for the !SMP build.  This allows simplifying
the upcoming interrupt controller driver by not providing a wrapper
for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/riscv/include/asm/smp.h | 13 +++++++++++--
 arch/riscv/kernel/smp.c      |  6 ++----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h
index 85e4220839b0..80ecb957fe9f 100644
--- a/arch/riscv/include/asm/smp.h
+++ b/arch/riscv/include/asm/smp.h
@@ -44,8 +44,17 @@ void arch_send_call_function_single_ipi(int cpu);
  */
 #define raw_smp_processor_id() (*((int*)((char*)get_current() + TASK_TI_CPU)))
 
-/* Interprocessor interrupt handler */
-irqreturn_t handle_ipi(void);
+/* Software interrupt handler */
+void riscv_software_interrupt(void);
+
+#else /* CONFIG_SMP */
+
+/*
+ * We currently only use software interrupts to pass inter-processor
+ * interrupts, so if a non-SMP system gets a software interrupt then we
+ * don't know what to do.
+ */
+#define riscv_software_interrupt()	WARN_ON()
 
 #endif /* CONFIG_SMP */
 
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index 6d3962435720..906fe21ea21b 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -45,7 +45,7 @@ int setup_profiling_timer(unsigned int multiplier)
 	return -EINVAL;
 }
 
-irqreturn_t handle_ipi(void)
+void riscv_software_interrupt(void)
 {
 	unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
 
@@ -60,7 +60,7 @@ irqreturn_t handle_ipi(void)
 
 		ops = xchg(pending_ipis, 0);
 		if (ops == 0)
-			return IRQ_HANDLED;
+			return;
 
 		if (ops & (1 << IPI_RESCHEDULE))
 			scheduler_ipi();
@@ -73,8 +73,6 @@ irqreturn_t handle_ipi(void)
 		/* Order data access and bit testing. */
 		mb();
 	}
-
-	return IRQ_HANDLED;
 }
 
 static void
-- 
2.18.0


  reply	other threads:[~2018-07-25  9:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25  9:36 RISC-V irqchip drivers Christoph Hellwig
2018-07-25  9:36 ` Christoph Hellwig [this message]
2018-07-25 21:44   ` [PATCH 1/6] RISC-V: simplify software interrupt / IPI code Palmer Dabbelt
2018-07-26  8:10     ` Christoph Hellwig
2018-07-25  9:36 ` [PATCH 2/6] RISC-V: remove INTERRUPT_CAUSE_* defines from asm/irq.h Christoph Hellwig
2018-07-25 21:44   ` Palmer Dabbelt
2018-07-25  9:36 ` [PATCH 3/6] irqchip: RISC-V Local Interrupt Controller Driver Christoph Hellwig
2018-07-25 11:18   ` Marc Zyngier
2018-07-25 11:24     ` Christoph Hellwig
2018-07-25 11:37       ` Marc Zyngier
2018-07-25 17:54         ` Atish Patra
2018-07-26  3:38       ` Anup Patel
2018-07-26  8:27         ` Christoph Hellwig
2018-07-26 13:39           ` Anup Patel
2018-08-01 18:55       ` Thomas Gleixner
2018-08-02  7:34         ` Christoph Hellwig
2018-08-02  9:35           ` Thomas Gleixner
2018-08-02  9:43             ` Christoph Hellwig
2018-08-02  9:44               ` Thomas Gleixner
2018-08-04  4:03         ` Palmer Dabbelt
2018-08-04 16:40           ` Thomas Gleixner
2018-07-25  9:36 ` [PATCH 4/6] dt-bindings: interrupt-controller: RISC-V local interrupt controller docs Christoph Hellwig
2018-07-31 22:37   ` Rob Herring
2018-08-01  7:13     ` Christoph Hellwig
2018-08-01 18:14       ` Rob Herring
2018-07-25  9:36 ` [PATCH 5/6] irqchip: New RISC-V PLIC Driver Christoph Hellwig
2018-07-25  9:36 ` [PATCH 6/6] dt-bindings: interrupt-controller: RISC-V PLIC documentation Christoph Hellwig
2018-07-31 22:46   ` Rob Herring
2018-08-01  7:16     ` Christoph Hellwig
2018-08-01 18:26       ` Rob Herring
2018-08-02  9:55         ` Christoph Hellwig
2018-08-02 14:43           ` Rob Herring
2018-08-04  1:48         ` Palmer Dabbelt
2018-07-25 21:26 ` RISC-V irqchip drivers Palmer Dabbelt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180725093649.32332-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=aou@eecs.berkeley.edu \
    --cc=devicetree@vger.kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=palmer@sifive.com \
    --cc=robh+dt@kernel.org \
    --cc=shorne@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).