netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: mscc: add missing shift for media operation mode selection
@ 2020-02-26 14:40 Antoine Tenart
  2020-02-26 15:50 ` Andrew Lunn
  2020-02-27  4:51 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Antoine Tenart @ 2020-02-26 14:40 UTC (permalink / raw)
  To: davem, andrew, f.fainelli, hkallweit1
  Cc: Antoine Tenart, netdev, linux-kernel, linux

This patch adds a missing shift for the media operation mode selection.
This does not fix the driver as the current operation mode (copper) has
a value of 0, but this wouldn't work for other modes.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/net/phy/mscc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
index 937ac7da2789..880425466bc8 100644
--- a/drivers/net/phy/mscc.c
+++ b/drivers/net/phy/mscc.c
@@ -2813,8 +2813,8 @@ static int vsc8584_config_init(struct phy_device *phydev)
 
 	val = phy_read(phydev, MSCC_PHY_EXT_PHY_CNTL_1);
 	val &= ~(MEDIA_OP_MODE_MASK | VSC8584_MAC_IF_SELECTION_MASK);
-	val |= MEDIA_OP_MODE_COPPER | (VSC8584_MAC_IF_SELECTION_SGMII <<
-				       VSC8584_MAC_IF_SELECTION_POS);
+	val |= (MEDIA_OP_MODE_COPPER << MEDIA_OP_MODE_POS) |
+	       (VSC8584_MAC_IF_SELECTION_SGMII << VSC8584_MAC_IF_SELECTION_POS);
 	ret = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, val);
 
 	ret = genphy_soft_reset(phydev);
@@ -3276,7 +3276,7 @@ static int vsc8514_config_init(struct phy_device *phydev)
 		return ret;
 
 	ret = phy_modify(phydev, MSCC_PHY_EXT_PHY_CNTL_1, MEDIA_OP_MODE_MASK,
-			 MEDIA_OP_MODE_COPPER);
+			 MEDIA_OP_MODE_COPPER << MEDIA_OP_MODE_POS);
 
 	if (ret)
 		return ret;
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: mscc: add missing shift for media operation mode selection
  2020-02-26 14:40 [PATCH net-next] net: phy: mscc: add missing shift for media operation mode selection Antoine Tenart
@ 2020-02-26 15:50 ` Andrew Lunn
  2020-02-27  4:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2020-02-26 15:50 UTC (permalink / raw)
  To: Antoine Tenart; +Cc: davem, f.fainelli, hkallweit1, netdev, linux-kernel, linux

On Wed, Feb 26, 2020 at 03:40:34PM +0100, Antoine Tenart wrote:
> This patch adds a missing shift for the media operation mode selection.
> This does not fix the driver as the current operation mode (copper) has
> a value of 0, but this wouldn't work for other modes.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: mscc: add missing shift for media operation mode selection
  2020-02-26 14:40 [PATCH net-next] net: phy: mscc: add missing shift for media operation mode selection Antoine Tenart
  2020-02-26 15:50 ` Andrew Lunn
@ 2020-02-27  4:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-02-27  4:51 UTC (permalink / raw)
  To: antoine.tenart
  Cc: andrew, f.fainelli, hkallweit1, netdev, linux-kernel, linux

From: Antoine Tenart <antoine.tenart@bootlin.com>
Date: Wed, 26 Feb 2020 15:40:34 +0100

> This patch adds a missing shift for the media operation mode selection.
> This does not fix the driver as the current operation mode (copper) has
> a value of 0, but this wouldn't work for other modes.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-27  4:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 14:40 [PATCH net-next] net: phy: mscc: add missing shift for media operation mode selection Antoine Tenart
2020-02-26 15:50 ` Andrew Lunn
2020-02-27  4:51 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).