Message ID | 0ec0ae938964697010b3d035b7885e4dda89b012.1690439335.git.chenfeiyang@loongson.cn (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | stmmac: Add Loongson platform support | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply |
On Thu, Jul 27, 2023 at 03:18:51PM +0800, Feiyang Chen wrote:
> Loongson GMAC does not support Flow Control featurei. Use
No i in feature.
Andrew
On Thu, Jul 27, 2023 at 6:36 PM Andrew Lunn <andrew@lunn.ch> wrote: > > On Thu, Jul 27, 2023 at 03:18:51PM +0800, Feiyang Chen wrote: > > Loongson GMAC does not support Flow Control featurei. Use > > No i in feature. > Hi, Andrew, Sorry for the typo. Thanks, Feiyang > Andrew
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c index 3ab55340a6b8..439a5f8bcabe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c @@ -61,6 +61,8 @@ static int loongson_gmac_data(struct pci_dev *pdev, plat->phy_addr = -1; plat->phy_interface = PHY_INTERFACE_MODE_RGMII_ID; + plat->disable_flow_control = true; + return 0; } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 829de274e75d..4f69cad0be42 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3829,6 +3829,11 @@ static int __stmmac_open(struct net_device *dev, __func__, ret); goto init_phy_error; } + + if (priv->plat->disable_flow_control) { + phy_support_sym_pause(dev->phydev); + phy_set_sym_pause(dev->phydev, false, false, true); + } } /* Extra statistics */ diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index e21076f57205..54b9f308aabb 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -345,5 +345,6 @@ struct plat_stmmacenet_data { const struct dwmac_regs *dwmac_regs; bool dwmac_is_loongson; int has_lgmac; + bool disable_flow_control; }; #endif
Loongson GMAC does not support Flow Control featurei. Use disable_flow_control flag to disable it. Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> --- drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 2 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++++ include/linux/stmmac.h | 1 + 3 files changed, 8 insertions(+)