mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v11 6/7] irqchip/loongson-pch-msi: Prepare get_pch_msi_handle() for AVECINTC
@ 2024-08-23 10:43 Tianyang Zhang
  2024-08-23 10:43 ` [PATCH v11 7/7] irqchip/loongarch-avec: Add AVEC irqchip support Tianyang Zhang
  2024-08-23 18:45 ` [tip: irq/core] irqchip/loongson-pch-msi: Prepare get_pch_msi_handle() for AVECINTC tip-bot2 for Tianyang Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Tianyang Zhang @ 2024-08-23 10:43 UTC (permalink / raw)
  To: corbet, alexs, chenhuacai, kernel, tglx, jiaxun.yang, gaoliang,
	wangliupu, lvjianmin, zhangtianyang, yijun, mhocko, akpm,
	dianders, maobibo, xry111, zhaotianrui, nathan, yangtiezhu,
	zhoubinbin
  Cc: loongarch, linux-doc, linux-kernel, Huacai Chen

On Loongson-3C6000 and higher systems with AVECINTC irqchip, there may
be multiple PCI segments, but only one PCH-MSI irq domain. In this case,
let get_pch_msi_handle() return the first domain handle.

Co-developed-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Co-developed-by: Liupu Wang <wangliupu@loongson.cn>
Signed-off-by: Liupu Wang <wangliupu@loongson.cn>
Co-developed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
---
 drivers/irqchip/irq-loongson-pch-msi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/irqchip/irq-loongson-pch-msi.c b/drivers/irqchip/irq-loongson-pch-msi.c
index d43731878800..0dc14550791d 100644
--- a/drivers/irqchip/irq-loongson-pch-msi.c
+++ b/drivers/irqchip/irq-loongson-pch-msi.c
@@ -255,17 +255,17 @@ IRQCHIP_DECLARE(pch_msi, "loongson,pch-msi-1.0", pch_msi_of_init);
 #ifdef CONFIG_ACPI
 struct fwnode_handle *get_pch_msi_handle(int pci_segment)
 {
-	int i;
+	if (cpu_has_avecint)
+		return pch_msi_handle[0];
 
-	for (i = 0; i < MAX_IO_PICS; i++) {
+	for (int i = 0; i < MAX_IO_PICS; i++) {
 		if (msi_group[i].pci_segment == pci_segment)
 			return pch_msi_handle[i];
 	}
-	return NULL;
+	return pch_msi_handle[0];
 }
 
-int __init pch_msi_acpi_init(struct irq_domain *parent,
-					struct acpi_madt_msi_pic *acpi_pchmsi)
+int __init pch_msi_acpi_init(struct irq_domain *parent, struct acpi_madt_msi_pic *acpi_pchmsi)
 {
 	int ret;
 	struct fwnode_handle *domain_handle;
-- 
2.20.1


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

end of thread, other threads:[~2024-08-23 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-23 10:43 [PATCH v11 6/7] irqchip/loongson-pch-msi: Prepare get_pch_msi_handle() for AVECINTC Tianyang Zhang
2024-08-23 10:43 ` [PATCH v11 7/7] irqchip/loongarch-avec: Add AVEC irqchip support Tianyang Zhang
2024-08-23 18:45   ` [tip: irq/core] " tip-bot2 for Tianyang Zhang
2024-08-23 18:45 ` [tip: irq/core] irqchip/loongson-pch-msi: Prepare get_pch_msi_handle() for AVECINTC tip-bot2 for Tianyang Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®