[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H6ZJwWQOhAPmoaH4KYr66LCurKq94f87FQ05yEX6XYoNg@mail.gmail.com>
Date: Thu, 30 May 2024 10:25:01 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Yanteng Si <siyanteng@...ngson.cn>
Cc: andrew@...n.ch, hkallweit1@...il.com, peppe.cavallaro@...com,
alexandre.torgue@...s.st.com, joabreu@...opsys.com, fancer.lancer@...il.com,
Jose.Abreu@...opsys.com, linux@...linux.org.uk, guyinggang@...ngson.cn,
netdev@...r.kernel.org, chris.chenfeiyang@...il.com, si.yanteng@...ux.dev
Subject: Re: [PATCH net-next v13 12/15] net: stmmac: Fixed failure to set
network speed to 1000.
Hi, Yanteng,
The title should be "Fix ....." rather than "Fixed .....", and it is
better to move this patch earlier since it is a preparation for later
Loongson-related patches.
Huacai
On Wed, May 29, 2024 at 6:20 PM Yanteng Si <siyanteng@...ngson.cn> wrote:
>
> Loongson GNET devices with dev revision 0x00 do not
> support manually setting the speed to 1000, When the
> bug is triggered, let's return -EOPNOTSUPP, which
> will be flag in later gnet support patches.
>
> Signed-off-by: Feiyang Chen <chenfeiyang@...ngson.cn>
> Signed-off-by: Yinggang Gu <guyinggang@...ngson.cn>
> Signed-off-by: Yanteng Si <siyanteng@...ngson.cn>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 6 ++++++
> include/linux/stmmac.h | 1 +
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> index 542e2633a6f5..eb4b3eaf9e17 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> @@ -422,6 +422,12 @@ stmmac_ethtool_set_link_ksettings(struct net_device *dev,
> return 0;
> }
>
> + if (priv->plat->flags & STMMAC_FLAG_DISABLE_FORCE_1000) {
> + if (cmd->base.speed == SPEED_1000 &&
> + cmd->base.autoneg != AUTONEG_ENABLE)
> + return -EOPNOTSUPP;
> + }
> +
> return phylink_ethtool_ksettings_set(priv->phylink, cmd);
> }
>
> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index 1536455f9052..3e4f7e8d73fb 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -208,6 +208,7 @@ struct dwmac4_addrs {
> #define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10)
> #define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING BIT(11)
> #define STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY BIT(12)
> +#define STMMAC_FLAG_DISABLE_FORCE_1000 BIT(13)
>
> struct plat_stmmacenet_data {
> int bus_id;
> --
> 2.31.4
>
Powered by blists - more mailing lists