Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e65bb94a9de542c464bf00035a08b0e0a76993d
Commit:     3e65bb94a9de542c464bf00035a08b0e0a76993d
Parent:     ebf5112ca7a714a3961a322459747059cbf41d7b
Author:     Hynek Petrak <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 19 13:08:49 2006 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Dec 26 16:41:08 2006 -0500

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/ibm_emac/ibm_emac_phy.c |    4 +++-
 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 4a97024..9074f76 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)
 {
        struct mii_phy_def *def;
        int i;
-       u32 id;
+       int id;
 
        phy->autoneg = AUTONEG_DISABLE;
        phy->advertising = 0;
@@ -324,6 +324,8 @@ int mii_phy_probe(struct mii_phy *phy, int address)
 
        /* Read ID and find matching entry */
        id = (phy_read(phy, MII_PHYSID1) << 16) | phy_read(phy, MII_PHYSID2);
+       if (id < 0)
+               return -ENODEV;
        for (i = 0; (def = mii_phy_table[i]) != NULL; i++)
                if ((id & def->phy_id_mask) == def->phy_id)
                        break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to