From: Nishanth Menon <nm@ti.com>
To: Justin Stitt <justinstitt@google.com>,
Bill Wendling <morbo@google.com>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Santosh Shilimkar <ssantosh@kernel.org>
Cc: <afd@ti.com>, Nishanth Menon <nm@ti.com>, <llvm@lists.linux.dev>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH V2 06/11] soc: ti: knav_qmss: Fix __iomem annotations and __be32 type
Date: Tue, 12 May 2026 12:06:18 -0500 [thread overview]
Message-ID: <20260512170623.3174416-7-nm@ti.com> (raw)
In-Reply-To: <20260512170623.3174416-1-nm@ti.com>
Fix several address-space and type annotation issues reported by sparse:
- Change pdsp->command from 'void __iomem *' to 'u32 __iomem *' to
match the other union members (acc_command, qos_command); adjust
the offset in knav_queue_load_pdsp() from +0x18 to +0x6 to
preserve the 24-byte offset.
- Fix knav_queue_pdsp_wait() declaration: correct the parameter
annotation from 'u32 * __iomem' (pointer-in-iomem-space) to
'u32 __iomem *' (pointer-to-iomem); use 'unsigned int' for the
timeout parameter instead of bare 'unsigned'; fix the continuation-
line alignment.
- Use IOMEM_ERR_PTR() in knav_queue_map_reg() instead of ERR_PTR()
when returning an error as void __iomem *.
- Annotate the firmware data array as 'const __be32 *' instead of
'u32 *', as be32_to_cpu() requires __be32 input.
Signed-off-by: Nishanth Menon <nm@ti.com>
---
Changes since V1:
- pdsp->command from 'void __iomem *' to 'u32 __iomem *' based on
Andrew's suggestion (it is a more accurate representation anyways).
- Fix ups in commit message
V1: https://lore.kernel.org/all/20260508153211.3688277-7-nm@ti.com/
drivers/soc/ti/knav_qmss.h | 2 +-
drivers/soc/ti/knav_qmss_queue.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index 9325e8ce2e25..037dc1b36645 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -123,7 +123,7 @@ struct knav_pdsp_info {
const char *name;
struct knav_reg_pdsp_regs __iomem *regs;
union {
- void __iomem *command;
+ u32 __iomem *command;
struct knav_reg_acc_command __iomem *acc_command;
u32 __iomem *qos_command;
};
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 50072e9dea37..a747a08115d3 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -477,8 +477,8 @@ static int knav_queue_debug_show(struct seq_file *s, void *v)
DEFINE_SHOW_ATTRIBUTE(knav_queue_debug);
-static inline int knav_queue_pdsp_wait(u32 * __iomem addr, unsigned timeout,
- u32 flags)
+static inline int knav_queue_pdsp_wait(u32 __iomem *addr, unsigned int timeout,
+ u32 flags)
{
unsigned long end;
u32 val = 0;
@@ -1368,7 +1368,7 @@ static void __iomem *knav_queue_map_reg(struct knav_device *kdev,
if (ret) {
dev_err(kdev->dev, "Can't translate of node(%pOFn) address for index(%d)\n",
node, index);
- return ERR_PTR(ret);
+ return IOMEM_ERR_PTR(ret);
}
regs = devm_ioremap_resource(kdev->dev, &res);
@@ -1556,7 +1556,7 @@ static int knav_queue_load_pdsp(struct knav_device *kdev,
int i, ret, fwlen;
const struct firmware *fw;
bool found = false;
- u32 *fwdata;
+ const __be32 *fwdata;
for (i = 0; i < ARRAY_SIZE(knav_acc_firmwares); i++) {
if (knav_acc_firmwares[i]) {
@@ -1578,9 +1578,9 @@ static int knav_queue_load_pdsp(struct knav_device *kdev,
dev_info(kdev->dev, "firmware file %s downloaded for PDSP\n",
knav_acc_firmwares[i]);
- writel_relaxed(pdsp->id + 1, pdsp->command + 0x18);
+ writel_relaxed(pdsp->id + 1, pdsp->command + 0x6);
/* download the firmware */
- fwdata = (u32 *)fw->data;
+ fwdata = (const __be32 *)fw->data;
fwlen = (fw->size + sizeof(u32) - 1) / sizeof(u32);
for (i = 0; i < fwlen; i++)
writel_relaxed(be32_to_cpu(fwdata[i]), pdsp->iram + i);
--
2.47.0
next prev parent reply other threads:[~2026-05-12 17:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 17:06 [PATCH V2 00/11] soc: ti: keystone/k3 navigator queue/dma/ringacc cleanups Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 01/11] soc: ti: knav_qmss: Remove remaining redundant ENOMEM printks Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 02/11] soc: ti: knav_qmss: Rename global kdev to knav_qdev to fix -Wshadow Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 03/11] soc: ti: knav_qmss: Inline lockdep condition in for_each_handle_rcu Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 04/11] soc: ti: knav_qmss: Fix kernel-doc Return: tags Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 05/11] soc: ti: knav_qmss: Use %pe to print PTR_ERR() Nishanth Menon
2026-05-12 17:06 ` Nishanth Menon [this message]
2026-05-12 17:06 ` [PATCH V2 07/11] soc: ti: knav_qmss_acc: Fix kernel-doc Return: tag Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 08/11] soc: ti: knav_dma: Remove unused DMA_PRIO_MASK macro Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 09/11] soc: ti: knav_dma: Remove dead check on unsigned args.args[0] Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 10/11] soc: ti: knav_dma: Use IOMEM_ERR_PTR() in pktdma_get_regs() Nishanth Menon
2026-05-12 17:06 ` [PATCH V2 11/11] soc: ti: k3-ringacc: Use str_enabled_disabled() helper Nishanth Menon
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=20260512170623.3174416-7-nm@ti.com \
--to=nm@ti.com \
--cc=afd@ti.com \
--cc=justinstitt@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=ssantosh@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