* [PATCH 1/2] irqchip: Fixed LoongArch CPU interrupt types defined.
@ 2022-08-19 7:22 Yupeng Li
2022-08-19 8:39 ` Huacai Chen
0 siblings, 1 reply; 2+ messages in thread
From: Yupeng Li @ 2022-08-19 7:22 UTC (permalink / raw)
To: chenhuacai, kernel, tglx, maz; +Cc: loongarch, linux-kernel, Yupeng Li, Caicai
When CONFIG_LOONGSON_LIOINTC,CONFIG_LOONGSON_EIOINTC,
CONFIG_LOONGSON_PCH_LPC,CONFIG_LOONGSON_PCH_PIC was disabled,
build kernel with errors like:
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo
GEN modules.builtin
LD .tmp_vmlinux.kallsyms1
loongarch64-linux-gnu-ld: drivers/irqchip/irq-loongarch-cpu.o: in function `lpic_get_gsi_domain_id':
irq-loongarch-cpu.c:(.text+0x8): undefined reference to `pch_lpc_handle'
loongarch64-linux-gnu-ld: irq-loongarch-cpu.c:(.text+0xc): undefined reference to `pch_lpc_handle'
loongarch64-linux-gnu-ld: irq-loongarch-cpu.c:(.text+0xc): undefined reference to `pch_lpc_handle'
make: *** [Makefile:1171:vmlinux] 错误 1
Reviewed-by: Caicai <caizp2008@163.com>
Signed-off-by: Yupeng Li <liyupeng@zbhlos.com>
---
drivers/irqchip/irq-loongarch-cpu.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c
index 327f3ab62c03..d296f704cbb6 100644
--- a/drivers/irqchip/irq-loongarch-cpu.c
+++ b/drivers/irqchip/irq-loongarch-cpu.c
@@ -27,24 +27,30 @@ static u32 lpic_gsi_to_irq(u32 gsi)
static struct fwnode_handle *lpic_get_gsi_domain_id(u32 gsi)
{
+#ifdef CONFIG_LOONGSON_PCH_PIC
int id;
+#endif
struct fwnode_handle *domain_handle = NULL;
switch (gsi) {
case GSI_MIN_CPU_IRQ ... GSI_MAX_CPU_IRQ:
+#ifdef CONFIG_LOONGSON_LIOINTC
if (liointc_handle)
domain_handle = liointc_handle;
+#endif
break;
-
case GSI_MIN_LPC_IRQ ... GSI_MAX_LPC_IRQ:
+#ifdef CONFIG_LOONGSON_PCH_LPC
if (pch_lpc_handle)
domain_handle = pch_lpc_handle;
+#endif
break;
-
case GSI_MIN_PCH_IRQ ... GSI_MAX_PCH_IRQ:
+#ifdef CONFIG_LOONGSON_PCH_PIC
id = find_pch_pic(gsi);
if (id >= 0 && pch_pic_handle[id])
domain_handle = pch_pic_handle[id];
+#endif
break;
}
@@ -92,6 +98,7 @@ static const struct irq_domain_ops loongarch_cpu_intc_irq_domain_ops = {
.xlate = irq_domain_xlate_onecell,
};
+#ifdef CONFIG_LOONGSON_LIOINTC
static int __init
liointc_parse_madt(union acpi_subtable_headers *header,
const unsigned long end)
@@ -100,7 +107,8 @@ liointc_parse_madt(union acpi_subtable_headers *header,
return liointc_acpi_init(irq_domain, liointc_entry);
}
-
+#endif
+#ifdef CONFIG_LOONGSON_EIOINTC
static int __init
eiointc_parse_madt(union acpi_subtable_headers *header,
const unsigned long end)
@@ -109,13 +117,17 @@ eiointc_parse_madt(union acpi_subtable_headers *header,
return eiointc_acpi_init(irq_domain, eiointc_entry);
}
-
+#endif
static int __init acpi_cascade_irqdomain_init(void)
{
+#ifdef CONFIG_LOONGSON_LIOINTC
acpi_table_parse_madt(ACPI_MADT_TYPE_LIO_PIC,
liointc_parse_madt, 0);
+#endif
+#ifdef CONFIG_LOONGSON_EIOINTC
acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC,
eiointc_parse_madt, 0);
+#endif
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] irqchip: Fixed LoongArch CPU interrupt types defined.
2022-08-19 7:22 [PATCH 1/2] irqchip: Fixed LoongArch CPU interrupt types defined Yupeng Li
@ 2022-08-19 8:39 ` Huacai Chen
0 siblings, 0 replies; 2+ messages in thread
From: Huacai Chen @ 2022-08-19 8:39 UTC (permalink / raw)
To: Yupeng Li
Cc: WANG Xuerui, Thomas Gleixner, Marc Zyngier, loongarch, LKML, Caicai
Hi, Yupeng,
This errors can be fixed once this patch be merged:
https://lore.kernel.org/lkml/20220808085319.3350111-1-chenhuacai@loongson.cn/
Huacai
On Fri, Aug 19, 2022 at 3:23 PM Yupeng Li <liyupeng@zbhlos.com> wrote:
>
> When CONFIG_LOONGSON_LIOINTC,CONFIG_LOONGSON_EIOINTC,
> CONFIG_LOONGSON_PCH_LPC,CONFIG_LOONGSON_PCH_PIC was disabled,
> build kernel with errors like:
>
> MODPOST vmlinux.symvers
> MODINFO modules.builtin.modinfo
> GEN modules.builtin
> LD .tmp_vmlinux.kallsyms1
> loongarch64-linux-gnu-ld: drivers/irqchip/irq-loongarch-cpu.o: in function `lpic_get_gsi_domain_id':
> irq-loongarch-cpu.c:(.text+0x8): undefined reference to `pch_lpc_handle'
> loongarch64-linux-gnu-ld: irq-loongarch-cpu.c:(.text+0xc): undefined reference to `pch_lpc_handle'
> loongarch64-linux-gnu-ld: irq-loongarch-cpu.c:(.text+0xc): undefined reference to `pch_lpc_handle'
> make: *** [Makefile:1171:vmlinux] 错误 1
>
> Reviewed-by: Caicai <caizp2008@163.com>
> Signed-off-by: Yupeng Li <liyupeng@zbhlos.com>
> ---
> drivers/irqchip/irq-loongarch-cpu.c | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c
> index 327f3ab62c03..d296f704cbb6 100644
> --- a/drivers/irqchip/irq-loongarch-cpu.c
> +++ b/drivers/irqchip/irq-loongarch-cpu.c
> @@ -27,24 +27,30 @@ static u32 lpic_gsi_to_irq(u32 gsi)
>
> static struct fwnode_handle *lpic_get_gsi_domain_id(u32 gsi)
> {
> +#ifdef CONFIG_LOONGSON_PCH_PIC
> int id;
> +#endif
> struct fwnode_handle *domain_handle = NULL;
>
> switch (gsi) {
> case GSI_MIN_CPU_IRQ ... GSI_MAX_CPU_IRQ:
> +#ifdef CONFIG_LOONGSON_LIOINTC
> if (liointc_handle)
> domain_handle = liointc_handle;
> +#endif
> break;
> -
> case GSI_MIN_LPC_IRQ ... GSI_MAX_LPC_IRQ:
> +#ifdef CONFIG_LOONGSON_PCH_LPC
> if (pch_lpc_handle)
> domain_handle = pch_lpc_handle;
> +#endif
> break;
> -
> case GSI_MIN_PCH_IRQ ... GSI_MAX_PCH_IRQ:
> +#ifdef CONFIG_LOONGSON_PCH_PIC
> id = find_pch_pic(gsi);
> if (id >= 0 && pch_pic_handle[id])
> domain_handle = pch_pic_handle[id];
> +#endif
> break;
> }
>
> @@ -92,6 +98,7 @@ static const struct irq_domain_ops loongarch_cpu_intc_irq_domain_ops = {
> .xlate = irq_domain_xlate_onecell,
> };
>
> +#ifdef CONFIG_LOONGSON_LIOINTC
> static int __init
> liointc_parse_madt(union acpi_subtable_headers *header,
> const unsigned long end)
> @@ -100,7 +107,8 @@ liointc_parse_madt(union acpi_subtable_headers *header,
>
> return liointc_acpi_init(irq_domain, liointc_entry);
> }
> -
> +#endif
> +#ifdef CONFIG_LOONGSON_EIOINTC
> static int __init
> eiointc_parse_madt(union acpi_subtable_headers *header,
> const unsigned long end)
> @@ -109,13 +117,17 @@ eiointc_parse_madt(union acpi_subtable_headers *header,
>
> return eiointc_acpi_init(irq_domain, eiointc_entry);
> }
> -
> +#endif
> static int __init acpi_cascade_irqdomain_init(void)
> {
> +#ifdef CONFIG_LOONGSON_LIOINTC
> acpi_table_parse_madt(ACPI_MADT_TYPE_LIO_PIC,
> liointc_parse_madt, 0);
> +#endif
> +#ifdef CONFIG_LOONGSON_EIOINTC
> acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC,
> eiointc_parse_madt, 0);
> +#endif
> return 0;
> }
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-19 8:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 7:22 [PATCH 1/2] irqchip: Fixed LoongArch CPU interrupt types defined Yupeng Li
2022-08-19 8:39 ` Huacai Chen
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).