Re: [PATCH 27/33] arm_mpam: Track bandwidth counter state for power management

Jonathan Cameron
2025-11-10T17:31:41Z

On Fri, 7 Nov 2025 12:34:44 +0000
Ben Horgan <ben.horgan@arm.com> wrote:

> From: James Morse <james.morse@arm.com>
>
> Bandwidth counters need to run continuously to correctly reflect the
> bandwidth.
>
> Save the counter state when the hardware is reset due to CPU hotplug.
> Add struct mbwu_state to track the bandwidth counter. Support for
> tracking overflow with the same structure will be added in a
> subsequent commit.
>
> Cc: Zeng Heng <zengheng4@huawei.com>
> Signed-off-by: James Morse <james.morse@arm.com>
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>

One trivial below.
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

>
> diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
> index d8f8e29987e0..1f2b04b7703e 100644
> --- a/drivers/resctrl/mpam_internal.h
> +++ b/drivers/resctrl/mpam_internal.h
> @@ -91,7 +91,10 @@ struct mpam_msc {
> */
> struct mutex part_sel_lock;
>
> - /* cfg_lock protects the msc configuration. */
> + /*
> + * cfg_lock protects the msc configuration and guards against mbwu_state
> + * and save and restore racing.

Stray "and" that isn't needed on this second line.

> + */
> struct mutex cfg_lock;
>