[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176873057949.510.16070096863396286674.tip-bot2@tip-bot2>
Date: Sun, 18 Jan 2026 10:02:59 -0000
From: "tip-bot2 for Huacai Chen" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Jiaxun Yang <jiaxun.yang@...goat.com>,
Huacai Chen <chenhuacai@...ngson.cn>, Thomas Gleixner <tglx@...nel.org>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: irq/drivers] irqchip/loongson-pch-pic: Adjust irqchip driver
for 32BIT/64BIT
The following commit has been merged into the irq/drivers branch of tip:
Commit-ID: 6e419473461bda5be6888de436d89753c1d260b3
Gitweb: https://git.kernel.org/tip/6e419473461bda5be6888de436d89753c1d260b3
Author: Huacai Chen <chenhuacai@...ngson.cn>
AuthorDate: Tue, 13 Jan 2026 16:59:39 +08:00
Committer: Thomas Gleixner <tglx@...nel.org>
CommitterDate: Tue, 13 Jan 2026 19:32:02 +01:00
irqchip/loongson-pch-pic: Adjust irqchip driver for 32BIT/64BIT
irq_domain_alloc_fwnode() takes a parameter with the phys_addr_t type.
Currently we pass acpi_pchpic->address to it. This can only work on
64BIT platform because its type is u64, so cast it to phys_addr_t and
then the driver works on both 32BIT and 64BIT platforms.
Also use readl() to read vec_count because readq() is only available on
64BIT platform.
[ tglx: Make the cast explicit and use the casted address as argument for
pch_pic_init() which takes a phys_addr_t as well. Fixup coding
style. More sigh... ]
Co-developed-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
Signed-off-by: Thomas Gleixner <tglx@...nel.org>
Link: https://patch.msgid.link/20260113085940.3344837-7-chenhuacai@loongson.cn
---
drivers/irqchip/irq-loongson-pch-pic.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c
index c6b369a..23f94cd 100644
--- a/drivers/irqchip/irq-loongson-pch-pic.c
+++ b/drivers/irqchip/irq-loongson-pch-pic.c
@@ -343,7 +343,7 @@ static int pch_pic_init(phys_addr_t addr, unsigned long size, int vec_base,
priv->table[i] = PIC_UNDEF_VECTOR;
priv->ht_vec_base = vec_base;
- priv->vec_count = ((readq(priv->base) >> 48) & 0xff) + 1;
+ priv->vec_count = ((readl(priv->base + 4) >> 16) & 0xff) + 1;
priv->gsi_base = gsi_base;
priv->pic_domain = irq_domain_create_hierarchy(parent_domain, 0,
@@ -446,23 +446,23 @@ static int __init acpi_cascade_irqdomain_init(void)
return 0;
}
-int __init pch_pic_acpi_init(struct irq_domain *parent,
- struct acpi_madt_bio_pic *acpi_pchpic)
+int __init pch_pic_acpi_init(struct irq_domain *parent, struct acpi_madt_bio_pic *acpi_pchpic)
{
- int ret;
+ phys_addr_t addr = (physaddr_t)acpi_pchpic->address;
struct fwnode_handle *domain_handle;
+ int ret;
if (find_pch_pic(acpi_pchpic->gsi_base) >= 0)
return 0;
- domain_handle = irq_domain_alloc_fwnode(&acpi_pchpic->address);
+ domain_handle = irq_domain_alloc_fwnode(&addr);
if (!domain_handle) {
pr_err("Unable to allocate domain handle\n");
return -ENOMEM;
}
- ret = pch_pic_init(acpi_pchpic->address, acpi_pchpic->size,
- 0, parent, domain_handle, acpi_pchpic->gsi_base);
+ ret = pch_pic_init(addr, acpi_pchpic->size, 0, parent,
+ domain_handle, acpi_pchpic->gsi_base);
if (ret < 0) {
irq_domain_free_fwnode(domain_handle);
Powered by blists - more mailing lists