2022-06-01 18:45:54

by Huacai Chen

[permalink] [raw]
Subject: [PATCH V12 02/24] irqchip/loongson-liointc: Fix build error for LoongArch

liointc driver is shared by MIPS and LoongArch, this patch adjust the
code to fix build error for LoongArch.

Signed-off-by: Huacai Chen <[email protected]>
---
drivers/irqchip/irq-loongson-liointc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index 649c58391618..aed88857d90f 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -16,7 +16,11 @@
#include <linux/smp.h>
#include <linux/irqchip/chained_irq.h>

+#ifdef CONFIG_MIPS
#include <loongson.h>
+#else
+#include <asm/loongson.h>
+#endif

#define LIOINTC_CHIP_IRQ 32
#define LIOINTC_NUM_PARENT 4
@@ -53,7 +57,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 = get_ebase_cpunum() % LIOINTC_NUM_CORES;
+ int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
u32 pending;

chained_irq_enter(chip, desc);
--
2.27.0



2022-06-01 20:43:43

by Jiaxun Yang

[permalink] [raw]
Subject: Re: [PATCH V12 02/24] irqchip/loongson-liointc: Fix build error for LoongArch



在2022年6月1日六月 上午10:59,Huacai Chen写道:
> liointc driver is shared by MIPS and LoongArch, this patch adjust the
> code to fix build error for LoongArch.
>
> Signed-off-by: Huacai Chen <[email protected]>

Reviewed-by: Jiaxun Yang <[email protected]>

> ---
> drivers/irqchip/irq-loongson-liointc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-loongson-liointc.c
> b/drivers/irqchip/irq-loongson-liointc.c
> index 649c58391618..aed88857d90f 100644
> --- a/drivers/irqchip/irq-loongson-liointc.c
> +++ b/drivers/irqchip/irq-loongson-liointc.c
> @@ -16,7 +16,11 @@
> #include <linux/smp.h>
> #include <linux/irqchip/chained_irq.h>
>
> +#ifdef CONFIG_MIPS
> #include <loongson.h>
> +#else
> +#include <asm/loongson.h>
> +#endif
>
> #define LIOINTC_CHIP_IRQ 32
> #define LIOINTC_NUM_PARENT 4
> @@ -53,7 +57,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 = get_ebase_cpunum() % LIOINTC_NUM_CORES;
> + int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
> u32 pending;
>
> chained_irq_enter(chip, desc);
> --
> 2.27.0

--
- Jiaxun

2022-06-01 21:12:39

by WANG Xuerui

[permalink] [raw]
Subject: Re: [PATCH V12 02/24] irqchip/loongson-liointc: Fix build error for LoongArch

On 6/1/22 17:59, Huacai Chen wrote:
> liointc driver is shared by MIPS and LoongArch, this patch adjust the
> code to fix build error for LoongArch.
>
> Signed-off-by: Huacai Chen <[email protected]>
> ---
> drivers/irqchip/irq-loongson-liointc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
> index 649c58391618..aed88857d90f 100644
> --- a/drivers/irqchip/irq-loongson-liointc.c
> +++ b/drivers/irqchip/irq-loongson-liointc.c
> @@ -16,7 +16,11 @@
> #include <linux/smp.h>
> #include <linux/irqchip/chained_irq.h>
>
> +#ifdef CONFIG_MIPS
> #include <loongson.h>
> +#else
> +#include <asm/loongson.h>
> +#endif
>
> #define LIOINTC_CHIP_IRQ 32
> #define LIOINTC_NUM_PARENT 4
> @@ -53,7 +57,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 = get_ebase_cpunum() % LIOINTC_NUM_CORES;
> + int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
> u32 pending;
>
> chained_irq_enter(chip, desc);

Trivial enough.

Reviewed-by: WANG Xuerui <[email protected]>