Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Marek Vasut <marex@denx.de>, Wei Fang <wei.fang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>
Subject: Re: [PATCH v2 net-next 6/6] net: phy: realtek: create rtl8211f_config_phy_eee() helper
Date: Thu, 13 Nov 2025 14:13:57 +0200	[thread overview]
Message-ID: <20251113121357.uu3em364s24ehm2q@skbuf> (raw)
In-Reply-To: <9cb3808d-341d-4db2-90c9-12bf412d4a48@lunn.ch>

On Fri, Nov 07, 2025 at 05:18:01PM +0100, Andrew Lunn wrote:
> > It's good you point this out. Somehow, among all transformations, I lost
> > along the way the fact that the soft reset is necessary for disabling
> > clkout on RTL8211F, not for PHY-mode EEE :-/
> > https://elixir.bootlin.com/linux/v6.16.12/source/drivers/net/phy/realtek/realtek_main.c#L598
> > 
> > I checked the RTL8211F datasheet and it doesn't say that changes to the
> > "PHY-mode EEE Enable" field would need a write to 0.15 to take effect.
> > But it does say that about "CLKOUT Source".
> > 
> > Curiously, the RTL8211FVD datasheet doesn't suggest that modifying the
> > CLKOUT source needs a soft reset when providing the steps to do so.
> > 
> > Anyway, this code transformation from patch 6/6 is not buggy per se
> > (even if we change the CLKOUT on RTL8211F, we still get the
> > genphy_soft_reset() that we need), but very misleading and confusing.
> > 
> > pw-bot: cr
> > 
> > > For the Marvell PHYs, lots of registers need a soft reset to put
> > > changes into effect. I would not want to hide the soft reset inside a
> > > helper, because of the danger more calls to helps are added
> > > afterwards.
> > 
> > Ok, I get your point and I agree, but what to do?
> 
> If only the clk out that needs it, i would put it in the clock out
> helper.
> 
> Is a soft reset expensive? Is a soft reset destructive? The marvell
> one is both fast and does not seem to change any registers, it just
> activates changes.
> 
> If you think some other registers might need it, i would probably just
> do it unconditionally after all the configuration, assuming it is
> cheap and non-destructive. Maybe add a comment that at least clk out
> needs its, but other registers might need it as well?
> 
>       Andrew
>

With the risk of being unsatisfactory, I can't answer these questions
without completely throwing off eveything else I have scheduled to do.

The patch was delivered by Clark to a customer a number of years ago,
and the customer hooked up the scope to confirm that CLKOUT is disabled.
The datasheet doesn't suggest that genphy_soft_reset() is needed, but
looking at the BSP implementation, I see we did it anyway:
https://github.com/nxp-qoriq/linux/blob/lf-6.6.y/drivers/net/phy/realtek.c#L427

I think the safest thing to do is to keep the genphy_soft_reset() in the
CLKOUT configuration procedure, regardless of PHY version, which is what
I am going to do for v3.

  reply	other threads:[~2025-11-13 12:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 11:08 [PATCH v2 net-next 0/6] Disable CLKOUT on RTL8211F(D)(I)-VD-CG Vladimir Oltean
2025-11-07 11:08 ` [PATCH v2 net-next 1/6] net: phy: realtek: create rtl8211f_config_rgmii_delay() Vladimir Oltean
2025-11-07 13:27   ` Andrew Lunn
2025-11-07 11:08 ` [PATCH v2 net-next 2/6] net: phy: realtek: eliminate priv->phycr2 variable Vladimir Oltean
2025-11-07 13:27   ` Andrew Lunn
2025-11-07 11:08 ` [PATCH v2 net-next 3/6] net: phy: realtek: eliminate has_phycr2 variable Vladimir Oltean
2025-11-07 11:08 ` [PATCH v2 net-next 4/6] net: phy: realtek: allow CLKOUT to be disabled on RTL8211F(D)(I)-VD-CG Vladimir Oltean
2025-11-07 13:29   ` Andrew Lunn
2025-11-07 11:08 ` [PATCH v2 net-next 5/6] net: phy: realtek: eliminate priv->phycr1 variable Vladimir Oltean
2025-11-07 13:30   ` Andrew Lunn
2025-11-07 11:08 ` [PATCH v2 net-next 6/6] net: phy: realtek: create rtl8211f_config_phy_eee() helper Vladimir Oltean
2025-11-07 13:34   ` Andrew Lunn
2025-11-07 14:32     ` Vladimir Oltean
2025-11-07 16:18       ` Andrew Lunn
2025-11-13 12:13         ` Vladimir Oltean [this message]
2025-11-13 14:03           ` Andrew Lunn

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=20251113121357.uu3em364s24ehm2q@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@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