From: akpm@osdl.org
To: jeff@garzik.org
Cc: netdev@vger.kernel.org, akpm@osdl.org, hynek@swac.cz
Subject: [patch 6/7] PHY probe not working properly for ibm_emac (PPC4xx)
Date: Tue, 19 Dec 2006 13:08:49 -0800 [thread overview]
Message-ID: <200612192108.kBJL8oDM010504@shell0.pdx.osdl.net> (raw)
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;
_
next reply other threads:[~2006-12-19 21:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-19 21:08 akpm [this message]
2006-12-26 21:41 ` [patch 6/7] PHY probe not working properly for ibm_emac (PPC4xx) Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200612192108.kBJL8oDM010504@shell0.pdx.osdl.net \
--to=akpm@osdl.org \
--cc=hynek@swac.cz \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).