From: Rosen Penev <rosenp@gmail.com>
To: linux-pm@vger.kernel.org
Cc: Georgi Djakov <djakov@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Rosen Penev <rosenp@gmail.com>,
linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM MAILING
LIST), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] interconnect: qcom: fix endian annotations of BCM aux data
Date: Tue, 22 Sep 2026 11:27:11 -0700 [thread overview]
Message-ID: <20260922182711.25176-1-rosenp@gmail.com> (raw)
struct qcom_icc_bcm::aux_data stores the values parsed from the command
db, converted to native byte order, but is typed as the raw little-endian
struct bcm_db. Sparse therefore complains when the converted values are
assigned to the __le32/__le16 fields and when those restricted fields
are used in bandwidth calculations.
Give aux_data its own native-endian struct type so the parsed values are
stored with matching annotations, keeping struct bcm_db as the on-disk
format returned by cmd_db_read_aux_data(). No functional change.
Fixes: c96fc14322ce ("interconnect: qcom: add COMPILE_TEST")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609221350.3Y8MOce9-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/interconnect/qcom/icc-rpmh.h | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/interconnect/qcom/icc-rpmh.h b/drivers/interconnect/qcom/icc-rpmh.h
index 09d8791402dc..30ec31eafcfb 100644
--- a/drivers/interconnect/qcom/icc-rpmh.h
+++ b/drivers/interconnect/qcom/icc-rpmh.h
@@ -45,6 +45,9 @@ struct qcom_icc_provider {
* @width: multiplier used to convert bytes/sec bw value to an RPMh msg
* @vcd: virtual clock domain that this bcm belongs to
* @reserved: reserved field
+ *
+ * This is the little-endian on-disk format returned by
+ * cmd_db_read_aux_data().
*/
struct bcm_db {
__le32 unit;
@@ -53,6 +56,20 @@ struct bcm_db {
u8 reserved;
};
+/**
+ * struct bcm_aux_data - Auxiliary data of a BCM in native byte order
+ * @unit: divisor used to convert bytes/sec bw value to an RPMh msg
+ * @width: multiplier used to convert bytes/sec bw value to an RPMh msg
+ * @vcd: virtual clock domain that this bcm belongs to
+ * @reserved: reserved field
+ */
+struct bcm_aux_data {
+ u32 unit;
+ u16 width;
+ u8 vcd;
+ u8 reserved;
+};
+
#define MAX_PORTS 4
/**
@@ -135,7 +152,7 @@ struct qcom_icc_bcm {
u32 enable_mask;
bool dirty;
bool keepalive;
- struct bcm_db aux_data;
+ struct bcm_aux_data aux_data;
struct list_head list;
struct list_head ws_list;
size_t num_nodes;
--
2.55.0
next reply other threads:[~2026-09-22 18:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 18:27 Rosen Penev [this message]
2026-09-23 8:52 ` Konrad Dybcio
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=20260922182711.25176-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=djakov@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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
all inboxes | Powered by JetHome®