From: Linkui Xiao <xiaolinkui@126.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, rosenp@gmail.com,
jacob.e.keller@intel.com, daniel.machon@microchip.com,
chunkeey@gmail.com, kees+treewide@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Linkui Xiao <xiaolinkui@kylinos.cn>
Subject: Re: [PATCH net] net: ibm: emac: attach the fixed-link PHY with of_phy_connect()
Date: Tue, 24 Nov 2026 16:39:57 +0800 [thread overview]
Message-ID: <20261124083957.2480682-1-xiaolinkui@126.com> (raw)
In-Reply-To: <4ed4f82b-3ff8-467b-9127-bdc29d498ae4@lunn.ch>
Hi Andrew,
Thanks for the review.
> The whole point of fixed-link is that it works like a real PHY. You
> should not special case it other than when creating it and destroying
> it. You should call phy_start/phy_stop. When start is called, phylib
> will call the adjust link callback, same as a real PHY, and setup the
> MAC as needed.
Done. v3 drops both the hand called emac_adjust_link() and v2's
phy_read_status(): the fixed PHY is attached with of_phy_connect() and
started with phy_start(), and phylib resolves the link and calls the
callback. phy_stop() comes from phy_disconnect() in emac_remove() and on
the probe error path. The only special casing left is creating and
destroying the fixed PHY.
phy_start() stays in emac_init_phy() rather than moving to emac_open(),
because that is where this driver already starts the phy-handle PHY
(emac_mdio_init_phy()). Moving only the fixed link to open/close would
special case it again, and moving both paths is a larger change to code I
cannot test here. Say the word and I will send that to net-next
separately.
I was wrong that a fixed link has no reason to run the state machine.
emac_adjust_link() does not program the MAC either, it only copies speed,
duplex and pause into dev->phy, which emac_configure() reads at open.
phy_start() is called from emac_init_phy(), before register_netdev(), so
the state machine is queued before userspace can bring the interface up.
v3 is posted as a new thread.
Cross compiled for powerpc out of ppc44x_defconfig with W=1, clean. No
hardware here, so no runtime test.
Thanks,
Linkui
next prev parent reply other threads:[~2026-11-24 8:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 7:53 [PATCH net] net: ibm: emac: attach the fixed-link PHY with of_phy_connect() Linkui Xiao
2026-11-13 13:50 ` Andrew Lunn
2026-11-23 9:10 ` Linkui Xiao
2026-11-23 14:54 ` Andrew Lunn
2026-11-24 8:39 ` Linkui Xiao [this message]
2026-11-16 13:51 ` netdev-bot+sashiko
2026-11-23 9:20 ` Linkui Xiao
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=20261124083957.2480682-1-xiaolinkui@126.com \
--to=xiaolinkui@126.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=chunkeey@gmail.com \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kees+treewide@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rosenp@gmail.com \
--cc=xiaolinkui@kylinos.cn \
/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