The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@kernel.org>
To: David Laight <david.laight.linux@gmail.com>, Wei Fang <wei.fang@nxp.com>
Cc: "linux-m68k@lists.linux-m68k.org"
	<linux-m68k@lists.linux-m68k.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"arnd@kernel.org" <arnd@kernel.org>,
	Greg Ungerer <gerg@linux-m68k.org>, Frank Li <frank.li@nxp.com>,
	Shenwei Wang <shenwei.wang@nxp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC 1/4] net: fec: do not use readl()/writel() for ColdFire
Date: Fri, 8 May 2026 23:14:07 +1000	[thread overview]
Message-ID: <151f5b1b-8a82-4d7b-b1c9-67da07853806@kernel.org> (raw)
In-Reply-To: <20260508094043.20f5f3fc@pumpkin>


On 8/5/26 18:40, David Laight wrote:
> On Fri, 8 May 2026 02:46:38 +0000
> Wei Fang <wei.fang@nxp.com> wrote:
> 
>>>   static void
>>>   fec_stop(struct net_device *ndev)
>>>   {
>>>   	struct fec_enet_private *fep = netdev_priv(ndev);
>>> -	u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & FEC_RCR_RMII;
>>> +	u32 rmii_mode = fec_readl(fep->hwp + FEC_R_CNTRL) & FEC_RCR_RMII;
>>
>> This is not an issue, but since you changed this line, the new code should
>> follow the "reverse xmas tree" style.
> 
> Looking rmii_mode isn't even used until much later in the function.
> (and then not very often)
> Much better to read it just before it is needed.

Sure, but that feels like a change for a separate patch.
The changes to this file are a global search and replace.
The final produced object is identical before and after.

Regards
Greg


> 	David
> 
> 
>>
>> See: https://elixir.bootlin.com/linux/v7.0.1/source/Documentation/process/maintainer-netdev.rst#L380
>>
>>>   	u32 val;
>>>
>>>   	/* We cannot expect a graceful transmit stop without link !!! */
>>>   	if (fep->link) {
>>> -		writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
>>> +		fec_writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
>>>   		udelay(10);
>>> -		if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
>>> +		if (!(fec_readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
>>>   			netdev_err(ndev, "Graceful transmit stop did not complete!\n");
>>>   	}
>>>    
>>
>>
> 


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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 14:26 [RFC 1/4] net: fec: do not use readl()/writel() for ColdFire Greg Ungerer
2026-05-06 14:26 ` [RFC 2/4] net: smc91x: do not use readw()/writew() on ColdFire platforms Greg Ungerer
2026-05-06 14:26 ` [RFC 3/4] mmc: sdhci-esdhc-mcf: do not use readl()/writel() on ColdFire Greg Ungerer
2026-05-11 15:11   ` Ulf Hansson
2026-05-06 14:26 ` [RFC 4/4] m68k: coldfire: fix non-standard readX()/writeX() functions Greg Ungerer
2026-05-06 16:14   ` Frank Li
2026-05-06 19:12   ` Arnd Bergmann
2026-05-07 12:43     ` Greg Ungerer
2026-05-07 12:59       ` Arnd Bergmann
2026-05-07 13:30   ` Marc Kleine-Budde
2026-05-07 14:33     ` Greg Ungerer
2026-05-08  2:46 ` [RFC 1/4] net: fec: do not use readl()/writel() for ColdFire Wei Fang
2026-05-08  8:40   ` David Laight
2026-05-08 13:14     ` Greg Ungerer [this message]
2026-05-08 13:11   ` 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=151f5b1b-8a82-4d7b-b1c9-67da07853806@kernel.org \
    --to=gerg@kernel.org \
    --cc=arnd@kernel.org \
    --cc=david.laight.linux@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=gerg@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=netdev@vger.kernel.org \
    --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