[PATCH v7 02/12] irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic()

Aleksandar Rikalo posted 12 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH v7 02/12] irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic()
Posted by Aleksandar Rikalo 1 month, 1 week ago
From: Paul Burton <paulburton@kernel.org>

Use CM's GCR_CL_REDIRECT register to access registers in remote clusters,
so users of gic_with_each_online_cpu() gain support for multi-cluster with
no further changes.

Signed-off-by: Paul Burton <paulburton@kernel.org>
Signed-off-by: Chao-ying Fu <cfu@wavecomp.com>
Signed-off-by: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
---
 drivers/irqchip/irq-mips-gic.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index 6c7a7d2f0438..29bdfdce2123 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -88,6 +88,12 @@ static int __gic_with_next_online_cpu(int prev)
 	return cpu;
 }
 
+static inline void gic_unlock_cluster(void)
+{
+	if (mips_cps_multicluster_cpus())
+		mips_cm_unlock_other();
+}
+
 /**
  * for_each_online_cpu_gic() - Iterate over online CPUs, access local registers
  * @cpu: An integer variable to hold the current CPU number
@@ -102,6 +108,7 @@ static int __gic_with_next_online_cpu(int prev)
 	guard(raw_spinlock_irqsave)(gic_lock);		\
 	for ((cpu) = __gic_with_next_online_cpu(-1);	\
 	     (cpu) < nr_cpu_ids;			\
+	     gic_unlock_cluster(),			\
 	     (cpu) = __gic_with_next_online_cpu(cpu))
 
 static void gic_clear_pcpu_masks(unsigned int intr)
-- 
2.25.1
Re: [PATCH v7 02/12] irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic()
Posted by Thomas Gleixner 1 month ago
On Sat, Oct 19 2024 at 09:10, Aleksandar Rikalo wrote:

> From: Paul Burton <paulburton@kernel.org>
>
> Use CM's GCR_CL_REDIRECT register to access registers in remote clusters,
> so users of gic_with_each_online_cpu() gain support for multi-cluster with
> no further changes.
>
> Signed-off-by: Paul Burton <paulburton@kernel.org>
> Signed-off-by: Chao-ying Fu <cfu@wavecomp.com>
> Signed-off-by: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
> Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

I told you before that you cannot put my Signed-off-by on this. See

  https://lore.kernel.org/all/8734oguovn.ffs@tglx

#1 Please consult your lawyer if you can't figure out what to do here after
   reading through Documentation/process/*

#2 Just for the record, I seriously doubt that the Signed-off-by chain
   above the bogus entry you added for me is valid at all. See #1

Thanks,

        tglx