Re: [PATCH v4 1/3] arm_mpam: resctrl: Leave CDP off when there are too few PARTIDs

From: Gavin Shan

Date: Thu Nov 12 2026 - 18:46:02 EST


On 11/11/26 6:13 PM, Jinjie Ruan wrote:
Enabling CDP requires at least 2 PARTIDs. If there are too few PARTIDs,
resctrl_arch_set_cdp_enabled() returns -EINVAL, but only after it has
recorded CDP as enabled, halved the monitor count and turned off the
mbw_max MBA control. resctrl then believes CDP is off, which leaves the
two sides out of step and the halved monitor count and the missing MBA
control are not undone.

Check the PARTID limit before anything is changed so a failed enable has
no effect.

Fixes: 6789fb99282c ("arm_mpam: resctrl: Add CDP emulation")
Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # 7.1+
---
drivers/resctrl/mpam_resctrl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>