Message ID | 20250117151033.1517882-11-Dave.Martin@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Introduce PARTID grouping support | expand |
diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/arm64/mpam/mpam_resctrl.c index f1d0d9f59771..1f31b1455f66 100644 --- a/drivers/platform/arm64/mpam/mpam_resctrl.c +++ b/drivers/platform/arm64/mpam/mpam_resctrl.c @@ -1263,6 +1263,10 @@ static int __resctrl_arch_update_domains(struct rdt_resource *r, u32 closid, list_for_each_entry(d, &r->ctrl_domains, hdr.list) { for (t = 0; t < CDP_NUM_TYPES; t++) { + if ((t == CDP_NONE) != + (!cdp_enabled || mpam_resctrl_hide_cdp(r->rid))) + continue; + cfg = &d->staged_config[t]; if (!force && !cfg->have_new_ctrl) continue;
The implementation of resctrl_arch_update_domains() currently iterates over all types of staged configuration changes passed from resctrl, irrespective of whether a given type (CDP_CODE, CDP_DATA or CDP_NONE) makes sense for the affected MPAM resource. Since resctrl will not stage any updates of inappropriate type for the resource, this is mostly harmless. When doing a forced update as a result of a call via resctrl_arch_init_domains() however, there is a need to update the cpartid (intPARTID) even if no staged configuration changes are supplied. This can result in intPARTID being repeatedly reprogrammed with different values. As well as being inefficient, the final value may not be the correct one. To program just once with the correct intPARTID, only apply the update types that actually make sense for the resource. Signed-off-by: Dave Martin <Dave.Martin@arm.com> --- drivers/platform/arm64/mpam/mpam_resctrl.c | 4 ++++ 1 file changed, 4 insertions(+)