Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-16

Re: [PATCH 2/2] net: smsc911x: Fix register_netdev, phy startup ordering and driver unload

From: Sergei Shtylyov <hidden>
Date: 2016-06-16 16:14:11

Hello.

On 06/16/2016 06:54 PM, Jeremy Linton wrote:
Previously the mdio and phy's were started in the drv probe following
register_netdev(). This could lead to a situation where if the netdev was
opened before the mdio/phys were configured, it would fail with a
EAGAIN.

Also, the use of phy_connect_direct() in the drv_probe
routine results in a situation where the module use count would never
decrease sufficiently to unload the driver.
    It's a bad idea to fix 2 issues with one patch (unless they are caused by 
the same reason). "Do one thing per patch" is a rule of thumb here...
With this patch the mdio bus is allocated/configured before
register_netdev(), and the phy's are brought online/started in the
ndo_open and stopped in the ndo_stop. Because of this, the behavior
of ethtool changes a little if the interface is stopped. Before the
phy's would remain up, and their last state would be displayed with
ethtool. Now ethtool reports link has been severed/Link detected: no
when the net dev is stopped.

Signed-off-by: Jeremy Linton <redacted>[...]
[...]

MBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help