lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220819072239.60378-1-liyupeng@zbhlos.com>
Date:   Fri, 19 Aug 2022 15:22:39 +0800
From:   Yupeng Li <liyupeng@...los.com>
To:     chenhuacai@...nel.org, kernel@...0n.name, tglx@...utronix.de,
        maz@...nel.org
Cc:     loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Yupeng Li <liyupeng@...los.com>, Caicai <caizp2008@....com>
Subject: [PATCH 1/2] irqchip: Fixed LoongArch CPU interrupt types defined.

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@....com>
Signed-off-by: Yupeng Li <liyupeng@...los.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ