[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240722040140.515173-2-zengheng4@huawei.com>
Date: Mon, 22 Jul 2024 12:01:37 +0800
From: Zeng Heng <zengheng4@...wei.com>
To: <james.morse@....com>, <rohit.mathew@....com>, <amitsinght@...vell.com>,
<sdonthineni@...dia.com>
CC: <linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<zengheng4@...wei.com>, <liwei391@...wei.com>
Subject: [PATCH mpam/v6.10-rc1 RFC 1/4] arm_mpam: Correct MBA granularity calculation
Correct MBA granularity calculation function. As said in the comments,
"bwa_wd is the number of bits implemented in the 0.xxx fixed point
fraction".
Fixes: 867471fefd5c ("SPLIT untested: arm_mpam: resctrl: Add support for MB resource")
Signed-off-by: Zeng Heng <zengheng4@...wei.com>
---
drivers/platform/arm64/mpam/mpam_resctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/arm64/mpam/mpam_resctrl.c
index 2fa732a42d4f..a217f2e1f350 100644
--- a/drivers/platform/arm64/mpam/mpam_resctrl.c
+++ b/drivers/platform/arm64/mpam/mpam_resctrl.c
@@ -523,7 +523,7 @@ static u32 get_mba_granularity(struct mpam_props *cprops)
* bwa_wd is the number of bits implemented in the 0.xxx
* fixed point fraction. 1 bit is 50%, 2 is 25% etc.
*/
- return MAX_MBA_BW / (cprops->bwa_wd + 1);
+ return MAX_MBA_BW / (1 << cprops->bwa_wd);
}
return 0;
--
2.25.1
Powered by blists - more mailing lists