All of lore.kernel.org
 help / color / mirror / Atom feed
* [2/3] via-rhine: de-isolate PHY
  2004-08-08 14:02 [0/3] via-rhine: experimental patches Roger Luethi
@ 2004-08-08 14:02 ` Roger Luethi
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Luethi @ 2004-08-08 14:02 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linux-kernel

PHYs may come up isolated. Make sure we can send data to them. This code
section needs a clean-up, but I prefer to merge this fix in isolation.

Report and suggested fix by Tam, Ming Dat (Tommy).

Signed-off-by: Roger Luethi <rl@hellgate.ch>

--- linux-2.6.8-rc3-mm1/drivers/net/via-rhine.c.01	2004-08-08 12:36:03.440855262 +0200
+++ linux-2.6.8-rc3-mm1/drivers/net/via-rhine.c	2004-08-08 13:15:24.527527919 +0200
@@ -896,7 +896,10 @@ static int __devinit rhine_init_one(stru
 	pci_set_drvdata(pdev, dev);
 
 	{
+		u16 mii_cmd;
 		int mii_status = mdio_read(dev, phy_id, 1);
+		mii_cmd = mdio_read(dev, phy_id, MII_BMCR) & ~BMCR_ISOLATE;
+		mdio_write(dev, phy_id, MII_BMCR, mii_cmd);
 		if (mii_status != 0xffff && mii_status != 0x0000) {
 			rp->mii_if.advertising = mdio_read(dev, phy_id, 4);
 			printk(KERN_INFO "%s: MII PHY found at address "

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2/3] via-rhine: de-isolate PHY
@ 2004-08-08 19:53 Manfred Spraul
  2004-08-08 20:05 ` Roger Luethi
  0 siblings, 1 reply; 5+ messages in thread
From: Manfred Spraul @ 2004-08-08 19:53 UTC (permalink / raw)
  To: Roger Luethi; +Cc: linux-kernel, Netdev

Roger wrote:

> PHYs may come up isolated. Make sure we can send data to them. This code
> section needs a clean-up, but I prefer to merge this fix in isolation.
>
What was the phyid value for the isolated PHYs?

I know that PHYs go into isolate mode if the startup id is wired to 0, 
but I haven't figured out what's necessary to initialize them: Just 
clear the isolate bit or is it necessary to set the id to a nonzero value.

--
    Manfred


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2/3] via-rhine: de-isolate PHY
  2004-08-08 19:53 [2/3] via-rhine: de-isolate PHY Manfred Spraul
@ 2004-08-08 20:05 ` Roger Luethi
  2004-08-08 21:04   ` Manfred Spraul
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Luethi @ 2004-08-08 20:05 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel, Netdev

[ BCCed reporter in case he wants to weigh in on the issue ]

On Sun, 08 Aug 2004 21:53:57 +0200, Manfred Spraul wrote:
> Roger wrote:
> 
> >PHYs may come up isolated. Make sure we can send data to them. This code
> >section needs a clean-up, but I prefer to merge this fix in isolation.
> >
> What was the phyid value for the isolated PHYs?

I suspect it was 0, because another suggestion in the same message was to
start scanning at 0 rather than 1 (obsolete with current via-rhine code).

> I know that PHYs go into isolate mode if the startup id is wired to 0, 

Wouldn't that be s/go/can go/ ?

> but I haven't figured out what's necessary to initialize them: Just 
> clear the isolate bit or is it necessary to set the id to a nonzero value.

The proposed fix apparently worked for the PHY in question (LSI Logic
80225).

Roger

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2/3] via-rhine: de-isolate PHY
  2004-08-08 20:05 ` Roger Luethi
@ 2004-08-08 21:04   ` Manfred Spraul
  2004-08-08 21:54     ` Roger Luethi
  0 siblings, 1 reply; 5+ messages in thread
From: Manfred Spraul @ 2004-08-08 21:04 UTC (permalink / raw)
  To: Roger Luethi; +Cc: linux-kernel, Netdev

Roger Luethi wrote:

>  
>
>>I know that PHYs go into isolate mode if the startup id is wired to 0, 
>>    
>>
>
>Wouldn't that be s/go/can go/ ?
>
>  
>
I don't have the MII standard, my knowledge is from the DP83840A specs:
The pin description contains a section about the phy ids:
During power up five pins are latched to determine the initial phy address.
Then the following sentence in bold: "An address selection of all zeros 
(00000) will result in a PHY isolation condition".

I've reread the DP specs and I now think that your current patch is 
sufficient:
The isolate state is independant from the phy address - a non-zero phy 
can be in isolate mode and the phy zero can be non-isolated. The phy id 
just sets the power-up value of the isolate bit: 0 means start isolated, 
non-zero means start non-isolated.

If this is really true then handling phy 0 is trivial:
First scan 1-31. If nothing found: try 0. If a phy is found: clear the 
isolate bit and then use phy 0.

--
    Manfred

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2/3] via-rhine: de-isolate PHY
  2004-08-08 21:04   ` Manfred Spraul
@ 2004-08-08 21:54     ` Roger Luethi
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Luethi @ 2004-08-08 21:54 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel, Netdev

On Sun, 08 Aug 2004 23:04:06 +0200, Manfred Spraul wrote:
> Roger Luethi wrote:
> >>I know that PHYs go into isolate mode if the startup id is wired to 0, 
> >
> >Wouldn't that be s/go/can go/ ?
> >
> I don't have the MII standard, my knowledge is from the DP83840A specs:
> The pin description contains a section about the phy ids:
> During power up five pins are latched to determine the initial phy address.
> Then the following sentence in bold: "An address selection of all zeros 
> (00000) will result in a PHY isolation condition".

I suppose all PHYs do that. Even if they don't, though, I should be
safe as long as I de-isolate unconditionally (instead of testing for
phy_id==0).

> I've reread the DP specs and I now think that your current patch is 
> sufficient:
> The isolate state is independant from the phy address - a non-zero phy 
> can be in isolate mode and the phy zero can be non-isolated. The phy id 

Stands to reason. A PHY that can't get out of isolation wouldn't be
very useful.

> If this is really true then handling phy 0 is trivial:
> First scan 1-31. If nothing found: try 0. If a phy is found: clear the 
> isolate bit and then use phy 0.

Makes sense. The Rhine is actually pretty neat in that regard, I've
been able to drop the PHY scanning entirely.

Roger

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-08 21:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-08 19:53 [2/3] via-rhine: de-isolate PHY Manfred Spraul
2004-08-08 20:05 ` Roger Luethi
2004-08-08 21:04   ` Manfred Spraul
2004-08-08 21:54     ` Roger Luethi
  -- strict thread matches above, loose matches on Subject: below --
2004-08-08 14:02 [0/3] via-rhine: experimental patches Roger Luethi
2004-08-08 14:02 ` [2/3] via-rhine: de-isolate PHY Roger Luethi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.