[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2pxumw5ctsnvr2mzqxnj7lvlzttxtokmzhwvswmq7ujigatdsz@mcfh5tlte3cl>
Date: Sun, 5 May 2024 01:13:47 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Yanteng Si <siyanteng@...ngson.cn>
Cc: andrew@...n.ch, hkallweit1@...il.com, peppe.cavallaro@...com,
alexandre.torgue@...s.st.com, joabreu@...opsys.com, Jose.Abreu@...opsys.com,
chenhuacai@...nel.org, linux@...linux.org.uk, guyinggang@...ngson.cn,
netdev@...r.kernel.org, chris.chenfeiyang@...il.com, siyanteng01@...il.com
Subject: Re: [PATCH net-next v12 12/15] net: stmmac: dwmac-loongson: Fixed
failure to set network speed to 1000.
On Thu, Apr 25, 2024 at 09:10:37PM +0800, Yanteng Si wrote:
> GNET devices with dev revision 0x00 do not support manually
> setting the speed to 1000.
>
> 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/dwmac-loongson.c | 8 ++++++++
> drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 6 ++++++
> include/linux/stmmac.h | 1 +
> 3 files changed, 15 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index df5899bec91a..a16bba389417 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -10,6 +10,7 @@
> #include "stmmac.h"
>
> #define PCI_DEVICE_ID_LOONGSON_GMAC 0x7a03
> +#define PCI_DEVICE_ID_LOONGSON_GNET 0x7a13
>
> struct stmmac_pci_info {
> int (*setup)(struct pci_dev *pdev, struct plat_stmmacenet_data *plat);
> @@ -179,6 +180,13 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
>
> ret = loongson_dwmac_config_legacy(pdev, plat, &res, np);
>
> + /* GNET devices with dev revision 0x00 do not support manually
> + * setting the speed to 1000.
> + */
> + if (pdev->device == PCI_DEVICE_ID_LOONGSON_GNET &&
> + pdev->revision == 0x00)
> + plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000;
> +
That's why it's important to wait for the discussions being finished.
If you waited for some time I would have told you that the only part
what was required to move to the separate patch was the changes in the
files:
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
include/linux/stmmac.h
So please move the changes above to the patch
[PATCH net-next v12 13/15] net: stmmac: dwmac-loongson: Add Loongson GNET support
* with the flag setup being done in the loongson_gnet_data() method.
Thus you'll be able to drop the patch 14
[PATCH net-next v12 14/15] net: stmmac: dwmac-loongson: Move disable_force flag to _gnet_date
-Serge(y)
> ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
> if (ret)
> goto err_disable_msi;
> 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 1b54b84a6785..c5d3d0ddb6f8 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -223,6 +223,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