Re: [PATCHv2 net-next] net: fec: Ensure clocks are enabled while using mdio bus

2015-06-21 Thread Andrew Lunn
On Sat, Jun 20, 2015 at 06:01:33PM -0700, Florian Fainelli wrote: Le 06/20/15 09:15, Andrew Lunn a écrit : When a switch is attached to the mdio bus, the mdio bus can be used while the interface is not open. If the IPG clock are not enabled, MDIO reads/writes will simply time out. So enable

[PATCHv2 net-next] net: fec: Ensure clocks are enabled while using mdio bus

2015-06-20 Thread Andrew Lunn
When a switch is attached to the mdio bus, the mdio bus can be used while the interface is not open. If the IPG clock are not enabled, MDIO reads/writes will simply time out. So enable the clock before starting a transaction, and disable it afterwards. The CCF performs reference counting so the

Re: [PATCHv2 net-next] net: fec: Ensure clocks are enabled while using mdio bus

2015-06-20 Thread Fabio Estevam
On Sat, Jun 20, 2015 at 1:15 PM, Andrew Lunn and...@lunn.ch wrote: @@ -1764,6 +1765,11 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) { struct fec_enet_private *fep = bus-priv; unsigned long time_left; + int ret; + + ret =

Re: [PATCHv2 net-next] net: fec: Ensure clocks are enabled while using mdio bus

2015-06-20 Thread Andrew Lunn
On Sat, Jun 20, 2015 at 02:47:20PM -0300, Fabio Estevam wrote: On Sat, Jun 20, 2015 at 1:15 PM, Andrew Lunn and...@lunn.ch wrote: @@ -1764,6 +1765,11 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) { struct fec_enet_private *fep = bus-priv;

Re: [PATCHv2 net-next] net: fec: Ensure clocks are enabled while using mdio bus

2015-06-20 Thread Florian Fainelli
Le 06/20/15 09:15, Andrew Lunn a écrit : When a switch is attached to the mdio bus, the mdio bus can be used while the interface is not open. If the IPG clock are not enabled, MDIO reads/writes will simply time out. So enable the clock before starting a transaction, and disable it afterwards.