public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Jianmin Lv <lvjianmin@loongson.cn>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
	Hanjun Guo <guohanjun@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Huacai Chen <chenhuacai@loongson.cn>
Subject: Re: [PATCH V15 00/15] irqchip: Add LoongArch-related irqchip drivers
Date: Sun, 17 Jul 2022 11:02:51 +0100	[thread overview]
Message-ID: <87ilnw3vlg.wl-maz@kernel.org> (raw)
In-Reply-To: <6e9def1e-31fe-787d-1b2b-a328424352f0@loongson.cn>

On Sun, 17 Jul 2022 02:06:12 +0100,
Jianmin Lv <lvjianmin@loongson.cn> wrote:
> 
> 
> 
> On 2022/7/17 上午2:39, Marc Zyngier wrote:
> > On Fri, 15 Jul 2022 08:05:36 +0100,
> > Jianmin Lv <lvjianmin@loongson.cn> wrote:
> >> 
> >> LoongArch is a new RISC ISA, which is a bit like MIPS or RISC-V.
> >> LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit
> >> version (LA32S) and a 64-bit version (LA64). LoongArch use ACPI as its
> >> boot protocol LoongArch-specific interrupt controllers (similar to APIC)
> >> are already added in the ACPI Specification 6.5(which may be published in
> >> early June this year and the board is reviewing the draft).
> >> 
> >> Currently, LoongArch based processors (e.g. Loongson-3A5000) can only
> >> work together with LS7A chipsets. The irq chips in LoongArch computers
> >> include CPUINTC (CPU Core Interrupt Controller), LIOINTC (Legacy I/O
> >> Interrupt Controller), EIOINTC (Extended I/O Interrupt Controller),
> >> HTVECINTC (Hyper-Transport Vector Interrupt Controller), PCH-PIC (Main
> >> Interrupt Controller in LS7A chipset), PCH-LPC (LPC Interrupt Controller
> >> in LS7A chipset) and PCH-MSI (MSI Interrupt Controller).
> > 
> > [...]
> > 
> > Compiling this series for loongarch with loongson3_defconfig on top of
> > 5.19-rc3 results in the following:
> > 
> > loongarch64-linux-ld: drivers/irqchip/irq-loongson-eiointc.o: in function `.L60':
> > irq-loongson-eiointc.c:(.init.text+0x4c): undefined reference to `pch_msi_acpi_init'
> > loongarch64-linux-ld: drivers/irqchip/irq-loongson-htvec.o: in function `pch_msi_parse_madt':
> > irq-loongson-htvec.c:(.init.text+0x14): undefined reference to `pch_msi_acpi_init'
> > make: *** [Makefile:1164: vmlinux] Error 1
> > 
> > I *really* would have expected this series to be in a better shape
> > after over 15 rounds, but it looks like I'm expecting too much. I
> > haven't investigated the breakage, but this should (at the very least)
> > pass the defconfig test and optional drivers not being selected.
> > 
> > The corresponding MIPS configuration seems to build fine.
> > 
> > 	M.
> > 
> 
> Hi, Marc
> 
> Sorry for that first, pch_msi_acpi_init is defined in pch_msi driver
> which is compiled depend on CONFIG_PCI, and I test the patches each
> time with PCI patches and other(or else, kernel can not be boot), so
> I'm ok for testing the patches. The PCI patches has been accepted by
> PCI maintainers and will be merged in this merge window.

But each series *must* at the very least compile in isolation.

> 
> I don't know how to deal with this situation. Should I add *#ifdef
> CONFIG_PCI* at position of calling pch_msi_acpi_init or some other
> way?

You could try something like this, which results in a kernel that
fully links with defconfig and no additional patch:

diff --git a/arch/loongarch/include/asm/irq.h b/arch/loongarch/include/asm/irq.h
index ca468564fc85..4479d95867ec 100644
--- a/arch/loongarch/include/asm/irq.h
+++ b/arch/loongarch/include/asm/irq.h
@@ -99,8 +99,17 @@ int htvec_acpi_init(struct irq_domain *parent,
 					struct acpi_madt_ht_pic *acpi_htvec);
 int pch_lpc_acpi_init(struct irq_domain *parent,
 					struct acpi_madt_lpc_pic *acpi_pchlpc);
+#if IS_ENABLED(CONFIG_LOONGSON_PCH_MSI)
 int pch_msi_acpi_init(struct irq_domain *parent,
-					struct acpi_madt_msi_pic *acpi_pchmsi);
+		      struct acpi_madt_msi_pic *acpi_pchmsi);
+#else
+static inline int pch_msi_acpi_init(struct irq_domain *parent,
+				    struct acpi_madt_msi_pic *acpi_pchmsi)
+{
+	return 0;
+
+}
+#endif
 int pch_pic_acpi_init(struct irq_domain *parent,
 					struct acpi_madt_bio_pic *acpi_pchpic);
 int find_pch_pic(u32 gsi);

But the other issue is that you seem to call this function from two
different locations. This cannot be right, as there should be only one
probe order, and not multiple.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2022-07-17 10:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  7:05 [PATCH V15 00/15] irqchip: Add LoongArch-related irqchip drivers Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 01/15] ACPICA: MADT: Add LoongArch APICs support Jianmin Lv
2022-07-16 18:10   ` Marc Zyngier
2022-07-17  1:05     ` Jianmin Lv
2022-07-18 12:28     ` Jianmin Lv
2022-07-18 13:26       ` Marc Zyngier
2022-07-15  7:05 ` [PATCH V15 02/15] APCI: irq: Add support for multiple GSI domains Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 03/15] ACPI: irq: Allow acpi_gsi_to_irq() to have an arch-specific fallback Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 04/15] genirq/generic_chip: export irq_unmap_generic_chip Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 05/15] LoongArch: Use ACPI_GENERIC_GSI for gsi handling Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 06/15] irqchip: Add Loongson PCH LPC controller support Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 07/15] irqchip: remove COMPILE_TEST for pch-pic and pch-msi Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 08/15] irqchip/loongson-pch-pic: Add ACPI init support Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 09/15] irqchip/loongson-pch-msi: " Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 10/15] irqchip/loongson-htvec: " Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 11/15] irqchip/loongson-liointc: " Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 12/15] LoongArch: prepare to support multiple pch-pic and pch-msi irqdomain Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 13/15] irqchip: Add Loongson Extended I/O interrupt controller support Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 14/15] irqchip: Add LoongArch CPU " Jianmin Lv
2022-07-15 15:11   ` Huacai Chen
2022-07-17 12:02     ` Jianmin Lv
2022-07-15  7:05 ` [PATCH V15 15/15] irqchip / ACPI: Introduce ACPI_IRQ_MODEL_LPIC for LoongArch Jianmin Lv
2022-07-16 18:39 ` [PATCH V15 00/15] irqchip: Add LoongArch-related irqchip drivers Marc Zyngier
2022-07-17  1:06   ` Jianmin Lv
2022-07-17 10:02     ` Marc Zyngier [this message]
2022-07-17 11:29       ` Jianmin Lv
2022-07-17 14:08         ` Huacai Chen
2022-07-17 14:43           ` Marc Zyngier
2022-07-18  2:38             ` Huacai Chen
2022-07-18  6:43               ` Marc Zyngier
2022-07-18  8:35                 ` Huacai Chen
2022-07-17 14:49         ` Marc Zyngier
2022-07-18  1:07           ` Jianmin Lv
2022-07-18  6:39             ` Marc Zyngier
2022-07-18  8:29               ` Jianmin Lv
2022-07-18  8:39                 ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilnw3vlg.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=guohanjun@huawei.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lvjianmin@loongson.cn \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox