projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3486140
)
net-next:asix:poll in asix_get_phyid in case phy not ready
author
Grant Grundler
<
[email protected]
>
Tue, 15 Nov 2011 07:12:40 +0000
(07:12 +0000)
committer
David S. Miller
<
[email protected]
>
Tue, 15 Nov 2011 21:26:06 +0000
(16:26 -0500)
Sometimes the phy isn't ready after reset...poll and pray it will be soon.
Signed-off-by: Freddy Xin <
[email protected]
>
Signed-off-by: Grant Grundler <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/usb/asix.c
patch
|
blob
|
history
diff --git
a/drivers/net/usb/asix.c
b/drivers/net/usb/asix.c
index 873860d46e9ed2dad7d3f8e9e32eebe97ef68c5c..b4675e89e42cd5ffbde0165c33ae307c1fc4c72f 100644
(file)
--- a/
drivers/net/usb/asix.c
+++ b/
drivers/net/usb/asix.c
@@
-652,9
+652,17
@@
static u32 asix_get_phyid(struct usbnet *dev)
{
int phy_reg;
u32 phy_id;
+ int i;
- phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID1);
- if (phy_reg < 0)
+ /* Poll for the rare case the FW or phy isn't ready yet. */
+ for (i = 0; i < 100; i++) {
+ phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID1);
+ if (phy_reg != 0 && phy_reg != 0xFFFF)
+ break;
+ mdelay(1);
+ }
+
+ if (phy_reg <= 0 || phy_reg == 0xFFFF)
return 0;
phy_id = (phy_reg & 0xffff) << 16;