From: Aleksandar Rikalo <arikalo@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>,
Gregory CLEMENT <gregory.clement@bootlin.com>,
Theo Lebrun <theo.lebrun@bootlin.com>,
Arnd Bergmann <arnd@arndb.de>,
devicetree@vger.kernel.org,
Djordje Todorovic <djordje.todorovic@htecgroup.com>,
Chao-ying Fu <cfu@wavecomp.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Greg Ungerer <gerg@kernel.org>, Hauke Mehrtens <hauke@hauke-m.de>,
Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
Marc Zyngier <maz@kernel.org>,
Paul Burton <paulburton@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Serge Semin <fancer.lancer@gmail.com>,
Tiezhu Yang <yangtiezhu@loongson.cn>,
Aleksandar Rikalo <arikalo@gmail.com>
Subject: [PATCH v8 13/13] irqchip: mips-gic: Handle case with cluster without CPU cores
Date: Mon, 28 Oct 2024 18:59:35 +0100 [thread overview]
Message-ID: <20241028175935.51250-14-arikalo@gmail.com> (raw)
In-Reply-To: <20241028175935.51250-1-arikalo@gmail.com>
From: Gregory CLEMENT <gregory.clement@bootlin.com>
It is possible to have no CPU cores in a cluster; in such cases, it is
not possible to access the GIC, and any indirect access leads to an
exception. This patch dynamically skips the indirect access in such
situations.
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
drivers/irqchip/irq-mips-gic.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index f42f69bbd6fb..bca8053864b2 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -141,7 +141,8 @@ static bool gic_irq_lock_cluster(struct irq_data *d)
cl = cpu_cluster(&cpu_data[cpu]);
if (cl == cpu_cluster(¤t_cpu_data))
return false;
-
+ if (mips_cps_numcores(cl) == 0)
+ return false;
mips_cm_lock_other(cl, 0, 0, CM_GCR_Cx_OTHER_BLOCK_GLOBAL);
return true;
}
@@ -507,6 +508,9 @@ static void gic_mask_local_irq_all_vpes(struct irq_data *d)
struct gic_all_vpes_chip_data *cd;
int intr, cpu;
+ if (!mips_cps_multicluster_cpus())
+ return;
+
intr = GIC_HWIRQ_TO_LOCAL(d->hwirq);
cd = irq_data_get_irq_chip_data(d);
cd->mask = false;
@@ -520,6 +524,9 @@ static void gic_unmask_local_irq_all_vpes(struct irq_data *d)
struct gic_all_vpes_chip_data *cd;
int intr, cpu;
+ if (!mips_cps_multicluster_cpus())
+ return;
+
intr = GIC_HWIRQ_TO_LOCAL(d->hwirq);
cd = irq_data_get_irq_chip_data(d);
cd->mask = true;
@@ -687,8 +694,10 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq,
if (!gic_local_irq_is_routable(intr))
return -EPERM;
- for_each_online_cpu_gic(cpu, &gic_lock)
- write_gic_vo_map(mips_gic_vx_map_reg(intr), map);
+ if (mips_cps_multicluster_cpus()) {
+ for_each_online_cpu_gic(cpu, &gic_lock)
+ write_gic_vo_map(mips_gic_vx_map_reg(intr), map);
+ }
return 0;
}
@@ -982,7 +991,7 @@ static int __init gic_of_init(struct device_node *node,
change_gic_trig(i, GIC_TRIG_LEVEL);
write_gic_rmask(i);
}
- } else {
+ } else if (mips_cps_numcores(cl) != 0) {
mips_cm_lock_other(cl, 0, 0, CM_GCR_Cx_OTHER_BLOCK_GLOBAL);
for (i = 0; i < gic_shared_intrs; i++) {
change_gic_redir_pol(i, GIC_POL_ACTIVE_HIGH);
@@ -990,6 +999,9 @@ static int __init gic_of_init(struct device_node *node,
write_gic_redir_rmask(i);
}
mips_cm_unlock_other();
+
+ } else {
+ pr_warn("No CPU cores on the cluster %d skip it\n", cl);
}
}
--
2.25.1
next prev parent reply other threads:[~2024-10-28 18:00 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 17:59 [PATCH v8 00/13] MIPS: Support I6500 multi-cluster configuration Aleksandar Rikalo
2024-10-28 17:59 ` [PATCH v8 01/13] irqchip/mips-gic: Introduce for_each_online_cpu_gic() Aleksandar Rikalo
2024-10-30 14:49 ` [tip: irq/core] irqchip/mips-gic: Replace open coded online CPU iterations tip-bot2 for Paul Burton
2024-10-28 17:59 ` [PATCH v8 02/13] irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic() Aleksandar Rikalo
2024-10-30 14:49 ` [tip: irq/core] " tip-bot2 for Paul Burton
2024-10-28 17:59 ` [PATCH v8 03/13] irqchip/mips-gic: Setup defaults in each cluster Aleksandar Rikalo
2024-10-30 14:49 ` [tip: irq/core] " tip-bot2 for Chao-ying Fu
2024-10-28 17:59 ` [PATCH v8 04/13] irqchip/mips-gic: Multi-cluster support Aleksandar Rikalo
2024-10-28 19:45 ` Thomas Gleixner
2024-10-30 14:49 ` [tip: irq/core] " tip-bot2 for Paul Burton
2024-10-28 17:59 ` [PATCH v8 05/13] clocksource: mips-gic-timer: Always use cluster 0 counter as clocksource Aleksandar Rikalo
2024-10-28 17:59 ` [PATCH v8 06/13] clocksource: mips-gic-timer: Enable counter when CPUs start Aleksandar Rikalo
2024-10-28 17:59 ` [PATCH v8 07/13] MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core Aleksandar Rikalo
2024-10-28 17:59 ` [PATCH v8 08/13] MIPS: CPS: Introduce struct cluster_boot_config Aleksandar Rikalo
2024-10-28 17:59 ` [PATCH v8 09/13] MIPS: CPS: Boot CPUs in secondary clusters Aleksandar Rikalo
2024-10-28 17:59 ` [PATCH v8 10/13] dt-bindings: mips: cpu: Add property for broken HCI information Aleksandar Rikalo
2024-10-29 7:03 ` Krzysztof Kozlowski
2024-10-29 12:21 ` Aleksandar Rikalo
2024-10-29 16:08 ` Gregory CLEMENT
2024-10-29 16:11 ` Jiaxun Yang
2024-10-30 11:35 ` Jiaxun Yang
2024-10-31 8:13 ` Gregory CLEMENT
2024-10-31 14:42 ` Thomas Bogendoerfer
2024-10-31 15:27 ` Jiaxun Yang
2024-10-28 17:59 ` [PATCH v8 11/13] MIPS: CPS: Support broken HCI for multicluster Aleksandar Rikalo
2024-10-28 17:59 ` [PATCH v8 12/13] MIPS: mobileye: dts: eyeq6h: Enable cluster support Aleksandar Rikalo
2024-10-28 17:59 ` Aleksandar Rikalo [this message]
2024-10-30 14:49 ` [tip: irq/core] irqchip/mips-gic: Prevent indirect access to clusters without CPU cores tip-bot2 for Gregory CLEMENT
2024-10-30 11:39 ` [PATCH v8 00/13] MIPS: Support I6500 multi-cluster configuration Jiaxun Yang
2024-11-01 1:47 ` Maciej W. Rozycki
2025-01-22 15:06 ` Gregory CLEMENT
2025-01-23 10:19 ` Aleksandar Rikalo
2025-01-23 15:35 ` Gregory CLEMENT
2025-02-19 10:46 ` Aleksandar Rikalo
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=20241028175935.51250-14-arikalo@gmail.com \
--to=arikalo@gmail.com \
--cc=arnd@arndb.de \
--cc=cfu@wavecomp.com \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=djordje.todorovic@htecgroup.com \
--cc=fancer.lancer@gmail.com \
--cc=geert@linux-m68k.org \
--cc=gerg@kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=hauke@hauke-m.de \
--cc=ilya.lipnitskiy@gmail.com \
--cc=jiaxun.yang@flygoat.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=maz@kernel.org \
--cc=paulburton@kernel.org \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=theo.lebrun@bootlin.com \
--cc=tsbogend@alpha.franken.de \
--cc=vladimir.kondratiev@mobileye.com \
--cc=yangtiezhu@loongson.cn \
/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®