Skip to contentSkip to conversation

arm_mpam: Fix T241-MPAM-4 workaround

PATCH In review Shanker Donthineni 3 participants 3 messages Aug 19, 2024 – Sep 17, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm_mpam: Fix T241-MPAM-4 workaround

The workaround for T241-MPAM-4 was applied incorrectly, leading to MBW_MIN being programmed with a zero value when the user specifies MBW_MAX is less than 5%.

This patch ensures that MBW_MIN is programmed with a non-zero value, set to 1 to fix the T241-MPAM-4 as expected.

Fixes 13ff1b527e40 ("arm_mpam: Add workaround for T241-MPAM-4")
---
 drivers/platform/arm64/mpam/mpam_devices.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/arm64/mpam/mpam_devices.c +1 -1
index a802ca1c9f05..e49a27c02c66 100644
@@ -2990,7 +2990,7 @@ static void mpam_extend_config(struct mpam_class *class, struct mpam_config *cfg
 	}
 
 	if (mpam_has_quirk(T241_FORCE_MBW_MIN_TO_ONE, class) &&
-	    cfg->mbw_min == 0) {
+	    cfg->mbw_min <= min_hw_granule) {
 		cfg->mbw_min = min_hw_granule + 1;
 		mpam_set_feature(mpam_feat_mbw_min, cfg);
 	}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · On Mon, 19 Aug 2024 17:08:18 -0500 Shanker Donthineni <[email protected]>…

The workaround for T241-MPAM-4 was applied incorrectly, leading to MBW_MIN being programmed with a zero value when the user specifies MBW_MAX is less than 5%.

This patch ensures that MBW_MIN is programmed with a non-zero value, set to 1 to fix the T241-MPAM-4 as expected.

Fixes 13ff1b527e40 ("arm_mpam: Add workaround for T241-MPAM-4")

Hi Shanker,

I can guess which branch this fix is for, but good to mention it in the patch given it's not mainline.

Jonathan

Quoted 17 lines
---
 drivers/platform/arm64/mpam/mpam_devices.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/arm64/mpam/mpam_devices.c +1 -1
index a802ca1c9f05..e49a27c02c66 100644
@@ -2990,7 +2990,7 @@ static void mpam_extend_config(struct mpam_class *class, struct mpam_config *cfg
 	}
 
 	if (mpam_has_quirk(T241_FORCE_MBW_MIN_TO_ONE, class) &&
-	    cfg->mbw_min == 0) {
+	    cfg->mbw_min <= min_hw_granule) {
 		cfg->mbw_min = min_hw_granule + 1;
 		mpam_set_feature(mpam_feat_mbw_min, cfg);
 	}
#2 lore raw
Quoted 10 lines · Jonathan Cameron
Quoted 7 lines · On Mon, 19 Aug 2024 17:08:18 -0500 Shanker Donthineni <[email protected]>…

The workaround for T241-MPAM-4 was applied incorrectly, leading to MBW_MIN being programmed with a zero value when the user specifies MBW_MAX is less than 5%.

This patch ensures that MBW_MIN is programmed with a non-zero value, set to 1 to fix the T241-MPAM-4 as expected.

Quoted 8 lines
Quoted 2 lines
Fixes 13ff1b527e40 ("arm_mpam: Add workaround for T241-MPAM-4")

Hi Shanker,

I can guess which branch this fix is for, but good to mention it in the patch given it's not mainline.

Jonathan

Hi Jonathan,
could you please share the cgit of branch?
Thanks

Quoted 18 lines
Quoted 17 lines
---
  drivers/platform/arm64/mpam/mpam_devices.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/arm64/mpam/mpam_devices.c +1 -1
index a802ca1c9f05..e49a27c02c66 100644
@@ -2990,7 +2990,7 @@ static void mpam_extend_config(struct mpam_class *class, struct mpam_config *cfg
  	}
 
  	if (mpam_has_quirk(T241_FORCE_MBW_MIN_TO_ONE, class) &&
-	    cfg->mbw_min == 0) {
+	    cfg->mbw_min <= min_hw_granule) {
  		cfg->mbw_min = min_hw_granule + 1;
  		mpam_set_feature(mpam_feat_mbw_min, cfg);
  	}