mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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>
This commit is contained in:
parent
49a5f825e9
commit
cea32229ec
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user