Skip to content

Commit 370d166

Browse files
author
James Morse
committed
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>
1 parent 52a4edb commit 370d166

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

drivers/resctrl/mpam_devices.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2551,7 +2551,7 @@ static void mpam_reset_component_locked(struct mpam_component *comp)
25512551
}
25522552
}
25532553

2554-
static void mpam_reset_class_locked(struct mpam_class *class)
2554+
void mpam_reset_class_locked(struct mpam_class *class)
25552555
{
25562556
struct mpam_component *comp;
25572557

drivers/resctrl/mpam_internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ extern u8 mpam_pmg_max;
388388
void mpam_enable(struct work_struct *work);
389389
void mpam_disable(struct work_struct *work);
390390

391+
/* Reset all the RIS in a class under cpus_read_lock() */
392+
void mpam_reset_class_locked(struct mpam_class *class);
393+
391394
int mpam_apply_config(struct mpam_component *comp, u16 partid,
392395
struct mpam_config *cfg);
393396

drivers/resctrl/mpam_resctrl.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,19 @@ static int mpam_resctrl_pick_domain_id(int cpu, struct mpam_component *comp)
170170
return comp->comp_id;
171171
}
172172

173+
void resctrl_arch_reset_all_ctrls(struct rdt_resource *r)
174+
{
175+
struct mpam_resctrl_res *res;
176+
177+
lockdep_assert_cpus_held();
178+
179+
if (!mpam_is_enabled())
180+
return;
181+
182+
res = container_of(r, struct mpam_resctrl_res, resctrl_res);
183+
mpam_reset_class_locked(res->class);
184+
}
185+
173186
static void mpam_resctrl_domain_hdr_init(int cpu, struct mpam_component *comp,
174187
enum resctrl_res_level rid,
175188
struct rdt_domain_hdr *hdr)

0 commit comments

Comments
 (0)