[PATCH v11 2/4] irqchip/irq-loonarch-avec: Prepare for interrupt redirection support

Tianyang Zhang posted 4 patches 3 days, 15 hours ago
[PATCH v11 2/4] irqchip/irq-loonarch-avec: Prepare for interrupt redirection support
Posted by Tianyang Zhang 3 days, 15 hours ago
Interrupt redirection support requires a new interrupt chip, which
needs to share data structures, constants and functions with the AVEC
code.

Move them to the header file and make the required functions public.

including:
1 marco AVEC_MSG_OFFSET
2 struct avecintc_data
3 Make avecintc_sync public

Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
---
 drivers/irqchip/irq-loongarch-avec.c | 12 +-----------
 drivers/irqchip/irq-loongson.h       | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/irqchip/irq-loongarch-avec.c b/drivers/irqchip/irq-loongarch-avec.c
index ba556c008cf3..70aa34439370 100644
--- a/drivers/irqchip/irq-loongarch-avec.c
+++ b/drivers/irqchip/irq-loongarch-avec.c
@@ -24,7 +24,6 @@
 #define VECTORS_PER_REG		64
 #define IRR_VECTOR_MASK		0xffUL
 #define IRR_INVALID_MASK	0x80000000UL
-#define AVEC_MSG_OFFSET		0x100000
 
 #ifdef CONFIG_SMP
 struct pending_list {
@@ -47,15 +46,6 @@ struct avecintc_chip {
 
 static struct avecintc_chip loongarch_avec;
 
-struct avecintc_data {
-	struct list_head	entry;
-	unsigned int		cpu;
-	unsigned int		vec;
-	unsigned int		prev_cpu;
-	unsigned int		prev_vec;
-	unsigned int		moving;
-};
-
 static inline void avecintc_enable(void)
 {
 	u64 value;
@@ -85,7 +75,7 @@ static inline void pending_list_init(int cpu)
 	INIT_LIST_HEAD(&plist->head);
 }
 
-static void avecintc_sync(struct avecintc_data *adata)
+void avecintc_sync(struct avecintc_data *adata)
 {
 	struct pending_list *plist;
 
diff --git a/drivers/irqchip/irq-loongson.h b/drivers/irqchip/irq-loongson.h
index 11fa138d1f44..1f11d799bf0a 100644
--- a/drivers/irqchip/irq-loongson.h
+++ b/drivers/irqchip/irq-loongson.h
@@ -6,6 +6,17 @@
 #ifndef _DRIVERS_IRQCHIP_IRQ_LOONGSON_H
 #define _DRIVERS_IRQCHIP_IRQ_LOONGSON_H
 
+#define AVEC_MSG_OFFSET		0x100000
+
+struct avecintc_data {
+	struct list_head        entry;
+	unsigned int            cpu;
+	unsigned int            vec;
+	unsigned int            prev_cpu;
+	unsigned int            prev_vec;
+	unsigned int            moving;
+};
+
 int find_pch_pic(u32 gsi);
 
 int liointc_acpi_init(struct irq_domain *parent,
@@ -24,4 +35,12 @@ int pch_msi_acpi_init(struct irq_domain *parent,
 					struct acpi_madt_msi_pic *acpi_pchmsi);
 int pch_msi_acpi_init_avec(struct irq_domain *parent);
 
+int redirect_acpi_init(struct irq_domain *parent);
+
+#ifdef CONFIG_SMP
+void avecintc_sync(struct avecintc_data *adata);
+#else
+static inline void avecintc_sync(struct avecintc_data *adata) {}
+#endif
+
 #endif /* _DRIVERS_IRQCHIP_IRQ_LOONGSON_H */
-- 
2.41.0
Re: [PATCH v11 2/4] irqchip/irq-loonarch-avec: Prepare for interrupt redirection support
Posted by Thomas Gleixner 3 days, 11 hours ago
On Tue, Feb 03 2026 at 20:45, Tianyang Zhang wrote:

$Subject: irqchip/irq-loonarch-avec

I know you blindly copied my suggestion and obviously you failed to spot
the missing 'g'.

> Interrupt redirection support requires a new interrupt chip, which
> needs to share data structures, constants and functions with the AVEC
> code.
>
> Move them to the header file and make the required functions public.

But then you still keep this nonsense around, which has no place in the
change log as I explained to you before:

  "Enumerating the details of what is moved is a pointless exercise
   because that can bee seen from the diff itself."

What's so hard about that to understand?

Just in case I'm not able to express myself coherently, this means:

Remove the following 4 lines:

> including:
> 1 marco AVEC_MSG_OFFSET
> 2 struct avecintc_data
> 3 Make avecintc_sync public

Sigh. Though I have to admit that 'loonarch' gave me a good laugh at
least.

Thanks,

        tglx
Re: [PATCH v11 2/4] irqchip/irq-loonarch-avec: Prepare for interrupt redirection support
Posted by Tianyang Zhang 3 days, 2 hours ago
Hi, Thomas

在 2026/2/4 上午1:17, Thomas Gleixner 写道:
> On Tue, Feb 03 2026 at 20:45, Tianyang Zhang wrote:
> 
> $Subject: irqchip/irq-loonarch-avec
> 
> I know you blindly copied my suggestion and obviously you failed to spot
> the missing 'g'.
......ok......
> 
>> Interrupt redirection support requires a new interrupt chip, which
>> needs to share data structures, constants and functions with the AVEC
>> code.
>>
>> Move them to the header file and make the required functions public.
> 
> But then you still keep this nonsense around, which has no place in the
> change log as I explained to you before:
> 
>    "Enumerating the details of what is moved is a pointless exercise
>     because that can bee seen from the diff itself."
> 
> What's so hard about that to understand?
> 
> Just in case I'm not able to express myself coherently, this means:
> 
> Remove the following 4 lines:
Ok, I got it
> 
>> including:
>> 1 marco AVEC_MSG_OFFSET
>> 2 struct avecintc_data
>> 3 Make avecintc_sync public
> 
> Sigh. Though I have to admit that 'loonarch' gave me a good laugh at
> least.
......Maybe that's a happy little accident
> 
> Thanks,
> 
>          tglx
> 
Thanks
Tianyang

Re: [PATCH v11 2/4] irqchip/irq-loonarch-avec: Prepare for interrupt redirection support
Posted by Thomas Gleixner 3 days, 10 hours ago
On Tue, Feb 03 2026 at 18:17, Thomas Gleixner wrote:
>
> Sigh. Though I have to admit that 'loonarch' gave me a good laugh at
> least.

Please resend it after the next rc1 as new features are not longer
applied this week.

Thanks,

        tglx