DMA Engine development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: dmaengine@vger.kernel.org, vkoul@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH] dmaengine: at_hdmac: fix sparse '__iomem' cast warning in memset helpers
Date: Thu, 23 Jul 2026 05:14:41 +0000	[thread overview]
Message-ID: <20260723051441.EB1E51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260723050335.270146-1-rosenp@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Low] The patch leaves a redundant `(u32 *)` cast in `atc_prep_dma_memset_sg()` despite the commit message claiming to eliminate it.

Pre-existing issues:
- [High] Scatter-gather memset does not duplicate the fill byte across the 32-bit hardware transfer word, breaking memset for non-zero values.
--

--- Patch [1]: [PATCH] dmaengine: at_hdmac: fix sparse '__iomem' cast warning in memset helpers ---
commit dc753f3b1d4af7a33d407969b7dd8472cf0ea85c
Author: Rosen Penev <rosenp@gmail.com>

dmaengine: at_hdmac: fix sparse '__iomem' cast warning in memset helpers

This commit fixes a sparse warning caused by assigning a dma pool pointer
to an iomem pointer. It changes the type of the memset_vaddr to match its
actual usage and removes the need for type casting.

Link: https://lore.kernel.org/oe-kbuild-all/202607231110.8MqNRj0Q-lkp@intel.com/

> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index e5b30a57c477a..f9c336630fa25 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c

[ ... ]

> @@ -1168,7 +1168,7 @@ atc_prep_dma_memset_sg(struct dma_chan *chan,
>  	struct at_dma		*atdma = to_at_dma(chan->device);
>  	struct at_desc		*desc;
>  	struct scatterlist	*sg;
> -	void __iomem		*vaddr;
> +	u32			*vaddr;
>  	dma_addr_t		paddr;
>  	size_t			total_len = 0;
>  	int			i;

Further down in atc_prep_dma_memset_sg(), the code assigns the fill value
to vaddr:

> 	*(u32*)vaddr = value;

[Severity: High]
This is a pre-existing issue, but does this assignment properly duplicate the
fill byte across the 32-bit transfer word for non-zero values?

In atc_prep_dma_memset(), the fill pattern is explicitly shifted and combined
across all 4 bytes. Here it seems to just assign the raw value directly. Could
this result in the DMA hardware copying a pattern like 0x000000AB instead of
0xABABABAB, zeroing out 3 out of every 4 bytes for non-zero fills?

[Severity: Low]
This isn't a bug, but since vaddr is now declared as u32 *, is the (u32 *)
cast still needed here?

The commit message states that changing the vaddr type eliminates the need for
the cast, but it looks like the cast was only removed in atc_prep_dma_memset()
and remains here in atc_prep_dma_memset_sg().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260723050335.270146-1-rosenp@gmail.com?part=1

      reply	other threads:[~2026-07-23  5:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  5:03 [PATCH] dmaengine: at_hdmac: fix sparse '__iomem' cast warning in memset helpers Rosen Penev
2026-07-23  5:14 ` sashiko-bot [this message]

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=20260723051441.EB1E51F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=rosenp@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@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