summaryrefslogtreecommitdiff
path: root/drivers/resctrl
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2026-10-01 17:34:34 +0200
committerJames Morse <james.morse@arm.com>2026-10-02 18:16:09 +0100
commitcea32229ec5cd3c080fb7b88cc102c16cfd8a572 (patch)
tree98dcf27b7f5fca882204a054130b58cb81b7a905 /drivers/resctrl
parent49a5f825e9a56b5304ec26836a68132e7428a557 (diff)
arm_mpam: propagate MSC access errors in mpam_reset_class_locked()
The mpam_reset_ris() function can return an error, propagate this up through mpam_reset_component_locked() to mpam_reset_class_locked(), which is exported. The external caller is a void function, so cannot really handle the error at the moment, but at least we report everything on the MPAM interface side. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> Reviewed-by: Ben Horgan <ben.horgan@arm.com> Signed-off-by: James Morse <james.morse@arm.com>
Diffstat (limited to 'drivers/resctrl')
-rw-r--r--drivers/resctrl/mpam_devices.c24
-rw-r--r--drivers/resctrl/mpam_internal.h2
2 files changed, 19 insertions, 7 deletions
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index c0f51d41e7fe..31f4826ab399 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -3040,7 +3040,7 @@ static void mpam_enable_once(void)
mpam_partid_max + 1, mpam_pmg_max + 1);
}
-static void mpam_reset_component_locked(struct mpam_component *comp)
+static int mpam_reset_component_locked(struct mpam_component *comp)
{
struct mpam_vmsc *vmsc;
@@ -3054,26 +3054,38 @@ static void mpam_reset_component_locked(struct mpam_component *comp)
srcu_read_lock_held(&mpam_srcu)) {
struct mpam_msc *msc = vmsc->msc;
struct mpam_msc_ris *ris;
+ int ret;
list_for_each_entry_srcu(ris, &vmsc->ris, vmsc_list,
srcu_read_lock_held(&mpam_srcu)) {
- if (!ris->in_reset_state)
- mpam_touch_msc(msc, mpam_reset_ris, ris);
+ if (!ris->in_reset_state) {
+ ret = mpam_touch_msc(msc, mpam_reset_ris, ris);
+ if (ret)
+ return ret;
+ }
ris->in_reset_state = true;
}
}
+
+ return 0;
}
-void mpam_reset_class_locked(struct mpam_class *class)
+int mpam_reset_class_locked(struct mpam_class *class)
{
struct mpam_component *comp;
+ int ret;
lockdep_assert_cpus_held();
guard(srcu)(&mpam_srcu);
list_for_each_entry_srcu(comp, &class->components, class_list,
- srcu_read_lock_held(&mpam_srcu))
- mpam_reset_component_locked(comp);
+ srcu_read_lock_held(&mpam_srcu)) {
+ ret = mpam_reset_component_locked(comp);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
static void mpam_reset_class(struct mpam_class *class)
diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
index 68a6cf2b9cc7..09f8168fb4d2 100644
--- a/drivers/resctrl/mpam_internal.h
+++ b/drivers/resctrl/mpam_internal.h
@@ -465,7 +465,7 @@ void mpam_enable(struct work_struct *work);
void mpam_disable(struct work_struct *work);
/* Reset all the RIS in a class under cpus_read_lock() */
-void mpam_reset_class_locked(struct mpam_class *class);
+int mpam_reset_class_locked(struct mpam_class *class);
int mpam_apply_config(struct mpam_component *comp, u16 partid,
struct mpam_config *cfg);