* drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode
@ 2008-09-29 13:33 Wang Jian
2008-09-29 14:45 ` Ben Hutchings
2008-09-29 20:14 ` Andy Fleming
0 siblings, 2 replies; 7+ messages in thread
From: Wang Jian @ 2008-09-29 13:33 UTC (permalink / raw)
To: netdev; +Cc: Andy Fleming, Jeff Garzik, Alexandr Smirnov
Hi,
During my testing, I found that 88e1111 can't get out of sleep mode
(Energy detect+) in certain condition.
I am working on a mpc8541 board, with TSEC (gianfar) connected to 88e1111
phy chip. The kenrel is 2.6.26-rc8 with several patches.
The following steps can 100% trigger the problem
1. unplug cable from tsec interfaces (eth0/eth1 in my case)
2. boot up and waiting for 6+ seconds
3. ifconfig eth0 up
4. plug in cable, the link can't be established and no way to bring it
up
But these steps can make link up
1. boot up with cable plugged or plug the cable in 6 seconds after
bootup
2. unplug cable
3. ifconfig eth0 up
4. plugin in cable, the link is up
I tried some workarounds and no success. so far I get these information
1. When cable plugged before ifconfig eth0 up and in the 6 seconds window,
the bit 11 of register 17, "speed and duplex resolved" is true even
unplug cable later
2. auto negotination enable bit (bit 12 of BMCR) is true in both cases
Can someone help me to confirm this problem? I can provide more
information/prink output per request.
Note: I have these two patches applied (in current linus tree)
commit 7239016d52c6d568d069f083bdcd17f35ab79fd8
Author: Wang Jian <lark@linux.net.cn>
Date: Wed Jul 16 21:46:20 2008 +0800
commit 9cf8fa4334e60f27b4a392f432c292f3af268215
Author: Wang Jian <lark@linux.net.cn>
Date: Wed Jul 16 21:46:17 2008 +0800
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode
2008-09-29 13:33 drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode Wang Jian
@ 2008-09-29 14:45 ` Ben Hutchings
2008-09-29 16:28 ` Wang Jian
2008-09-29 20:14 ` Andy Fleming
1 sibling, 1 reply; 7+ messages in thread
From: Ben Hutchings @ 2008-09-29 14:45 UTC (permalink / raw)
To: Wang Jian; +Cc: netdev, Andy Fleming, Jeff Garzik, Alexandr Smirnov
On Mon, 2008-09-29 at 21:33 +0800, Wang Jian wrote:
> Hi,
>
> During my testing, I found that 88e1111 can't get out of sleep mode
> (Energy detect+) in certain condition.
[...]
We had the same problem with development boards using that PHY and we
stopped using the energy detect mode.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode
2008-09-29 14:45 ` Ben Hutchings
@ 2008-09-29 16:28 ` Wang Jian
2008-09-29 16:55 ` Ben Hutchings
0 siblings, 1 reply; 7+ messages in thread
From: Wang Jian @ 2008-09-29 16:28 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, Andy Fleming, Jeff Garzik, Alexandr Smirnov
According to datasheet, fiber/copper auto detect & auto switch depend on
energy detect.
Or I misunderstand DIS_FC & DIS_SLEEP? When DIS_SLEEP is set, fiber/copper
auto detect & auto switch still work?
Ben Hutchings wrote:
> On Mon, 2008-09-29 at 21:33 +0800, Wang Jian wrote:
>> Hi,
>>
>> During my testing, I found that 88e1111 can't get out of sleep mode
>> (Energy detect+) in certain condition.
> [...]
>
> We had the same problem with development boards using that PHY and we
> stopped using the energy detect mode.
>
> Ben.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode
2008-09-29 16:28 ` Wang Jian
@ 2008-09-29 16:55 ` Ben Hutchings
0 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2008-09-29 16:55 UTC (permalink / raw)
To: Wang Jian; +Cc: netdev, Andy Fleming, Jeff Garzik, Alexandr Smirnov
On Tue, 2008-09-30 at 00:28 +0800, Wang Jian wrote:
> According to datasheet, fiber/copper auto detect & auto switch depend on
> energy detect.
>
> Or I misunderstand DIS_FC & DIS_SLEEP? When DIS_SLEEP is set, fiber/copper
> auto detect & auto switch still work?
[...]
I've no idea; we only ever used copper.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode
2008-09-29 13:33 drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode Wang Jian
2008-09-29 14:45 ` Ben Hutchings
@ 2008-09-29 20:14 ` Andy Fleming
2008-09-30 12:11 ` Wang Jian
1 sibling, 1 reply; 7+ messages in thread
From: Andy Fleming @ 2008-09-29 20:14 UTC (permalink / raw)
To: Wang Jian; +Cc: netdev, Andy Fleming, Jeff Garzik, Alexandr Smirnov
On Mon, Sep 29, 2008 at 8:33 AM, Wang Jian <lark@linux.net.cn> wrote:
> Hi,
>
> During my testing, I found that 88e1111 can't get out of sleep mode
> (Energy detect+) in certain condition.
>
> I am working on a mpc8541 board, with TSEC (gianfar) connected to 88e1111
> phy chip. The kenrel is 2.6.26-rc8 with several patches.
>
> The following steps can 100% trigger the problem
>
> 1. unplug cable from tsec interfaces (eth0/eth1 in my case)
> 2. boot up and waiting for 6+ seconds
> 3. ifconfig eth0 up
> 4. plug in cable, the link can't be established and no way to bring it
> up
Is anything printed out to the log?
Are you polling or using an interrupt?
If you are using an interrupt, is it firing?
If you are polling, can you print out some debug information to see if
it is successfully reading the PHY status?
Andy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode
2008-09-29 20:14 ` Andy Fleming
@ 2008-09-30 12:11 ` Wang Jian
2008-10-02 10:10 ` Wang Jian
0 siblings, 1 reply; 7+ messages in thread
From: Wang Jian @ 2008-09-30 12:11 UTC (permalink / raw)
To: Andy Fleming; +Cc: netdev, Andy Fleming, Jeff Garzik, Alexandr Smirnov
Andy Fleming wrote:
> On Mon, Sep 29, 2008 at 8:33 AM, Wang Jian <lark@linux.net.cn> wrote:
>> Hi,
>>
>> During my testing, I found that 88e1111 can't get out of sleep mode
>> (Energy detect+) in certain condition.
>>
>> I am working on a mpc8541 board, with TSEC (gianfar) connected to 88e1111
>> phy chip. The kenrel is 2.6.26-rc8 with several patches.
>>
>> The following steps can 100% trigger the problem
>>
>> 1. unplug cable from tsec interfaces (eth0/eth1 in my case)
>> 2. boot up and waiting for 6+ seconds
>> 3. ifconfig eth0 up
>> 4. plug in cable, the link can't be established and no way to bring it
>> up
>
>
> Is anything printed out to the log?
>
> Are you polling or using an interrupt?
I am using polling
>
> If you are using an interrupt, is it firing?
>
> If you are polling, can you print out some debug information to see if
> it is successfully reading the PHY status?
>
Ok, I use the following code to print out phy register. Note I print out 32bit,
bit 31 = 1 means error
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 4aa5479..77a9e18 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -312,7 +312,12 @@ static int marvell_read_status(struct phy_device *phydev)
return err;
if (AUTONEG_ENABLE == phydev->autoneg) {
+ status = phy_read(phydev, MII_BMCR);
+ printk(KERN_ERR "MII_BMCR=%08x, ", status);
+ status = phy_read(phydev, MII_BMSR);
+ printk("MII_BMSR=%08x, ", status);
status = phy_read(phydev, MII_M1011_PHY_STATUS);
+ printk("MII_M1011_PHY_STATUS=%08x\n", status);
if (status < 0)
return status;
Test 1: boot up with cable plugged in eth0
--- bootup with cable plugged in eth0 ---
/ $ ifconfig eth0 up
/ $ [ 7.804582] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008110
[ 8.811583] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00007d00
[ 8.819151] PHY: e0024520:04 - Link is Up - 100/Full
[ 10.823581] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 12.830578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 14.837578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 16.844578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 18.851578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 20.858578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 22.865578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 24.872578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 26.879578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 28.886578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 30.893578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 32.900578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 34.907578] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
ifconfig eth0[ 36.914585] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
down
--- 6+ seconds elapsed ---
/ $ ifconfig eth1 up
/ $ [ 48.462582] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008110
[ 49.469583] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008150
[ 50.476579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008110
[ 51.483578] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008150
--- plug cable to eth1 ---
[ 52.490579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008150
[ 53.497579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008110
[ 54.504579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008110
[ 55.511579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008150
[ 56.518579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008110
[ 57.525579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008150
[ 58.532578] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008110
[ 59.539579] MII_BMCR=00001040, MII_BMSR=00000149, MII_M1011_PHY_STATUS=00008110
Test 2: before ifconfig eth0 up, unplug cable, ifconfig eth0 up within 6 seconds
window
/ $ ifconfig eth0 up
/ $ [ 7.568589] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008110
[ 8.575588] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008150
[ 9.582585] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008100
[ 10.589585] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008100
[ 11.596585] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008140
[ 12.603585] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008150
[ 13.610585] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008150
[ 14.617585] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00009110
[ 15.624585] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 15.632148] PHY: e0024520:04 - Link is Up - 100/Full
[ 17.636586] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 19.643584] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 21.650585] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 23.657585] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 25.664588] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
[ 27.671585] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d00
In test 1 and 2, eth0 is used to transfer cuImage in u-boot
Test 3: plug cable to eth1 with 6 seconds window and unplug, then ifconfig eth1 up
/ $ ifconfig eth1 up
/ $ [ 12.469584] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008150
[ 13.476585] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008110
[ 14.483581] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008140
[ 15.490581] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008140
[ 16.497581] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008100
[ 17.504580] MII_BMCR=00001000, MII_BMSR=00007949, MII_M1011_PHY_STATUS=00008140
--- plug cable ---
[ 18.511581] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00007d40
[ 18.519142] PHY: e0024520:05 - Link is Up - 100/Full
[ 20.523583] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d40
[ 22.530580] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d40
[ 24.537580] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d40
[ 26.544580] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d40
[ 28.551580] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d40
[ 30.558580] MII_BMCR=00001000, MII_BMSR=0000796d, MII_M1011_PHY_STATUS=00006d40
Hmm, I remove my debug code from m88e1111_config_init(), do you need this?
I have an idea that if the phy is in sleep mode, flip flop energy detect mode to
leave sleep mode. This is done every 6 seconds, not so intrusive. I will try it
later.
>
> Andy
>
>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode
2008-09-30 12:11 ` Wang Jian
@ 2008-10-02 10:10 ` Wang Jian
0 siblings, 0 replies; 7+ messages in thread
From: Wang Jian @ 2008-10-02 10:10 UTC (permalink / raw)
To: Andy Fleming; +Cc: netdev, Andy Fleming, Alexandr Smirnov
Wang Jian wrote:
> I have an idea that if the phy is in sleep mode, flip flop energy detect
> mode to
> leave sleep mode. This is done every 6 seconds, not so intrusive. I will
> try it
> later.
>
No success so far.
MII_PDOWN then MII_RESET no success either.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-02 10:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-29 13:33 drivers/net/phy/marvell.c: 88e1111 can't get out sleep mode Wang Jian
2008-09-29 14:45 ` Ben Hutchings
2008-09-29 16:28 ` Wang Jian
2008-09-29 16:55 ` Ben Hutchings
2008-09-29 20:14 ` Andy Fleming
2008-09-30 12:11 ` Wang Jian
2008-10-02 10:10 ` Wang Jian
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).