All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-5.19 v2 1/2] irqchip/loongson-liointc: Use architecture register to get coreid
@ 2022-06-09 17:52 Jiaxun Yang
  2022-06-09 17:52 ` [PATCH for-5.19 v2 2/2] loongarch: Mask out higher bits for cpuid and rename the function Jiaxun Yang
  2022-06-10  8:04 ` [irqchip: irq/irqchip-fixes] irqchip/loongson-liointc: Use architecture register to get coreid irqchip-bot for Jiaxun Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Jiaxun Yang @ 2022-06-09 17:52 UTC (permalink / raw)
  To: chenhuacai; +Cc: kernel, maz, linux-kernel, Jiaxun Yang

fa84f89395e0 ("irqchip/loongson-liointc: Fix build error for
LoongArch") replaced get_ebase_cpunum with physical processor
id from SMP facilities. However that breaks MIPS non-SMP build
and makes booting from other cores inpossible on non-SMP kernel.

Thus we revert get_ebase_cpunum back and use get_csr_cpuid for
LoongArch.

Fixes: fa84f89395e0 ("irqchip/loongson-liointc: Fix build error for LoongArch")
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 drivers/irqchip/irq-loongson-liointc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index aed88857d90f..8d05d8bcf56f 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -39,6 +39,12 @@
 
 #define LIOINTC_ERRATA_IRQ	10
 
+#if defined(CONFIG_MIPS)
+#define liointc_core_id get_ebase_cpunum()
+#else
+#define liointc_core_id get_csr_cpuid()
+#endif
+
 struct liointc_handler_data {
 	struct liointc_priv	*priv;
 	u32			parent_int_map;
@@ -57,7 +63,7 @@ static void liointc_chained_handle_irq(struct irq_desc *desc)
 	struct liointc_handler_data *handler = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct irq_chip_generic *gc = handler->priv->gc;
-	int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
+	int core = liointc_core_id % LIOINTC_NUM_CORES;
 	u32 pending;
 
 	chained_irq_enter(chip, desc);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-10  8:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-09 17:52 [PATCH for-5.19 v2 1/2] irqchip/loongson-liointc: Use architecture register to get coreid Jiaxun Yang
2022-06-09 17:52 ` [PATCH for-5.19 v2 2/2] loongarch: Mask out higher bits for cpuid and rename the function Jiaxun Yang
2022-06-10  8:02   ` Marc Zyngier
2022-06-10  8:04 ` [irqchip: irq/irqchip-fixes] irqchip/loongson-liointc: Use architecture register to get coreid irqchip-bot for Jiaxun Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.