From: Andrew Lunn and...@lunn.ch Sent: Sunday, June 21, 2015 2:38 AM
To: David Miller
Cc: Duan Fugang-B38611; Duan Fugang-B38611; Cory Tusar; netdev; Andrew
Lunn
Subject: [PATCHv3 net-next] net: fec: Ensure clocks are enabled while
using mdio bus
When a switch is attached to the mdio bus
int mii_id, int regnum) {
struct fec_enet_private *fep = bus-priv;
unsigned long time_left;
+ int ret;
+
+ ret = clk_prepare_enable(fep-clk_ipg);
+ if (ret)
+ return ret;
fep-mii_timeout = 0;
init_completion(fep-mdio_done);
@@ -1779,11
On Tue, Jun 23, 2015 at 03:12:15AM +, Duan Andy wrote:
From: Andrew Lunn and...@lunn.ch Sent: Tuesday, June 23, 2015 10:52 AM
To: Duan Fugang-B38611; Florian Fainelli
Cc: David Miller; Cory Tusar; netdev
Subject: Re: [PATCHv3 net-next] net: fec: Ensure clocks are enabled while
using
From: Andrew Lunn and...@lunn.ch Sent: Tuesday, June 23, 2015 10:52 AM
To: Duan Fugang-B38611; Florian Fainelli
Cc: David Miller; Cory Tusar; netdev
Subject: Re: [PATCHv3 net-next] net: fec: Ensure clocks are enabled while
using mdio bus
int mii_id, int regnum) {
struct
2015-06-22 19:52 GMT-07:00 Andrew Lunn and...@lunn.ch:
int mii_id, int regnum) {
struct fec_enet_private *fep = bus-priv;
unsigned long time_left;
+ int ret;
+
+ ret = clk_prepare_enable(fep-clk_ipg);
+ if (ret)
+ return ret;
fep-mii_timeout = 0;
From: Andrew Lunn and...@lunn.ch Sent: Tuesday, June 23, 2015 11:44 AM
To: Duan Fugang-B38611
Cc: Florian Fainelli; David Miller; Cory Tusar; netdev
Subject: Re: [PATCHv3 net-next] net: fec: Ensure clocks are enabled while
using mdio bus
On Tue, Jun 23, 2015 at 03:12:15AM +, Duan Andy
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