[PATCH net 2/6] net: dsa: vsc73xx: pass value in phy_write operation

Pawel Dembicki posted 6 patches 1 year, 6 months ago
There is a newer version of this series
[PATCH net 2/6] net: dsa: vsc73xx: pass value in phy_write operation
Posted by Pawel Dembicki 1 year, 6 months ago
In the 'vsc73xx_phy_write' function, the register value is missing,
and the phy write operation always sends zeros.

This commit passes the value variable into the proper register.

Fixes: 975ae7c69d51 ("net: phy: vitesse: Add support for VSC73xx")
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
index f548ed4cb23f..4b300c293dec 100644
--- a/drivers/net/dsa/vitesse-vsc73xx-core.c
+++ b/drivers/net/dsa/vitesse-vsc73xx-core.c
@@ -574,7 +574,7 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
 		return 0;
 	}
 
-	cmd = (phy << 21) | (regnum << 16);
+	cmd = (phy << 21) | (regnum << 16) | val;
 	ret = vsc73xx_write(vsc, VSC73XX_BLOCK_MII, 0, 1, cmd);
 	if (ret)
 		return ret;
-- 
2.34.1
Re: [PATCH net 2/6] net: dsa: vsc73xx: pass value in phy_write operation
Posted by Florian Fainelli 1 year, 6 months ago
On 8/2/24 01:03, Pawel Dembicki wrote:
> In the 'vsc73xx_phy_write' function, the register value is missing,
> and the phy write operation always sends zeros.
> 
> This commit passes the value variable into the proper register.
> 
> Fixes: 975ae7c69d51 ("net: phy: vitesse: Add support for VSC73xx")
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

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

> In the 'vsc73xx_phy_write' function, the register value is missing,
> and the phy write operation always sends zeros.
>
> This commit passes the value variable into the proper register.
>
> Fixes: 975ae7c69d51 ("net: phy: vitesse: Add support for VSC73xx")

Actually that should be:
Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")

Yours,
Linus Walleij
Re: [PATCH net 2/6] net: dsa: vsc73xx: pass value in phy_write operation
Posted by Linus Walleij 1 year, 6 months ago
On Fri, Aug 2, 2024 at 10:04 AM Pawel Dembicki <paweldembicki@gmail.com> wrote:

> In the 'vsc73xx_phy_write' function, the register value is missing,
> and the phy write operation always sends zeros.
>
> This commit passes the value variable into the proper register.
>
> Fixes: 975ae7c69d51 ("net: phy: vitesse: Add support for VSC73xx")
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

It makes perfect sense and I have no idea how I managed
to write this bad code or why it worked so far.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij