mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Huacai Chen" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Huacai Chen <chenhuacai@loongson.cn>,
	Thomas Gleixner <tglx@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/drivers] irqchip/loongarch-avec: Adjust irqchip driver for 32BIT/64BIT
Date: Sun, 18 Jan 2026 13:41:58 -0000	[thread overview]
Message-ID: <176874371848.510.1874357246454080379.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260113085940.3344837-2-chenhuacai@loongson.cn>

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     d9e7035a51b89ef6041ce7c00b629e7877134a51
Gitweb:        https://git.kernel.org/tip/d9e7035a51b89ef6041ce7c00b629e7877134a51
Author:        Huacai Chen <chenhuacai@loongson.cn>
AuthorDate:    Tue, 13 Jan 2026 16:59:34 +08:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sun, 18 Jan 2026 14:39:16 +01:00

irqchip/loongarch-avec: Adjust irqchip driver for 32BIT/64BIT

csr_read64() is only available on 64BIT LoongArch platform, so use the
recently added adaptive csr_read() instead to make the driver work on both
32BIT and 64BIT platforms.

This makes avecintc_enable() a no-op for 32-bit as it is only required on
64-bit systems.

Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260113085940.3344837-2-chenhuacai@loongson.cn
---
 drivers/irqchip/irq-loongarch-avec.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/irqchip/irq-loongarch-avec.c b/drivers/irqchip/irq-loongarch-avec.c
index ba556c0..fb8efde 100644
--- a/drivers/irqchip/irq-loongarch-avec.c
+++ b/drivers/irqchip/irq-loongarch-avec.c
@@ -58,11 +58,13 @@ struct avecintc_data {
 
 static inline void avecintc_enable(void)
 {
+#ifdef CONFIG_MACH_LOONGSON64
 	u64 value;
 
 	value = iocsr_read64(LOONGARCH_IOCSR_MISC_FUNC);
 	value |= IOCSR_MISC_FUNC_AVEC_EN;
 	iocsr_write64(value, LOONGARCH_IOCSR_MISC_FUNC);
+#endif
 }
 
 static inline void avecintc_ack_irq(struct irq_data *d)
@@ -167,7 +169,7 @@ void complete_irq_moving(void)
 	struct pending_list *plist = this_cpu_ptr(&pending_list);
 	struct avecintc_data *adata, *tdata;
 	int cpu, vector, bias;
-	uint64_t isr;
+	unsigned long isr;
 
 	guard(raw_spinlock)(&loongarch_avec.lock);
 
@@ -177,16 +179,16 @@ void complete_irq_moving(void)
 		bias = vector / VECTORS_PER_REG;
 		switch (bias) {
 		case 0:
-			isr = csr_read64(LOONGARCH_CSR_ISR0);
+			isr = csr_read(LOONGARCH_CSR_ISR0);
 			break;
 		case 1:
-			isr = csr_read64(LOONGARCH_CSR_ISR1);
+			isr = csr_read(LOONGARCH_CSR_ISR1);
 			break;
 		case 2:
-			isr = csr_read64(LOONGARCH_CSR_ISR2);
+			isr = csr_read(LOONGARCH_CSR_ISR2);
 			break;
 		case 3:
-			isr = csr_read64(LOONGARCH_CSR_ISR3);
+			isr = csr_read(LOONGARCH_CSR_ISR3);
 			break;
 		}
 
@@ -234,7 +236,7 @@ static void avecintc_irq_dispatch(struct irq_desc *desc)
 	chained_irq_enter(chip, desc);
 
 	while (true) {
-		unsigned long vector = csr_read64(LOONGARCH_CSR_IRR);
+		unsigned long vector = csr_read(LOONGARCH_CSR_IRR);
 		if (vector & IRR_INVALID_MASK)
 			break;
 

  parent reply	other threads:[~2026-01-18 13:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13  8:59 [PATCH V3 0/7] irqchip: Adjust LoongArch irqchip drivers " Huacai Chen
2026-01-13  8:59 ` [PATCH V3 1/7] irqchip/loongarch-avec: Adjust irqchip driver " Huacai Chen
2026-01-18 10:03   ` [tip: irq/drivers] " tip-bot2 for Huacai Chen
2026-01-18 13:41   ` tip-bot2 for Huacai Chen [this message]
2026-01-13  8:59 ` [PATCH V3 2/7] irqchip/loongson-liointc: " Huacai Chen
2026-01-18 10:03   ` [tip: irq/drivers] irq_domain_alloc_fwnode() takes a parameter with the phys_addr_t type tip-bot2 for Huacai Chen
2026-01-18 13:41   ` [tip: irq/drivers] irqchip/loongson-liointc: Adjust irqchip driver for 32BIT/64BIT tip-bot2 for Huacai Chen
2026-01-13  8:59 ` [PATCH V3 3/7] irqchip/loongson-eiointc: " Huacai Chen
2026-01-18 10:03   ` [tip: irq/drivers] " tip-bot2 for Huacai Chen
2026-01-18 13:41   ` tip-bot2 for Huacai Chen
2026-01-18 13:53     ` 陈华才
2026-01-13  8:59 ` [PATCH V3 4/7] irqchip/loongson-htvec: " Huacai Chen
2026-01-18 10:03   ` [tip: irq/drivers] " tip-bot2 for Huacai Chen
2026-01-18 13:41   ` tip-bot2 for Huacai Chen
2026-01-13  8:59 ` [PATCH V3 5/7] irqchip/loongson-pch-msi: " Huacai Chen
2026-01-18 10:03   ` [tip: irq/drivers] " tip-bot2 for Huacai Chen
2026-01-18 13:41   ` tip-bot2 for Huacai Chen
2026-01-13  8:59 ` [PATCH V3 6/7] irqchip/loongson-pch-pic: " Huacai Chen
2026-01-18 10:02   ` [tip: irq/drivers] " tip-bot2 for Huacai Chen
2026-01-18 13:41   ` tip-bot2 for Huacai Chen
2026-01-13  8:59 ` [PATCH V3 7/7] irqchip: Allow LoongArch irqchip drivers on both 32BIT/64BIT Huacai Chen
2026-01-18 10:02   ` [tip: irq/drivers] " tip-bot2 for Huacai Chen
2026-01-18 13:41   ` tip-bot2 for 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=176874371848.510.1874357246454080379.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=chenhuacai@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®