mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@linux-m68k.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: linux-m68k@lists.linux-m68k.org, 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 1/3] net: fec: do not use readl()/writel() for ColdFire
Date: Thu, 24 Sep 2026 00:00:04 +1000	[thread overview]
Message-ID: <46246a5b-3e95-4ecb-bc52-e374dc136514@linux-m68k.org> (raw)
In-Reply-To: <eb987eb9-f368-4d28-bdd0-c289c3039c3b@lunn.ch>



On 23/9/26 23:23, Andrew Lunn wrote:
> On Wed, Sep 23, 2026 at 11:07:17PM +1000, Greg Ungerer wrote:
>> Ping...
> 
> To: linux-m68k@lists.linux-m68k.org
> 
> ICMP redirect.
> 
>>> The FEC driver works today because the m68k architecture io.h has a
>>> kludge in the definitions of the readl() and writel() functions for
>>> ColdFire that allow big-endian access if the address of the register to
>>> access is within the SoC's internal peripheral registers. This is being
>>> fixed in the near future to define readl() and writel() correctly - with
>>> no byte swapping. Thus the motivation for this fix here.
>>>
>>> __raw_readl()/__raw_writel() access methods are used instead of the more
>>> commonly used ioread32be()/iowrite32be() here because those are broken too,
>>> because of the current readl()/writel() kludge. They are implemented in
>>> asm-generic/io.h in terms of readl()/writel().
>>>
>>> Note that even when readl() and writel() are fixed on ColdFire they will
>>> not be the right thing to use within the FEC driver on ColdFire hardware.
> 
> So what is the end goal here? This patch. Then fix
> readl()/writel(). Then fix ioread32be()/iowrite32be()?

Yes, definitely. Patch 3 in this series completes the fixing of readl()/writel().
That also has the effect of fixing ioread32be()/iowrite32be().


> And then change
> these macros to use ioread32be()/iowrite32be()?

Happy to do that if that is want you want. Ultimately probably the cleanest.


> Are we always going to be using fec_read()/fec_write()?

The driver will always need to support big and little endian hardware, so I
am not sure how to avoid some abstraction like this.

Regards
Greg


  reply	other threads:[~2026-09-23 14:00 UTC|newest]

Thread overview: 16+ 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-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 [this message]
2026-09-23 14:15         ` Andrew Lunn
2026-09-23 14:40           ` Geert Uytterhoeven
2026-09-24  2:32           ` Michael Schmitz
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
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

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=46246a5b-3e95-4ecb-bc52-e374dc136514@linux-m68k.org \
    --to=gerg@linux-m68k.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®