From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net] net: phy: fix phy_uses_state_machine()
Date: Mon, 1 Sep 2025 12:35:30 +0300 [thread overview]
Message-ID: <20250901093530.v5surl2wgpusedph@skbuf> (raw)
In-Reply-To: <aLVivd71G4P4pU0U@shell.armlinux.org.uk>
On Mon, Sep 01, 2025 at 10:09:17AM +0100, Russell King (Oracle) wrote:
> On Mon, Sep 01, 2025 at 11:42:25AM +0300, Vladimir Oltean wrote:
> > On Sun, Aug 31, 2025 at 05:38:11PM +0100, Russell King (Oracle) wrote:
> > > phydev->phy_link_change is initialised by phy_attach_direct(), and
> > > overridden by phylink. This means that a never-connected PHY will
> > > have phydev->phy_link_change set to NULL, which causes
> > > phy_uses_state_machine() to return true. This is incorrect.
> >
> > Another nitpick regarding phrasing here: the never-connected PHY doesn't
> > _cause_ phy_uses_state_machine() to return true. It returns true _in
> > spite_ of the PHY never being connected: the non-NULL quality of
> > phydev->phy_link_change is not something that phy_uses_state_machine()
> > tests for.
>
> No. What I'm saying is that if phydev->phy_link_change is set to NULL,
> _this_ causes phy_uses_state_machine() to return true and that
> behaviour incorrect.
>
> The first part is describing _when_ phydev->phy_link_change is set to
> NULL.
>
> It is not saying that a never-connected PHY directly causes
> phy_uses_state_machine() to return true.
>
> I think my phrasing of this is totally fine, even re-reading it now.
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
I think the language is sufficiently flexible for us to find a phrasing
that avoids all ambiguity. What about:
"It was assumed the only two valid values for phydev->phy_link_change
are phy_link_change() and phylink_phy_change(), thus phy_uses_state_machine()
was oversimplified to only compare with one of these values. There is a
third possible value (NULL), meaning that the PHY is unconnected, and
does not use the state machine. This logic misinterprets this case as
phy_uses_state_machine() == true, but in reality it should return false."
next prev parent reply other threads:[~2025-09-01 9:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-31 16:38 [PATCH net] net: phy: fix phy_uses_state_machine() Russell King (Oracle)
2025-09-01 8:09 ` Vladimir Oltean
2025-09-01 8:42 ` Vladimir Oltean
2025-09-01 9:09 ` Russell King (Oracle)
2025-09-01 9:35 ` Vladimir Oltean [this message]
2025-09-01 10:05 ` Russell King (Oracle)
2025-09-01 10:36 ` Vladimir Oltean
2025-09-01 14:14 ` Russell King (Oracle)
2025-09-01 14:25 ` Vladimir Oltean
2025-09-01 9:34 ` Russell King (Oracle)
2025-09-01 9:39 ` Vladimir Oltean
2025-09-01 10:23 ` Russell King (Oracle)
-- strict thread matches above, loose matches on Subject: below --
2025-09-07 20:44 Russell King (Oracle)
2025-09-08 13:37 ` Vladimir Oltean
2025-09-09 23:50 ` patchwork-bot+netdevbpf
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=20250901093530.v5surl2wgpusedph@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=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).