From aedc75cf78fca1c8b7052c5d59981354f47e2e48 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 14 Feb 2020 13:32:36 +0000 Subject: net: dsa: debugging prints Signed-off-by: Russell King --- drivers/net/dsa/mv88e6xxx/port.c | 12 ++++++++++++ net/dsa/port.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c index 2359964e0e59..996c9810e09e 100644 --- a/drivers/net/dsa/mv88e6xxx/port.c +++ b/drivers/net/dsa/mv88e6xxx/port.c @@ -62,6 +62,10 @@ int mv88e6185_port_set_pause(struct mv88e6xxx_chip *chip, int port, else reg &= ~MV88E6XXX_PORT_STS_MY_PAUSE; + if (reg & MV88E6XXX_PORT_MAC_CTL_FORCE_LINK && + reg & MV88E6XXX_PORT_MAC_CTL_LINK_UP) + dev_err(chip->dev, "p%d: %s with port up\n", port, __func__); + return mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_STS, reg); } @@ -104,6 +108,10 @@ static int mv88e6xxx_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port, return 0; } + if (reg & MV88E6XXX_PORT_MAC_CTL_FORCE_LINK && + reg & MV88E6XXX_PORT_MAC_CTL_LINK_UP) + dev_err(chip->dev, "p%d: %s with port up\n", port, __func__); + err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_MAC_CTL, reg); if (err) return err; @@ -279,6 +287,10 @@ static int mv88e6xxx_port_set_speed_duplex(struct mv88e6xxx_chip *chip, } reg |= ctrl; + if (reg & MV88E6XXX_PORT_MAC_CTL_FORCE_LINK && + reg & MV88E6XXX_PORT_MAC_CTL_LINK_UP) + dev_err(chip->dev, "p%d: %s with port up\n", port, __func__); + err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_MAC_CTL, reg); if (err) return err; diff --git a/net/dsa/port.c b/net/dsa/port.c index d0758b0e59ff..cd013f5d91de 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -1411,6 +1411,8 @@ static void dsa_port_phylink_mac_config(struct phylink_config *config, if (!ds->ops->phylink_mac_config) return; + dev_printk(KERN_DEBUG, ds->dev, "p%d: %s()\n", dp->index, __func__); + ds->ops->phylink_mac_config(ds, dp->index, mode, state); } @@ -1437,6 +1439,8 @@ static void dsa_port_phylink_mac_link_down(struct phylink_config *config, struct phy_device *phydev = NULL; struct dsa_switch *ds = dp->ds; + dev_printk(KERN_DEBUG, ds->dev, "p%d: %s()\n", dp->index, __func__); + if (dsa_port_is_user(dp)) phydev = dp->slave->phydev; @@ -1459,6 +1463,8 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config, struct dsa_port *dp = container_of(config, struct dsa_port, pl_config); struct dsa_switch *ds = dp->ds; + dev_printk(KERN_DEBUG, ds->dev, "p%d: %s()\n", dp->index, __func__); + if (!ds->ops->phylink_mac_link_up) { if (ds->ops->adjust_link && phydev) ds->ops->adjust_link(ds, dp->index, phydev); -- cgit