mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: "Ahmad Fatoum" <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org,
	zhengxiaojun <zheng.xiaojun@foxmail.com>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>
Subject: Re: [PATCH] fixup! net: designware_eqs: set upper 32bit address for DMA descriptors to support 64-bit addressing
Date: Thu, 06 Aug 2026 13:04:31 +0000	[thread overview]
Message-ID: <E1wrxlv-0000000FsgQ-0NZx@pty.whiteo.stw.pengutronix.de> (raw)
In-Reply-To: <20260805142143.3845127-2-a.fatoum@pengutronix.de>

On 2026-08-05 16:21, Ahmad Fatoum wrote:
> net: designware_eqos: fix left shift count >= width of type
> 
> CI builds with -Werror, including -Werror=shift-count-overflow, which
> fails for STM32MP enabled platform that use EQOS on a 32-bit platform.
> 
> As des1 will have always been programmed to zero on a 32-bit platform,
> we can just suppress the warning with a cast.
> 
> Cc: zhengxiaojun <zheng.xiaojun@foxmail.com>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/net/designware_eqos.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
> index 332dc7eb7366..4011b006dd70 100644
> --- a/drivers/net/designware_eqos.c
> +++ b/drivers/net/designware_eqos.c
> @@ -955,8 +955,8 @@ void eqos_remove(struct device *dev)
>  
>  	mdiobus_unregister(&eqos->miibus);
>  
> -	dma = eqos->rx_descs[0].des1;
> -	dma = (dma << 32) + eqos->rx_descs[0].des0;
> +	dma = (u64)eqos->rx_descs[0].des1 << 32;
> +	dma |= eqos->rx_descs[0].des0;

I also stumbled upon this and was halfway through implementing an
alternative: keep the virtual address around in private data so that
we can directly use it instead of reconstructing it from the descriptor
ring. I've sent it out now.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2026-08-06 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 14:21 Ahmad Fatoum
2026-08-06 13:04 ` Sascha Hauer [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=E1wrxlv-0000000FsgQ-0NZx@pty.whiteo.stw.pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=zheng.xiaojun@foxmail.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