[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <172202143044.2215.9209897857096931802.tip-bot2@tip-bot2>
Date: Fri, 26 Jul 2024 19:17:10 -0000
From: "tip-bot2 for Huacai Chen" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Miao Wang <shankerwangmiao@...il.com>,
Huacai Chen <chenhuacai@...ngson.cn>, Thomas Gleixner <tglx@...utronix.de>,
Jiaxun Yang <jiaxun.yang@...goat.com>, <stable@...r.kernel.org>,
x86@...nel.org, linux-kernel@...r.kernel.org, maz@...nel.org
Subject: [tip: irq/urgent] irqchip/loongarch-cpu: Fix return value of
lpic_gsi_to_irq()
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: 81a91abab1307d7725fa4620952c0767beae7753
Gitweb: https://git.kernel.org/tip/81a91abab1307d7725fa4620952c0767beae7753
Author: Huacai Chen <chenhuacai@...ngson.cn>
AuthorDate: Tue, 23 Jul 2024 14:45:08 +08:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Fri, 26 Jul 2024 21:08:42 +02:00
irqchip/loongarch-cpu: Fix return value of lpic_gsi_to_irq()
lpic_gsi_to_irq() should return a valid Linux interrupt number if
acpi_register_gsi() succeeds, and return 0 otherwise. But lpic_gsi_to_irq()
converts a negative return value of acpi_register_gsi() to a positive value
silently.
Convert the return value explicitly.
Fixes: e8bba72b396c ("irqchip / ACPI: Introduce ACPI_IRQ_MODEL_LPIC for LoongArch")
Reported-by: Miao Wang <shankerwangmiao@...il.com>
Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Cc: <stable@...r.kernel.org>
Link: https://lore.kernel.org/r/20240723064508.35560-1-chenhuacai@loongson.cn
---
drivers/irqchip/irq-loongarch-cpu.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c
index 9d8f2c4..b35903a 100644
--- a/drivers/irqchip/irq-loongarch-cpu.c
+++ b/drivers/irqchip/irq-loongarch-cpu.c
@@ -18,11 +18,13 @@ struct fwnode_handle *cpuintc_handle;
static u32 lpic_gsi_to_irq(u32 gsi)
{
+ int irq = 0;
+
/* Only pch irqdomain transferring is required for LoongArch. */
if (gsi >= GSI_MIN_PCH_IRQ && gsi <= GSI_MAX_PCH_IRQ)
- return acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH);
+ irq = acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH);
- return 0;
+ return (irq > 0) ? irq : 0;
}
static struct fwnode_handle *lpic_get_gsi_domain_id(u32 gsi)
Powered by blists - more mailing lists