[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2xl2icmnhym4pzikivo6wqeyqny6ewrbqlfvsxrisykztdcaip@mp54uqtmrgyf>
Date: Fri, 14 Jun 2024 19:38:40 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Andrew Halaney <ahalaney@...hat.com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Jose Abreu <joabreu@...opsys.com>, linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com, Maxime Coquelin <mcoquelin.stm32@...il.com>,
netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
Romain Gantois <romain.gantois@...tlin.com>
Subject: Re: [PATCH net-next v2 1/5] net: stmmac: add select_pcs() platform
method
Hi Russell
On Thu, Jun 13, 2024 at 11:36:06AM +0100, Russell King (Oracle) wrote:
> Allow platform drivers to provide their logic to select an appropriate
> PCS.
>
> Tested-by: Romain Gantois <romain.gantois@...tlin.com>
> Reviewed-by: Romain Gantois <romain.gantois@...tlin.com>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++++
> include/linux/stmmac.h | 4 +++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index bbedf2a8c60f..302aa4080de3 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -949,6 +949,13 @@ static struct phylink_pcs *stmmac_mac_select_pcs(struct phylink_config *config,
> phy_interface_t interface)
> {
> struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
> + struct phylink_pcs *pcs;
> +
> + if (priv->plat->select_pcs) {
> + pcs = priv->plat->select_pcs(priv, interface);
> + if (!IS_ERR(pcs))
> + return pcs;
> + }
>
> if (priv->hw->xpcs)
> return &priv->hw->xpcs->pcs;
> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index 8f0f156d50d3..9c54f82901a1 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -13,7 +13,7 @@
> #define __STMMAC_PLATFORM_DATA
>
> #include <linux/platform_device.h>
> -#include <linux/phy.h>
> +#include <linux/phylink.h>
>
> #define MTL_MAX_RX_QUEUES 8
> #define MTL_MAX_TX_QUEUES 8
> @@ -271,6 +271,8 @@ struct plat_stmmacenet_data {
> void (*dump_debug_regs)(void *priv);
> int (*pcs_init)(struct stmmac_priv *priv);
> void (*pcs_exit)(struct stmmac_priv *priv);
> + struct phylink_pcs *(*select_pcs)(struct stmmac_priv *priv,
> + phy_interface_t interface);
Just a small note/nitpick. We've got pcs_init() and pcs_exit()
callbacks. Both of them have the pcs_ prefix followed by the action
verb. What about using the same notation for the PCS-select method,
using the plat_stmmacenet_data::pcs_select() callback-name instead?
-Serge(y)
> void *bsp_priv;
> struct clk *stmmac_clk;
> struct clk *pclk;
> --
> 2.30.2
>
Powered by blists - more mailing lists