Message ID | 200811140853.13729.giulio.benetti@micronovasrl.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Giulio Benetti wrote: > PHYID returns 0xffff and not 0xffffffff when not found and in some > case(at91sam9263) 0x0. Maybe this patch could be useful. > > > > Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com> > Hi Giulio, it sounds like a work around for a hardware error. Is my understanding that, broken hardware is sometimes missing the pull down resistor on the MDIO line, which results in reads to non-existent devices returning 0 rather than 0xffff. Your fix looks good for me, although, I don't know if some vendors actually use 0 as valid UID. Moreover, when I met this problem, I decided to move just this hack within the MAC driver (as soon as the PHY is connected to the driver) instead of patching the PAL code. Hoping this could be useful. Ciao Peppe -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff -urN -X exclude linux.orig/drivers/net/phy/phy_device.c linux/drivers/net/phy/phy_device.c --- linux.orig/drivers/net/phy/phy_device.c 2008-11-11 17:52:13.000000000 +0100 +++ linux/drivers/net/phy/phy_device.c 2008-11-12 19:20:47.000000000 +0100 @@ -227,8 +227,8 @@ if (r) return ERR_PTR(r); - /* If the phy_id is all Fs, there is no device there */ - if (0xffffffff == phy_id) + /* If the phy_id is all Fs or all 0s, there is no device there */ + if ((0xffff == phy_id) || (0x00 == phy_id)) return NULL; dev = phy_device_create(bus, addr, phy_id);
PHYID returns 0xffff and not 0xffffffff when not found and in some case(at91sam9263) 0x0. Maybe this patch could be useful. Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>