* r8169.c broke for me from 2.6.20.4 to 2.6.21
@ 2007-04-30 5:31 Jelle Foks
2007-04-30 7:16 ` Francois Romieu
0 siblings, 1 reply; 5+ messages in thread
From: Jelle Foks @ 2007-04-30 5:31 UTC (permalink / raw)
To: romieu, netdev
Hello,
When I upgraded from 2.6.20.4 to 2.6.21, the r8169 kept thinking that
the link was down, while with 2.6.20.4, the link was detected at 10Mbit/s.
This is on a (I admit, probably out-of-spec) cable to a Gbit switch from
the r8169 on the mainboard of an AOpen XC Cube EX761.
With 2.6.20.4, the 'link' goes through these states when I boot:
r8169: eth1: link down
ADDRCONF(NETDEV_UP): link is not ready
ADDRCONF(NETDEV_CHANGE): link becomes ready
r8169: eth1: link up
And then it works (at 10Mbit). With 2.6.21, the link stays down.
When I revert rtl8169_xmii_reset_enable() to the code from the driver in
2.6.20.4 (see the diff below), then it works again, with the same
behaviour as with 2.6.20.4.
My guess is that the 2.6.20.4 code resets the mii in a way that allows
the chip to see a link on my (bad) cable, and the 2.6.21 code does not...
Jelle.
--- linux-2.6.21/drivers/net/r8169.c 2007-04-25 23:08:32.000000000 -0400
+++ linux-2.6.21-jelle/drivers/net/r8169.c 2007-04-30
01:25:59.000000000 -0400
@@ -574,8 +574,10 @@
{
unsigned int val;
- val = mdio_read(ioaddr, MII_BMCR) | BMCR_RESET;
- mdio_write(ioaddr, MII_BMCR, val & 0xffff);
+ mdio_write(ioaddr, MII_BMCR, BMCR_RESET);
+ val = mdio_read(ioaddr, MII_BMCR);
+/* val = mdio_read(ioaddr, MII_BMCR) | BMCR_RESET;*/
+/* mdio_write(ioaddr, MII_BMCR, val & 0xffff);*/
}
static void rtl8169_check_link_status(struct net_device *dev,
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: r8169.c broke for me from 2.6.20.4 to 2.6.21
2007-04-30 5:31 r8169.c broke for me from 2.6.20.4 to 2.6.21 Jelle Foks
@ 2007-04-30 7:16 ` Francois Romieu
0 siblings, 0 replies; 5+ messages in thread
From: Francois Romieu @ 2007-04-30 7:16 UTC (permalink / raw)
To: Jelle Foks; +Cc: netdev
Jelle Foks <jelle@foks.8m.com> :
[...]
> When I upgraded from 2.6.20.4 to 2.6.21, the r8169 kept thinking that
> the link was down, while with 2.6.20.4, the link was detected at 10Mbit/s.
>
> This is on a (I admit, probably out-of-spec) cable to a Gbit switch from
> the r8169 on the mainboard of an AOpen XC Cube EX761.
Grmblmbl...
> With 2.6.20.4, the 'link' goes through these states when I boot:
>
> r8169: eth1: link down
> ADDRCONF(NETDEV_UP): link is not ready
> ADDRCONF(NETDEV_CHANGE): link becomes ready
> r8169: eth1: link up
>
> And then it works (at 10Mbit). With 2.6.21, the link stays down.
>
> When I revert rtl8169_xmii_reset_enable() to the code from the driver in
> 2.6.20.4 (see the diff below), then it works again, with the same
> behaviour as with 2.6.20.4.
[snip]
This patch alone is known to change things but it does not work
everywhere :o/
Can you:
- send the output of a 'lspci -vvx'
- send the output of mii-tool including hex dump of the registers with
2.6.20.4 and 2.6.21
- try 2.6.21 + http://www.fr.zoreil.com/people/francois/misc/20070430-2.6.21-r8169-test.patch
--
Ueimor
Anybody got a battery for my Ultra 10 ?
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <4636A499.6020709@foks.8m.com>]
* Re: r8169.c broke for me from 2.6.20.4 to 2.6.21
[not found] <4636A499.6020709@foks.8m.com>
@ 2007-05-02 22:31 ` Francois Romieu
2007-05-03 4:10 ` Jelle Foks
0 siblings, 1 reply; 5+ messages in thread
From: Francois Romieu @ 2007-05-02 22:31 UTC (permalink / raw)
To: Jelle Foks; +Cc: netdev
Please don't trim the Cc:. The bugs must be processed publicly to feed
the oracle.
Jelle Foks <jelle@foks.8m.com> :
> Francois Romieu wrote:
[...]
> > Can you:
> > - send the output of a 'lspci -vvx'
> >
> See attached lspci.txt, the ethernet card chip, obviously, at 00:0b.0
Plain old 8169. Ok.
[...]
> > - send the output of mii-tool including hex dump of the registers with
> > 2.6.20.4 and 2.6.21
> >
> $ sudo /sbin/mii-tool -v -v
> Using SIOCGMIIPHY=0x8947
> eth1: 10 Mbit, half duplex, link ok
> registers for MII PHY 32:
> 0000 794d 001c c910 0de1 0020 0004 2001
> 0000 0300 0000 1000 1007 f880 0000 3000
> 0060 0c00 0000 0000 0060 0000 009a 0108
> 2740 0088 0000 8000 8400 0000 0000 4830
> product info: vendor 00:07:32, model 17 rev 0
> basic mode: 10 Mbit, half duplex
> basic status: link ok
> capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
> advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
> link partner: 10baseT-HD
1. Can you send the output of mii-tool on the other kernel too ?
2. Any change if you use the patch below on 2.6.21 ? No need to wait for
minutes if it does not perform better btw.
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 5b42176..d2082ef 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -525,7 +525,8 @@ static unsigned int rtl8169_tbi_link_ok(void __iomem *ioaddr)
static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr)
{
- return RTL_R8(PHYstatus) & LinkStatus;
+ return (RTL_R8(PHYstatus) & LinkStatus) ? 1 :
+ (RTL_R8(PHYstatus) & LinkStatus);
}
static void rtl8169_tbi_reset_enable(void __iomem *ioaddr)
--
Ueimor
Anybody got a battery for my Ultra 10 ?
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: r8169.c broke for me from 2.6.20.4 to 2.6.21
2007-05-02 22:31 ` Francois Romieu
@ 2007-05-03 4:10 ` Jelle Foks
2007-05-27 22:32 ` Francois Romieu
0 siblings, 1 reply; 5+ messages in thread
From: Jelle Foks @ 2007-05-03 4:10 UTC (permalink / raw)
To: netdev
Francois Romieu wrote:
> Please don't trim the Cc:. The bugs must be processed publicly to feed
> the oracle.
Ok.
>
> Jelle Foks <jelle@foks.8m.com> :
>> Francois Romieu wrote:
> [...]
>>> Can you:
>>> - send the output of a 'lspci -vvx'
>>>
>> See attached lspci.txt, the ethernet card chip, obviously, at 00:0b.0
>
> Plain old 8169. Ok.
>
> [...]
>>> - send the output of mii-tool including hex dump of the registers with
>>> 2.6.20.4 and 2.6.21
>>>
>> $ sudo /sbin/mii-tool -v -v
>> Using SIOCGMIIPHY=0x8947
>> eth1: 10 Mbit, half duplex, link ok
>> registers for MII PHY 32:
>> 0000 794d 001c c910 0de1 0020 0004 2001
>> 0000 0300 0000 1000 1007 f880 0000 3000
>> 0060 0c00 0000 0000 0060 0000 009a 0108
>> 2740 0088 0000 8000 8400 0000 0000 4830
>> product info: vendor 00:07:32, model 17 rev 0
>> basic mode: 10 Mbit, half duplex
>> basic status: link ok
>> capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
>> advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
>> link partner: 10baseT-HD
>
> 1. Can you send the output of mii-tool on the other kernel too ?
>From the 2.6.21 pristine, when the link stays down:
Using SIOCGMIIPHY=0x8947
eth1: no link
registers for MII PHY 32:
1000 7949 001c c910 0de1 0000 0004 2001
0000 0300 0000 1000 1007 f880 0000 3000
0060 4000 0000 0040 0060 0000 0098 0108
2740 0088 0000 8000 8400 0000 0000 0840
product info: vendor 00:07:32, model 17 rev 0
basic mode: autonegotiation enabled
basic status: no link
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
>
> 2. Any change if you use the patch below on 2.6.21 ? No need to wait for
> minutes if it does not perform better btw.
No changes, link stays down, just like with 2.6.21 pristine.
Hope this helps,
Jelle.
>
> diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
> index 5b42176..d2082ef 100644
> --- a/drivers/net/r8169.c
> +++ b/drivers/net/r8169.c
> @@ -525,7 +525,8 @@ static unsigned int rtl8169_tbi_link_ok(void __iomem *ioaddr)
>
> static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr)
> {
> - return RTL_R8(PHYstatus) & LinkStatus;
> + return (RTL_R8(PHYstatus) & LinkStatus) ? 1 :
> + (RTL_R8(PHYstatus) & LinkStatus);
> }
>
> static void rtl8169_tbi_reset_enable(void __iomem *ioaddr)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-05-27 22:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-30 5:31 r8169.c broke for me from 2.6.20.4 to 2.6.21 Jelle Foks
2007-04-30 7:16 ` Francois Romieu
[not found] <4636A499.6020709@foks.8m.com>
2007-05-02 22:31 ` Francois Romieu
2007-05-03 4:10 ` Jelle Foks
2007-05-27 22:32 ` Francois Romieu
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).