[PATCH net-next 1/9] net: dsa: vsc73xx: fix phylink capabilities

Pawel Dembicki posted 9 patches 9 months, 2 weeks ago
There is a newer version of this series
[PATCH net-next 1/9] net: dsa: vsc73xx: fix phylink capabilities
Posted by Pawel Dembicki 9 months, 2 weeks ago
According datasheet, VSC73XX family switches supports symmetric and
asymmetric pause and 1000BASE in FD only.

This patch fix it.

Fixes: a026809c261b ("net: dsa: vsc73xx: add phylink capabilities")

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
 drivers/net/dsa/vitesse-vsc73xx-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
index 07b704a1557e..43aeb578d608 100644
--- a/drivers/net/dsa/vitesse-vsc73xx-core.c
+++ b/drivers/net/dsa/vitesse-vsc73xx-core.c
@@ -1491,7 +1491,8 @@ static void vsc73xx_phylink_get_caps(struct dsa_switch *dsa, int port,
 		__set_bit(PHY_INTERFACE_MODE_GMII, interfaces);
 	}
 
-	config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000;
+	config->mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
+				   MAC_10 | MAC_100 | MAC_1000FD;
 }
 
 static int
-- 
2.34.1
Re: [PATCH net-next 1/9] net: dsa: vsc73xx: fix phylink capabilities
Posted by Russell King (Oracle) 9 months, 2 weeks ago
On Mon, Jul 29, 2024 at 11:06:07PM +0200, Pawel Dembicki wrote:
> According datasheet, VSC73XX family switches supports symmetric and
> asymmetric pause and 1000BASE in FD only.

What about the configuration of the pause? I notice the mac_link_up()
method ignores tx_pause/rx_pause, and instead just does this:

        /* Flow control for the PHY facing ports:
         * Use a zero delay pause frame when pause condition is left
         * Obey pause control frames
         * When generating pause frames, use 0xff as pause value
         */
        vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port, VSC73XX_FCCONF,
                      VSC73XX_FCCONF_ZERO_PAUSE_EN |
                      VSC73XX_FCCONF_FLOW_CTRL_OBEY |
                      0xff);

which suggests only symmetric pause is supported by the driver _and_
it is always enabled irrespective of what was negotiated.

I think this needs to be fixed first, before changing the capabilities.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net-next 1/9] net: dsa: vsc73xx: fix phylink capabilities
Posted by Andrew Lunn 9 months, 2 weeks ago
On Mon, Jul 29, 2024 at 11:06:07PM +0200, Pawel Dembicki wrote:
> According datasheet, VSC73XX family switches supports symmetric and
> asymmetric pause and 1000BASE in FD only.
> 
> This patch fix it.
> 
> Fixes: a026809c261b ("net: dsa: vsc73xx: add phylink capabilities")
> 
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

No blank line between tags please.

   Andrew