[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sex6m4gx.ffs@tglx>
Date: Fri, 21 Jun 2024 22:21:50 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Aleksandar Rikalo <aleksandar.rikalo@...mia.com>, Thomas Bogendoerfer
<tsbogend@...ha.franken.de>
Cc: Aleksandar Rikalo <arikalo@...il.com>, Chao-ying Fu <cfu@...ecomp.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>, Geert Uytterhoeven
<geert@...ux-m68k.org>, Greg Ungerer <gerg@...nel.org>, Hauke Mehrtens
<hauke@...ke-m.de>, Ilya Lipnitskiy <ilya.lipnitskiy@...il.com>, Jiaxun
Yang <jiaxun.yang@...goat.com>, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org, Marc Zyngier <maz@...nel.org>, Paul Burton
<paulburton@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Serge
Semin <fancer.lancer@...il.com>, Tiezhu Yang <yangtiezhu@...ngson.cn>
Subject: Re: [PATCH v4 04/14] irqchip: mips-gic: Support multi-cluster in
for_each_online_cpu_gic()
On Sat, May 11 2024 at 12:43, Aleksandar Rikalo wrote:
> From: Paul Burton <paulburton@...nel.org>
>
> Introduce support for multi-cluster GIC register access in
> __gic_with_next_online_cpu(), and therefore in its user
> for_each_online_cpu_gic(). We access registers in remote clusters
> using the CM's GCR_CL_REDIRECT register, and so here we delegate
> to mips_cm_lock_other() in order to configure this access.
Again: We do nothing. See docs.
> @@ -70,6 +70,20 @@ static int __gic_with_next_online_cpu(int prev)
> {
> unsigned int cpu;
>
> + /*
> + * Unlock access to the previous CPU's GIC local register block.
> + *
> + * Delegate to the CM locking code in the multi-cluster case, since
> + * other clusters can only be accessed using GCR_CL_REDIRECT.
> + *
> + * In the single cluster case we don't need to do anything; the caller
> + * is responsible for maintaining gic_lock & nothing should be
> + * expecting any particular value of GIC_VL_OTHER so we can leave it
> + * as-is.
> + */
> + if ((prev != -1) && mips_cps_multicluster_cpus())
> + mips_cm_unlock_other();
Eew.
static inline void gic_unlock_cluster(void)
{
if (mips_cps_multicluster_cpus())
mips_cm_unlock_other();
}
#define for_each_online_cpu_gic(cpu, gic_lock) \
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);)
No?
Thanks,
tglx
Powered by blists - more mailing lists