summaryrefslogtreecommitdiff
path: root/drivers/resctrl/mpam_devices.c
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2025-11-19 12:22:55 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2025-11-19 18:34:22 +0000
commitc891bae66423bc69a680ca1de34940132e2c8ace (patch)
tree784baa98fc3729d78ddd2f8ec61b7f9e32c80640 /drivers/resctrl/mpam_devices.c
parent880df85d8673f8e2395f139d3618661366e5d4d8 (diff)
arm_mpam: Add helpers to allocate monitors
MPAM's MSC support a number of monitors, each of which supports bandwidth counters, or cache-storage-utilisation counters. To use a counter, a monitor needs to be configured. Add helpers to allocate and free CSU or MBWU monitors. Signed-off-by: James Morse <james.morse@arm.com> Reviewed-by: Ben Horgan <ben.horgan@arm.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> Tested-by: Fenghua Yu <fenghuay@nvidia.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Tested-by: Peter Newman <peternewman@google.com> Tested-by: Carl Worth <carl@os.amperecomputing.com> Tested-by: Gavin Shan <gshan@redhat.com> Tested-by: Zeng Heng <zengheng4@huawei.com> Tested-by: Hanjun Guo <guohanjun@huawei.com> Signed-off-by: Ben Horgan <ben.horgan@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'drivers/resctrl/mpam_devices.c')
-rw-r--r--drivers/resctrl/mpam_devices.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index 67eb0c79ca49..a7ba07ac5a2f 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -305,6 +305,8 @@ mpam_class_alloc(u8 level_idx, enum mpam_class_types type)
class->level = level_idx;
class->type = type;
INIT_LIST_HEAD_RCU(&class->classes_list);
+ ida_init(&class->ida_csu_mon);
+ ida_init(&class->ida_mbwu_mon);
list_add_rcu(&class->classes_list, &mpam_classes);