Skip to content

Commit 6fac824

Browse files
FlyGoatMarc Zyngier
authored andcommitted
irqchip/loongson-liointc: Use architecture register to get coreid
fa84f89 ("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: fa84f89 ("irqchip/loongson-liointc: Fix build error for LoongArch") Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220609175242.977-1-jiaxun.yang@flygoat.com
1 parent e3f056a commit 6fac824

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/irqchip/irq-loongson-liointc.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939

4040
#define LIOINTC_ERRATA_IRQ 10
4141

42+
#if defined(CONFIG_MIPS)
43+
#define liointc_core_id get_ebase_cpunum()
44+
#else
45+
#define liointc_core_id get_csr_cpuid()
46+
#endif
47+
4248
struct liointc_handler_data {
4349
struct liointc_priv *priv;
4450
u32 parent_int_map;
@@ -57,7 +63,7 @@ static void liointc_chained_handle_irq(struct irq_desc *desc)
5763
struct liointc_handler_data *handler = irq_desc_get_handler_data(desc);
5864
struct irq_chip *chip = irq_desc_get_chip(desc);
5965
struct irq_chip_generic *gc = handler->priv->gc;
60-
int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
66+
int core = liointc_core_id % LIOINTC_NUM_CORES;
6167
u32 pending;
6268

6369
chained_irq_enter(chip, desc);

0 commit comments

Comments
 (0)