* [patch 6/7] PHY probe not working properly for ibm_emac (PPC4xx)
@ 2006-12-19 21:08 akpm
2006-12-26 21:41 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2006-12-19 21:08 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, hynek
From: Hynek Petrak <hynek@swac.cz>
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>
---
drivers/net/ibm_emac/ibm_emac_phy.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
diff -puN drivers/net/ibm_emac/ibm_emac_phy.c~problem-phy-probe-not-working-properly-for-ibm_emac-ppc4xx drivers/net/ibm_emac/ibm_emac_phy.c
--- a/drivers/net/ibm_emac/ibm_emac_phy.c~problem-phy-probe-not-working-properly-for-ibm_emac-ppc4xx
+++ a/drivers/net/ibm_emac/ibm_emac_phy.c
@@ -309,7 +309,7 @@ int mii_phy_probe(struct mii_phy *phy, i
{
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, i
/* 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;
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 6/7] PHY probe not working properly for ibm_emac (PPC4xx)
2006-12-19 21:08 [patch 6/7] PHY probe not working properly for ibm_emac (PPC4xx) akpm
@ 2006-12-26 21:41 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-12-26 21:41 UTC (permalink / raw)
To: akpm; +Cc: netdev, hynek
akpm@osdl.org wrote:
> From: Hynek Petrak <hynek@swac.cz>
>
> 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>
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-26 21:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19 21:08 [patch 6/7] PHY probe not working properly for ibm_emac (PPC4xx) akpm
2006-12-26 21:41 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).