Message ID | 20240713060944.2725647-3-zengheng4@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm_mpam: Fix several minor issues | expand |
diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/arm64/mpam/mpam_resctrl.c index a217f2e1f350..e87fca6fc5fd 100644 --- a/drivers/platform/arm64/mpam/mpam_resctrl.c +++ b/drivers/platform/arm64/mpam/mpam_resctrl.c @@ -585,7 +585,7 @@ static u16 percent_to_mbw_max(u8 pc, struct mpam_props *cprops) break; } - value &= GENMASK(15, 15 - cprops->bwa_wd); + value &= GENMASK(15, 15 - cprops->bwa_wd + 1); return value; }
The implemented bits of the MAX field in the MPAMCFG_{MBW_MAX, CMAX} register are always to the left of the field, so the validated range should be like [15, 15 - width + 1]. Fixes: 867471fefd5c ("SPLIT untested: arm_mpam: resctrl: Add support for MB resource") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/arm64/mpam/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)