mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zeng Heng <zengheng4@huawei.com>
To: <james.morse@arm.com>, <rohit.mathew@arm.com>,
	<amitsinght@marvell.com>, <sdonthineni@nvidia.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <zengheng4@huawei.com>,
	<liwei391@huawei.com>
Subject: [PATCH mpam/v6.10-rc1 RFC 1/4] arm_mpam: Correct MBA granularity calculation
Date: Mon, 22 Jul 2024 12:01:37 +0800	[thread overview]
Message-ID: <20240722040140.515173-2-zengheng4@huawei.com> (raw)
In-Reply-To: <20240722040140.515173-1-zengheng4@huawei.com>

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@huawei.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


  reply	other threads:[~2024-07-22  4:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22  4:01 [PATCH mpam/v6.10-rc1 RFC 0/4] arm_mpam: Fix several minor issues Zeng Heng
2024-07-22  4:01 ` Zeng Heng [this message]
2024-07-22  4:01 ` [PATCH mpam/v6.10-rc1 RFC 2/4] arm_mpam: Fix the range calculation of the implemented bits Zeng Heng
2024-07-22  4:01 ` [PATCH mpam/v6.10-rc1 RFC 3/4] arm_mpam: Correct the judgment condition of the CMAX feature Zeng Heng
2024-07-22  4:01 ` [PATCH mpam/v6.10-rc1 RFC 4/4] arm_mpam: Fix typo about mbw_min controls Zeng Heng
2024-12-20 17:51 ` [PATCH mpam/v6.10-rc1 RFC 0/4] arm_mpam: Fix several minor issues James Morse
2025-01-04 10:28   ` Zeng Heng
  -- strict thread matches above, loose matches on Subject: below --
2024-07-22  4:01 Zeng Heng
2024-07-22  4:01 ` [PATCH mpam/v6.10-rc1 RFC 1/4] arm_mpam: Correct MBA granularity calculation Zeng Heng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240722040140.515173-2-zengheng4@huawei.com \
    --to=zengheng4@huawei.com \
    --cc=amitsinght@marvell.com \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwei391@huawei.com \
    --cc=rohit.mathew@arm.com \
    --cc=sdonthineni@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®