linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3] net/phy: fix DP83865 10 Mbps HDX loopback disable function
@ 2019-09-18 16:27 Peter Mamonov
  2019-09-18 16:32 ` Andrew Lunn
  2019-09-22  1:29 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Mamonov @ 2019-09-18 16:27 UTC (permalink / raw)
  To: andrew
  Cc: Peter Mamonov, Florian Fainelli, Heiner Kallweit,
	David S. Miller, netdev, linux-kernel

According to the DP83865 datasheet "the 10 Mbps HDX loopback can be
disabled in the expanded memory register 0x1C0.1". The driver erroneously
used bit 0 instead of bit 1.

Fixes: 4621bf129856 ("phy: Add file missed in previous commit.")
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
---
Changes since v2:
- None

Changes since v1:
- use BIT() macro
- fix debug message as well

 drivers/net/phy/national.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c
index a221dd552c3c..a5bf0874c7d8 100644
--- a/drivers/net/phy/national.c
+++ b/drivers/net/phy/national.c
@@ -105,14 +105,17 @@ static void ns_giga_speed_fallback(struct phy_device *phydev, int mode)
 
 static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable)
 {
+	u16 lb_dis = BIT(1);
+
 	if (disable)
-		ns_exp_write(phydev, 0x1c0, ns_exp_read(phydev, 0x1c0) | 1);
+		ns_exp_write(phydev, 0x1c0,
+			     ns_exp_read(phydev, 0x1c0) | lb_dis);
 	else
 		ns_exp_write(phydev, 0x1c0,
-			     ns_exp_read(phydev, 0x1c0) & 0xfffe);
+			     ns_exp_read(phydev, 0x1c0) & ~lb_dis);
 
 	pr_debug("10BASE-T HDX loopback %s\n",
-		 (ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on");
+		 (ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on");
 }
 
 static int ns_config_init(struct phy_device *phydev)
-- 
2.23.0


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

* Re: [PATCH net v3] net/phy: fix DP83865 10 Mbps HDX loopback disable function
  2019-09-18 16:27 [PATCH net v3] net/phy: fix DP83865 10 Mbps HDX loopback disable function Peter Mamonov
@ 2019-09-18 16:32 ` Andrew Lunn
  2019-09-22  1:29 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2019-09-18 16:32 UTC (permalink / raw)
  To: Peter Mamonov
  Cc: Florian Fainelli, Heiner Kallweit, David S. Miller, netdev, linux-kernel

On Wed, Sep 18, 2019 at 07:27:55PM +0300, Peter Mamonov wrote:
> According to the DP83865 datasheet "the 10 Mbps HDX loopback can be
> disabled in the expanded memory register 0x1C0.1". The driver erroneously
> used bit 0 instead of bit 1.
> 
> Fixes: 4621bf129856 ("phy: Add file missed in previous commit.")
> Signed-off-by: Peter Mamonov <pmamonov@gmail.com>

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

    Andrew


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

* Re: [PATCH net v3] net/phy: fix DP83865 10 Mbps HDX loopback disable function
  2019-09-18 16:27 [PATCH net v3] net/phy: fix DP83865 10 Mbps HDX loopback disable function Peter Mamonov
  2019-09-18 16:32 ` Andrew Lunn
@ 2019-09-22  1:29 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-09-22  1:29 UTC (permalink / raw)
  To: Peter Mamonov, andrew
  Cc: Florian Fainelli, Heiner Kallweit, David S. Miller, netdev, linux-kernel

On Wed, 18 Sep 2019 19:27:55 +0300, Peter Mamonov wrote:
> According to the DP83865 datasheet "the 10 Mbps HDX loopback can be
> disabled in the expanded memory register 0x1C0.1". The driver erroneously
> used bit 0 instead of bit 1.
> 
> Fixes: 4621bf129856 ("phy: Add file missed in previous commit.")
> Signed-off-by: Peter Mamonov <pmamonov@gmail.com>

Applied, queued, thank you!

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

end of thread, other threads:[~2019-09-22  1:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 16:27 [PATCH net v3] net/phy: fix DP83865 10 Mbps HDX loopback disable function Peter Mamonov
2019-09-18 16:32 ` Andrew Lunn
2019-09-22  1:29 ` Jakub Kicinski

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).