[PATCH net 5/6] net: dsa: vsc73xx: allow phy resetting

Pawel Dembicki posted 6 patches 1 year, 6 months ago
There is a newer version of this series
[PATCH net 5/6] net: dsa: vsc73xx: allow phy resetting
Posted by Pawel Dembicki 1 year, 6 months ago
Now, phy reset isn't a problem for vsc73xx switches.
'soft_reset' can be done normally.

This commit removes the reset blockade in the 'vsc73xx_phy_write'
function.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
This patch came from net-next series[0].
Changes since net-next:
  - rebased to netdev/main only

[0] https://patchwork.kernel.org/project/netdevbpf/patch/20240729210615.279952-6-paweldembicki@gmail.com/
---
 drivers/net/dsa/vitesse-vsc73xx-core.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
index 42b4f312c418..5f63c56db905 100644
--- a/drivers/net/dsa/vitesse-vsc73xx-core.c
+++ b/drivers/net/dsa/vitesse-vsc73xx-core.c
@@ -614,17 +614,6 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
 	if (ret)
 		return ret;
 
-	/* It was found through tedious experiments that this router
-	 * chip really hates to have it's PHYs reset. They
-	 * never recover if that happens: autonegotiation stops
-	 * working after a reset. Just filter out this command.
-	 * (Resetting the whole chip is OK.)
-	 */
-	if (regnum == 0 && (val & BIT(15))) {
-		dev_info(vsc->dev, "reset PHY - disallowed\n");
-		return 0;
-	}
-
 	cmd = FIELD_PREP(VSC73XX_MII_CMD_PHY_ADDR, phy) |
 	      FIELD_PREP(VSC73XX_MII_CMD_PHY_REG, regnum) |
 	      FIELD_PREP(VSC73XX_MII_CMD_WRITE_DATA, val);
-- 
2.34.1
Re: [PATCH net 5/6] net: dsa: vsc73xx: allow phy resetting
Posted by Florian Fainelli 1 year, 6 months ago
On 8/2/24 01:04, Pawel Dembicki wrote:
> Now, phy reset isn't a problem for vsc73xx switches.
> 'soft_reset' can be done normally.
> 
> This commit removes the reset blockade in the 'vsc73xx_phy_write'
> function.
> 
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

Same comment as Linus and Russell, with a better explanation:

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian
Re: [PATCH net 5/6] net: dsa: vsc73xx: allow phy resetting
Posted by Linus Walleij 1 year, 6 months ago
On Fri, Aug 2, 2024 at 10:04 AM Pawel Dembicki <paweldembicki@gmail.com> wrote:

> Now, phy reset isn't a problem for vsc73xx switches.
> 'soft_reset' can be done normally.
>
> This commit removes the reset blockade in the 'vsc73xx_phy_write'
> function.
>
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

Like Russell says, it needs an explanation.

I think it worked because since the phy write operations were
not properly implemented, the PHY relied on power-on
or firmware defaults before, so things just happened to work
on some systems. We were just lucky things worked if we didn't
reset the PHY.

With some explanation like that:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Re: [PATCH net 5/6] net: dsa: vsc73xx: allow phy resetting
Posted by Russell King (Oracle) 1 year, 6 months ago
On Fri, Aug 02, 2024 at 10:04:02AM +0200, Pawel Dembicki wrote:
> Now, phy reset isn't a problem for vsc73xx switches.
> 'soft_reset' can be done normally.
> 
> This commit removes the reset blockade in the 'vsc73xx_phy_write'
> function.

This commit message needs to explain more clearly why a soft reset is no
longer a problem. For example, which patch in this series makes it now
safe to do?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!