[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbjNn+C/VHegH2t7@shell.armlinux.org.uk>
Date: Tue, 30 Jan 2024 10:21:19 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Choong Yong Liang <yong.liang.choong@...ux.intel.com>
Cc: Rajneesh Bhardwaj <irenic.rajneesh@...il.com>,
David E Box <david.e.box@...ux.intel.com>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <Jose.Abreu@...opsys.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Richard Cochran <richardcochran@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Andrew Halaney <ahalaney@...hat.com>,
Simon Horman <simon.horman@...igine.com>,
Serge Semin <fancer.lancer@...il.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
platform-driver-x86@...r.kernel.org, linux-hwmon@...r.kernel.org,
bpf@...r.kernel.org, Voon Wei Feng <weifeng.voon@...el.com>,
Michael Sit Wei Hong <michael.wei.hong.sit@...el.com>,
Lai Peter Jun Ann <jun.ann.lai@...el.com>,
Abdul Rahim Faizal <faizal.abdul.rahim@...el.com>
Subject: Re: [PATCH net-next v4 06/11] net: stmmac: resetup XPCS according to
the new interface mode
On Mon, Jan 29, 2024 at 09:02:48PM +0800, Choong Yong Liang wrote:
> XPCS creation will map the configuration for the provided interface mode.
> Then XPCS will operate according to the interface mode.
>
> When the interface mode changes, XPCS is required to map the configuration
> to the new interface mode and destroy the old interface mode where it
> is not in use.
>
> Signed-off-by: Choong Yong Liang <yong.liang.choong@...ux.intel.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +-
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 +++++++++++--
> drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 7 +++----
> 3 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> index f155e4841c62..886efd26991e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> @@ -357,7 +357,7 @@ enum stmmac_state {
> int stmmac_mdio_unregister(struct net_device *ndev);
> int stmmac_mdio_register(struct net_device *ndev);
> int stmmac_mdio_reset(struct mii_bus *mii);
> -int stmmac_xpcs_setup(struct mii_bus *mii);
> +int stmmac_xpcs_setup(struct mii_bus *mii, phy_interface_t interface);
> void stmmac_set_ethtool_ops(struct net_device *netdev);
>
> int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags);
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 00af5a4195fd..50429c985441 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -941,8 +941,17 @@ static struct phylink_pcs *stmmac_mac_select_pcs(struct phylink_config *config,
> {
> struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
>
> - if (priv->hw->xpcs)
> + if (priv->hw->xpcs) {
> + if (interface != PHY_INTERFACE_MODE_NA &&
> + interface != priv->plat->phy_interface) {
> + /* When there are major changes, we reconfigure
> + * the setup for xpcs according to the interface.
> + */
> + xpcs_destroy(priv->hw->xpcs);
> + stmmac_xpcs_setup(priv->mii, interface);
NAK. Absolutely not. You haven't read the phylink documentation, nor
understood how phylink works.
Since you haven't read the phylink documentation, I'm not going to
waste any more time reviewing this series since you haven't done your
side of the bargin here.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists