aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHynek Petrak <hynek@swac.cz>2006-12-19 16:08:49 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-26 16:41:08 -0500
commit3e65bb94a9de542c464bf00035a08b0e0a76993d (patch)
treed9ebc1b8ba3946519fdb0083608e6e68ce0d019e
parentebf5112ca7a714a3961a322459747059cbf41d7b (diff)
PHY probe not working properly for ibm_emac (PPC4xx)
I have a system with AMCC PowerPC 405EP and PHY Intel LXT971A. Linux 2.6.18.3 is not able to detect the PHY ID correctly. The PHY ID detected is 0, but should be 0x1d. This is because phy_read() (__emac_mdio_read() resp.) from drivers/net/ibm_emac/ibm_emac_core.c might return -ETIMEDOUT or -EREMOTEIO on error. This is ignored inside the int mii_phy_probe(struct mii_phy *phy, int address) from drivers/net/ibm_emac/ibm_emac_phy.c as the return value is assigned to an u32 variable. Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/ibm_emac/ibm_emac_phy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c
index 4a97024061e5..9074f76ee2bf 100644
--- a/drivers/net/ibm_emac/ibm_emac_phy.c
+++ b/drivers/net/ibm_emac/ibm_emac_phy.c
@@ -309,7 +309,7 @@ int mii_phy_probe(struct mii_phy *phy, int address)
309{ 309{
310 struct mii_phy_def *def; 310 struct mii_phy_def *def;
311 int i; 311 int i;
312 u32 id; 312 int id;
313 313
314 phy->autoneg = AUTONEG_DISABLE; 314 phy->autoneg = AUTONEG_DISABLE;
315 phy->advertising = 0; 315 phy->advertising = 0;
@@ -324,6 +324,8 @@ int mii_phy_probe(struct mii_phy *phy, int address)
324 324
325 /* Read ID and find matching entry */ 325 /* Read ID and find matching entry */
326 id = (phy_read(phy, MII_PHYSID1) << 16) | phy_read(phy, MII_PHYSID2); 326 id = (phy_read(phy, MII_PHYSID1) << 16) | phy_read(phy, MII_PHYSID2);
327 if (id < 0)
328 return -ENODEV;
327 for (i = 0; (def = mii_phy_table[i]) != NULL; i++) 329 for (i = 0; (def = mii_phy_table[i]) != NULL; i++)
328 if ((id & def->phy_id_mask) == def->phy_id) 330 if ((id & def->phy_id_mask) == def->phy_id)
329 break; 331 break;