All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/2] irqchip: Adjust to fix build for LoongArch
@ 2022-05-31 16:32 Huacai Chen
  2022-05-31 16:32 ` [PATCH V2 1/2] irqchip: Adjust Kconfig for Loongson Huacai Chen
  2022-05-31 16:32 ` [PATCH V2 2/2] irqchip/loongson-liointc: Fix build error for LoongArch Huacai Chen
  0 siblings, 2 replies; 3+ messages in thread
From: Huacai Chen @ 2022-05-31 16:32 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: linux-kernel, Xuefeng Li, Huacai Chen, Jiaxun Yang, Huacai Chen

As suggested by Marc and Arnd, these two patches are the minimal changes
required on irqchip's side to make the LoongArch port build, without
introducing any non-reviewed pieces of code.

V1 -> V2:
Add a cover letter and fix commit message.

Huacai Chen:
 irqchip: Adjust Kconfig for Loongson.
 irqchip/loongson-liointc: Fix build error for LoongArch。

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
 drivers/irqchip/Kconfig                | 10 +++++-----
 drivers/irqchip/irq-loongson-liointc.c |  6 +++++-
 2 files changed, 10 insertions(+), 6 deletions(-)
--
2.27.0


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

* [PATCH V2 1/2] irqchip: Adjust Kconfig for Loongson
  2022-05-31 16:32 [PATCH V2 0/2] irqchip: Adjust to fix build for LoongArch Huacai Chen
@ 2022-05-31 16:32 ` Huacai Chen
  2022-05-31 16:32 ` [PATCH V2 2/2] irqchip/loongson-liointc: Fix build error for LoongArch Huacai Chen
  1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2022-05-31 16:32 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: linux-kernel, Xuefeng Li, Huacai Chen, Jiaxun Yang, Huacai Chen

HTVEC will be shared by both MIPS-based and LoongArch-based Loongson
processors (not only Loongson-3), so we adjust its description. HTPIC is
only used by MIPS-based Loongson, so we add a MIPS dependency. PCH_PIC
and PCH_MSI will have some arch-specific code, so we remove the COMPILE_
TEST dependency to avoid build warnings.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/irqchip/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 44fb8843e80e..8401ee7fd7fa 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -557,7 +557,7 @@ config LOONGSON_LIOINTC
 
 config LOONGSON_HTPIC
 	bool "Loongson3 HyperTransport PIC Controller"
-	depends on MACH_LOONGSON64
+	depends on (MACH_LOONGSON64 && MIPS)
 	default y
 	select IRQ_DOMAIN
 	select GENERIC_IRQ_CHIP
@@ -565,16 +565,16 @@ config LOONGSON_HTPIC
 	  Support for the Loongson-3 HyperTransport PIC Controller.
 
 config LOONGSON_HTVEC
-	bool "Loongson3 HyperTransport Interrupt Vector Controller"
+	bool "Loongson HyperTransport Interrupt Vector Controller"
 	depends on MACH_LOONGSON64
 	default MACH_LOONGSON64
 	select IRQ_DOMAIN_HIERARCHY
 	help
-	  Support for the Loongson3 HyperTransport Interrupt Vector Controller.
+	  Support for the Loongson HyperTransport Interrupt Vector Controller.
 
 config LOONGSON_PCH_PIC
 	bool "Loongson PCH PIC Controller"
-	depends on MACH_LOONGSON64 || COMPILE_TEST
+	depends on MACH_LOONGSON64
 	default MACH_LOONGSON64
 	select IRQ_DOMAIN_HIERARCHY
 	select IRQ_FASTEOI_HIERARCHY_HANDLERS
@@ -583,7 +583,7 @@ config LOONGSON_PCH_PIC
 
 config LOONGSON_PCH_MSI
 	bool "Loongson PCH MSI Controller"
-	depends on MACH_LOONGSON64 || COMPILE_TEST
+	depends on MACH_LOONGSON64
 	depends on PCI
 	default MACH_LOONGSON64
 	select IRQ_DOMAIN_HIERARCHY
-- 
2.27.0


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

* [PATCH V2 2/2] irqchip/loongson-liointc: Fix build error for LoongArch
  2022-05-31 16:32 [PATCH V2 0/2] irqchip: Adjust to fix build for LoongArch Huacai Chen
  2022-05-31 16:32 ` [PATCH V2 1/2] irqchip: Adjust Kconfig for Loongson Huacai Chen
@ 2022-05-31 16:32 ` Huacai Chen
  1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2022-05-31 16:32 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: linux-kernel, Xuefeng Li, Huacai Chen, Jiaxun Yang, 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 <chenhuacai@loongson.cn>
---
 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


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

end of thread, other threads:[~2022-05-31 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31 16:32 [PATCH V2 0/2] irqchip: Adjust to fix build for LoongArch Huacai Chen
2022-05-31 16:32 ` [PATCH V2 1/2] irqchip: Adjust Kconfig for Loongson Huacai Chen
2022-05-31 16:32 ` [PATCH V2 2/2] irqchip/loongson-liointc: Fix build error for LoongArch Huacai Chen

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.