Thread (200 messages) 200 messages, 10 authors, 2025-09-10

Re: [PATCH 10/33] arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate

From: James Morse <james.morse@arm.com>
Date: 2025-09-10 19:31:27
Also in: linux-acpi, linux-devicetree, lkml

Hi Shaopeng,

On 09/09/2025 08:03, Shaopeng Tan (Fujitsu) wrote:
quoted
Probing MPAM is convoluted. MSCs that are integrated with a CPU may only be
accessible from those CPUs, and they may not be online.
Touching the hardware early is pointless as MPAM can't be used until the
system-wide common values for num_partid and num_pmg have been
discovered.

Start with driver probe/remove and mapping the MSC.
quoted
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
new file mode 100644 index 000000000000..a0d9a699a6e7
--- /dev/null
+++ b/drivers/resctrl/mpam_devices.c
@@ -0,0 +1,336 @@
quoted
+static int mpam_dt_parse_resources(struct mpam_msc *msc, void *ignored)
+{
+	int err, num_ris = 0;
+	const u32 *ris_idx_p;
+	struct device_node *iter, *np;
+
+	np = msc->pdev->dev.of_node;
+	for_each_child_of_node(np, iter) {
+		ris_idx_p = of_get_property(iter, "reg", NULL);
+		if (ris_idx_p) {
+			num_ris++;
+			err = mpam_dt_parse_resource(msc, iter, *ris_idx_p);
+			if (err) {
+				of_node_put(iter);
+				return err;
+			}
+		}
+	}
+
+	if (!num_ris)
+		mpam_dt_parse_resource(msc, np, 0);
err = mpam_dt_parse_resource(msc, np, 0);
Oops! Thanks for catching that,


James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help