arm_mpam: resctrl: Implement resctrl_arch_reset_all_ctrls()

We already have a helper for resetting an mpam class and component.  Hook
it up to resctrl_arch_reset_all_ctrls() and the domain offline path.

Tested-by: Gavin Shan <gshan@redhat.com>
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Tested-by: Peter Newman <peternewman@google.com>
Tested-by: Zeng Heng <zengheng4@huawei.com>
Tested-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com>
Tested-by: Jesse Chick <jessechick@os.amperecomputing.com>
Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Reviewed-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Co-developed-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
This commit is contained in:
James Morse
2026-03-13 14:45:53 +00:00
parent 52a4edb161
commit 370d166d87
3 changed files with 17 additions and 1 deletions

View File

@@ -2551,7 +2551,7 @@ static void mpam_reset_component_locked(struct mpam_component *comp)
}
}
static void mpam_reset_class_locked(struct mpam_class *class)
void mpam_reset_class_locked(struct mpam_class *class)
{
struct mpam_component *comp;

View File

@@ -388,6 +388,9 @@ extern u8 mpam_pmg_max;
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_apply_config(struct mpam_component *comp, u16 partid,
struct mpam_config *cfg);

View File

@@ -170,6 +170,19 @@ static int mpam_resctrl_pick_domain_id(int cpu, struct mpam_component *comp)
return comp->comp_id;
}
void resctrl_arch_reset_all_ctrls(struct rdt_resource *r)
{
struct mpam_resctrl_res *res;
lockdep_assert_cpus_held();
if (!mpam_is_enabled())
return;
res = container_of(r, struct mpam_resctrl_res, resctrl_res);
mpam_reset_class_locked(res->class);
}
static void mpam_resctrl_domain_hdr_init(int cpu, struct mpam_component *comp,
enum resctrl_res_level rid,
struct rdt_domain_hdr *hdr)