All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@linux-m68k.org>
To: linux-m68k@lists.linux-m68k.org
Cc: linux-kernel@vger.kernel.org, arnd@kernel.org, wei.fang@nxp.com,
	frank.li@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev,
	netdev@vger.kernel.org, nico@fluxnic.net,
	linux-can@vger.kernel.org, linux-spi@vger.kernel.org,
	olteanv@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Subject: Re: [PATCHv3 2/3] net: smc91x: do not use readw()/writew() on ColdFire platforms
Date: Wed, 23 Sep 2026 23:04:56 +1000	[thread overview]
Message-ID: <6fa8c6f6-64cd-4204-a9db-6a33f5e23117@linux-m68k.org> (raw)
In-Reply-To: <20260907134037.1855408-3-gerg@linux-m68k.org>

Ping...

On 7/9/26 23:37, Greg Ungerer wrote:
> Modify the access macros and functions used to access the smsc hardware
> registers when used on ColdFire SoC platforms so they do not use readw()
> or writew(), or derived functions like ioread16be() and iowrite16be().
> 
> The current set of readX()/writeX() access methods for ColdFire have
> historically been non-standard, in that they mostly access memory
> big-endian instead of the expected little-endian. Before fixing the
> ColdFire readX() and writeX() supporting code to properly work with
> little-endian data existing driver uses need to be fixed. Convert the
> smsc driver ColdFire uses of these to use the raw access macros - which
> are well defined to be (native) big-endian on ColdFire. This change
> requires some byte swapping at time of access to retain existing correct
> behavior.
> 
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> ---
> v2: changed from RFC to PATCH
> v3: no change
> 
> Resending with expanded CC list as per get_maintainers.pl, hoping to get
> this picked up.
> 
>  drivers/net/ethernet/smsc/smc91x.h | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
> index 38aa4374e813..1290335629c1 100644
> --- a/drivers/net/ethernet/smsc/smc91x.h
> +++ b/drivers/net/ethernet/smsc/smc91x.h
> @@ -142,22 +142,26 @@ static inline void _SMC_outw_align4(u16 val, void __iomem *ioaddr, int reg,
>  #define SMC_CAN_USE_32BIT	0
>  #define SMC_NOWAIT		1
>  
> +/*
> + * Access SMSC device registers using raw IO access primitives. Byte
> + * swap as required for device registers, but not data.
> + */
>  static inline void mcf_insw(void __iomem *a, unsigned char *p, int l)
>  {
>  	u16 *wp = (u16 *) p;
>  	while (l-- > 0)
> -		*wp++ = readw(a);
> +		*wp++ = __raw_readw(a);
>  }
>  
>  static inline void mcf_outsw(void __iomem *a, unsigned char *p, int l)
>  {
>  	u16 *wp = (u16 *) p;
>  	while (l-- > 0)
> -		writew(*wp++, a);
> +		__raw_writew(*wp++, a);
>  }
>  
> -#define SMC_inw(a, r)		ioread16be((a) + (r))
> -#define SMC_outw(lp, v, a, r)	iowrite16be(v, (a) + (r))
> +#define SMC_inw(a, r)		swab16(__raw_readw((a) + (r)))
> +#define SMC_outw(lp, v, a, r)	__raw_writew(swab16(v), (a) + (r))
>  #define SMC_insw(a, r, p, l)	mcf_insw(a + r, p, l)
>  #define SMC_outsw(a, r, p, l)	mcf_outsw(a + r, p, l)
>  


  reply	other threads:[~2026-09-23 13:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 13:37 [PATCHv3 0/3] m68k: coldfire: fix non-standard readX()/writeX() functions Greg Ungerer
2026-09-07 13:37 ` [PATCHv3 1/3] net: fec: do not use readl()/writel() for ColdFire Greg Ungerer
2026-09-08 13:43   ` sashiko-bot
2026-09-11 13:09     ` Greg Ungerer
2026-09-11  0:42   ` Jakub Kicinski
2026-09-11  7:39     ` Arnd Bergmann
2026-09-11 13:03     ` Greg Ungerer
2026-09-11 23:04       ` Jakub Kicinski
2026-09-23 13:07   ` Greg Ungerer
2026-09-23 13:23     ` Andrew Lunn
2026-09-23 14:00       ` Greg Ungerer
2026-09-23 14:15         ` Andrew Lunn
2026-09-23 14:40           ` Geert Uytterhoeven
2026-09-24  2:32           ` Michael Schmitz
2026-09-28 12:59           ` Greg Ungerer
2026-09-28 14:12             ` Andrew Lunn
2026-09-07 13:37 ` [PATCHv3 2/3] net: smc91x: do not use readw()/writew() on ColdFire platforms Greg Ungerer
2026-09-23 13:04   ` Greg Ungerer [this message]
2026-09-23 21:31   ` Arnd Bergmann
2026-09-07 13:37 ` [PATCHv3 3/3] m68k: coldfire: fix non-standard readX()/writeX() functions Greg Ungerer
2026-09-08 13:43   ` sashiko-bot

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=6fa8c6f6-64cd-4204-a9db-6a33f5e23117@linux-m68k.org \
    --to=gerg@linux-m68k.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=arnd@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.