From: Raj Vishwanathan <raj.vishwanathan@gmail.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v2] lib: utils: Make sure that hartid and the scratch are aligned
Date: Thu, 13 Feb 2025 11:52:11 -0800 [thread overview]
Message-ID: <20250213195211.15587-1-Raj.Vishwanathan@gmail.com> (raw)
In-Reply-To: <0250109233241.2491-1-cfu@mips.com>
Harts associated with an ACLINT_MSWI need not have sequential hartids.
It is insufficient to use first_hartid and hart_count. To account for
non-sequential hart ids, include the empty hard-ids' generate hart-count.
Signed-off-by: Raj Vishwanathan <Raj.Vishwanathan@gmail.com>
---
hart_count = last_hart_id - first_hart_id +1
count = number of harts
For sequential hart_id's, count = hart_count
For non-sequential hart_id's, count < hart_count
---
lib/utils/fdt/fdt_helper.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index cb350e5..bb3fddd 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -1046,8 +1046,7 @@ int fdt_parse_aclint_node(const void *fdt, int nodeoffset,
if ((last_hartid >= first_hartid) && first_hartid != -1U) {
*out_first_hartid = first_hartid;
- count = last_hartid - first_hartid + 1;
- *out_hart_count = (hart_count < count) ? hart_count : count;
+ *out_hart_count = last_hartid - first_hartid + 1;
}
return 0;
--
2.43.0
next parent reply other threads:[~2025-02-13 19:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0250109233241.2491-1-cfu@mips.com>
2025-02-13 19:52 ` Raj Vishwanathan [this message]
2025-02-13 22:58 ` [PATCH v2] lib: utils: Make sure that hartid and the scratch are aligned Samuel Holland
2025-02-14 6:01 ` Raj Vishwanathan
2025-02-20 22:43 ` Raj Vishwanathan
2025-02-25 2:00 ` Samuel Holland
2025-02-25 5:44 ` Raj Vishwanathan
2025-02-25 21:16 ` [PATCH v3] " Raj Vishwanathan
2025-02-25 21:41 ` Samuel Holland
2025-02-25 22:57 ` Raj Vishwanathan
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=20250213195211.15587-1-Raj.Vishwanathan@gmail.com \
--to=raj.vishwanathan@gmail.com \
--cc=opensbi@lists.infradead.org \
/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