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

From: Jonathan Cameron <[email-masked]>
Date: Mon, 10 Nov 2025 17:31:36 +0000

On Fri, 7 Nov 2025 12:34:44 +0000
Ben Horgan <[email-masked]> wrote:

> From: James Morse <[email-masked]>
> 
> 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 <[email-masked]>
> Signed-off-by: James Morse <[email-masked]>
> Signed-off-by: Ben Horgan <[email-masked]>

One trivial below.
Reviewed-by: Jonathan Cameron <[email-masked]>

>  
> 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;