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

2016-09-01 Thread Andrew Lunn
> @@ -1520,17 +1513,22 @@ static int smsc911x_open(struct net_device *dev) > unsigned int timeout; > unsigned int temp; > unsigned int intcfg; > + int retval; > > - /* if the phy is not yet registered, retry later*/ > + /* find and start the given phy */ > if (

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

2016-09-01 Thread Andrew Lunn
> This patch does add additional code I overlooked to cleanup the phy > if it fails, I guess in theory that portion could be a prereq patch, > I will break that portion out. I'm still not sure how to partially > move the MDIO startup... Hi Jeremy You can add a cleanup patch which replaces these h

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

2016-09-01 Thread Jeremy Linton
On 09/01/2016 11:58 AM, Andrew Lunn wrote: @@ -1520,17 +1513,22 @@ static int smsc911x_open(struct net_device *dev) unsigned int timeout; unsigned int temp; unsigned int intcfg; + int retval; - /* if the phy is not yet registered, retry later*/ + /* find

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

2016-09-01 Thread Jeremy Linton
Move phy startup/shutdown into the smsc911x_open/stop routines. This allows the module to be unloaded because phy_connect_direct is no longer always holding the module use count. This one change also resolves a number of other problems. The link status of a downed interface no longer reflects a st