The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-mips@vger.kernel.org, John Crispin <john@phrozen.org>,
	Sergio Paracuellos <sergio.paracuellos@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	"open list:ARM/Mediatek SoC support"
	<linux-kernel@vger.kernel.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-arm-kernel@lists.infradead.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH] mips: ralink: mt7621: avoid casting away __iomem in wraparound test
Date: Tue, 17 Nov 2026 17:56:40 +0100	[thread overview]
Message-ID: <avyHSKd4l8YYdESO@alpha.franken.de> (raw)
In-Reply-To: <20261004184828.31284-1-rosenp@gmail.com>

On Sun, Oct 04, 2026 at 11:48:28AM -0700, Rosen Penev wrote:
> CPHYSADDR() casts its argument to an integer, which strips the __iomem
> annotation from dm and triggers a sparse warning. Compute the physical
> address from detect_magic directly. The result is unchanged since the
> sum never exceeds the 512MB KSEG mask.
> 
> Fixes: 4ddaf88aadd3 ("mips: ralink: mt7621: add missing __iomem")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202610041411.uJXWXF8i-lkp@intel.com/
> Assisted-by: LLM
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  arch/mips/ralink/mt7621.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/ralink/mt7621.c b/arch/mips/ralink/mt7621.c
> index ae7b8cfedd5f..2d10c74b13c1 100644
> --- a/arch/mips/ralink/mt7621.c
> +++ b/arch/mips/ralink/mt7621.c
> @@ -65,7 +65,7 @@ static bool __init mt7621_addr_wraparound_test(phys_addr_t size)
>  {
>  	void __iomem *dm = (void __iomem *)KSEG1ADDR(&detect_magic);
>  
> -	if (CPHYSADDR(dm + size) >= MT7621_LOWMEM_MAX_SIZE)
> +	if (CPHYSADDR(&detect_magic) + size >= MT7621_LOWMEM_MAX_SIZE)
>  		return true;
>  	__raw_writel(MT7621_MEM_TEST_PATTERN, dm);
>  	if (__raw_readl(dm) != __raw_readl(dm + size))
> -- 
> 2.56.0

applied to mips-next

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

      reply	other threads:[~2026-11-17 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 18:48 [PATCH] mips: ralink: mt7621: avoid casting away __iomem in wraparound test Rosen Penev
2026-11-17 16:56 ` Thomas Bogendoerfer [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=avyHSKd4l8YYdESO@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=john@phrozen.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rosenp@gmail.com \
    --cc=sergio.paracuellos@gmail.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