lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 27 Oct 2009 11:28:58 +0100
From:	Kristoffer Glembo <kristoffer@...sler.com>
To:	netdev@...r.kernel.org
Subject: phy_connect_direct problem

Hi,

I'm in the process of converting an ethernet driver to using the PHY 
layer, but ran into a problem where my adjust_state handler was never 
called and the link did not go up ...

I use phy_connect to connect the PHY device with my ethernet driver. In 
phy_connect_direct I found the following code: 	

phy_prepare_link(phydev, handler);
phy_start_machine(phydev, NULL);

So first the adjust_state is set to handler by phy_prepare_link and then 
it is overwritten with the NULL parameter passed to phy_start_machine.

Maybe I'm abusing the PHY layer somehow since there are plenty of other 
drivers using this interface. However the patch below solved the issue 
for me.

Best regards,
Kristoffer Glembo


---
  drivers/net/phy/phy_device.c |    3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index b10fedd..d27ca80 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -311,8 +311,7 @@ int phy_connect_direct(struct net_device *dev, 
struct phy_device *phydev,
  	if (rc)
  		return rc;

-	phy_prepare_link(phydev, handler);
-	phy_start_machine(phydev, NULL);
+	phy_start_machine(phydev, handler);
  	if (phydev->irq > 0)
  		phy_start_interrupts(phydev);

-- 
1.5.2.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ