Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)

2010-04-20 Thread Florent Rougon
Hi,

I applied this patch
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573007#54) on March
29[1], but unfortunately, the bug is still there for me. More precisely,
my script which detects and works around the problem triggered at the
following times since then:

Thu, 01 Apr 2010 21:11:18 +0200  Attempt to reinitialize Ethernet interfaces
Thu, 08 Apr 2010 10:21:39 +0200  Attempt to reinitialize Ethernet interfaces
Wed, 14 Apr 2010 10:42:20 +0200  Attempt to reinitialize Ethernet interfaces
Thu, 15 Apr 2010 10:27:03 +0200  Attempt to reinitialize Ethernet interfaces

(sorry, I was too busy to report before)

I just modified it so that it also logs the HW address of the Ethernet
interface that was detected as failed, and will report next time I have
a failure, to make sure we are really talking about the same bug (I also
noticed #516187...).

Thanks.


  [1] As I wrote to Ben Hutchings in private, I applied the patch on the
  source tree obtained from linux-source-2.6.32_2.6.32-10_all.deb
  and compiled with the standard kernel configuration options from
  linux-image-2.6.32-4-amd64_2.6.32-10_amd64.deb (/boot/config-...)

  I also investigated the following boot messages:

  [1.449790] r8169 :02:00.0: firmware: requesting rtl8168d-2.fw
  [1.529423] eth0: unable to apply firmware patch
  [2.338209] r8169 :03:00.0: firmware: requesting rtl8168d-2.fw
  [2.339586] eth1: unable to apply firmware patch

  but found no place to download the firmware file from, despite
  several people complaining about that and not finding the
  aforementioned file either. Apparently, the firmware file is not
  needed, or only for some model(s) if used in this or that way, but
  the message is always printed, no matter what.

-- 
Florent



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)

2010-03-28 Thread Florent Rougon
Another possible workaround (didn't try Ben's one, I just discovered
this thread today):

Save the attached script in /root/bin/flo-check-network-connections
(using bash because of $RANDOM). Change the line:

  interfaces=eth0 eth1

to list the interfaces that have the problem (and that you want to be
up; if you have unused interfaces that are managed by the buggy driver,
you can omit them from the list)

In /etc/init.d/networking, replace the line:

if ifup -a; then

with

if ifup -a; /root/bin/flo-check-network-connections; then

The script, when called, does the following:

  - if all listed interfaces are up and have a proper inet addr
setting according to ifconfig, do nothing;

  - otherwise, try to fix the problem by doing several
modprobe -r r8169; modprobe r8169 in a row, followed by an
ifdown -a / ifup -a sequence (you may pass arguments to the script
here, that are passed along to ifup and ifdown).

Yes, this clunky procedure does work for me, contrary to the
cold boot / wait 30 s workaround I found in another bug report;
you might want to modify $max_attempts, which I have set to 15 by
default; it has always worked for me in about 1-3 attempts.

The script returns exit status 0 if success (i.e., the listed interfaces
are properly initialized [maybe were already so before the script was
called]), 1 otherwise.

Of course, this is just a workaround for an annoying problem. A proper
fix in the kernel would be most welcome. :-)

HTH.

-- 
Florent



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)

2010-03-28 Thread Florent Rougon
Would be even better with the script actually attached...

-- 
Florent
#! /bin/bash

interfaces=eth0 eth1
max_attempts=15
exit_status=1

for attempt in $(seq 1 $max_attempts); do
all_intf_ok=1
for intf in $interfaces; do
ifconfig $intf | grep /dev/null ^[[:space:]]*inet addr: \
  || { all_intf_ok=0; break; }
done

[ $all_intf_ok -eq 1 ]  { exit_status=0; break; }

echo Ethernet interfaces not properly initialized. \
Trying to fix that (attempt $attempt)...
n=$(echo ($RANDOM % 3) + 2 | bc)
for i in $(seq 1 $n); do
modprobe -r r8169; modprobe r8169
done

ifdown -a $@
ifup -a $@
done

exit $exit_status


Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)

2010-03-28 Thread Ben Hutchings
On Sun, 2010-03-28 at 18:33 +0200, Florent Rougon wrote:
[...]
 Of course, this is just a workaround for an annoying problem. A proper
 fix in the kernel would be most welcome. :-)

This is now being handled upstream and there is a proposed fix.  We will
apply that once it has been tested across a range of RTL8169-family
chips.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


signature.asc
Description: This is a digitally signed message part


Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)

2010-03-28 Thread Florent Rougon
Ben Hutchings b...@decadent.org.uk wrote:

 This is now being handled upstream and there is a proposed fix.  We will
 apply that once it has been tested across a range of RTL8169-family
 chips.

Thank you. If it can be of some help, I may test something. I am
currently using upstream 2.6.32 compiled with make-kpkg on lenny. My
Ethernet chip is RTL8111D according to the motherboard manual, and the
MB itself is Gigabyte GA-P55-UD5.

'lspci -v' says:

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI 
Express Gigabit Ethernet controller (rev 03)
Subsystem: Giga-byte Technology Device e000
Flags: bus master, fast devsel, latency 0, IRQ 35
I/O ports at ae00 [size=256]
Memory at fb6ff000 (64-bit, prefetchable) [size=4K]
Memory at fb6f8000 (64-bit, prefetchable) [size=16K]
[virtual] Expansion ROM at fb60 [disabled] [size=128K]
Capabilities: [40] Power Management version 3
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 
Enable+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [ac] MSI-X: Enable- Mask- TabSize=4
Capabilities: [cc] Vital Product Data ?
Capabilities: [100] Advanced Error Reporting ?
Capabilities: [140] Virtual Channel ?
Capabilities: [160] Device Serial Number 00-e0-4c-68-00-00-00-03
Kernel driver in use: r8169
Kernel modules: r8169

[ About the script I posted, if anyone wants to use it in the meantime:
  I noticed one can be more specific by replacing the ifup/ifdown -a
  calls with ifup/ifdown $interfaces. ]

Regards,

-- 
Florent



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)

2010-03-28 Thread Ben Hutchings
On Sun, 2010-03-28 at 19:06 +0200, Florent Rougon wrote:
 Ben Hutchings b...@decadent.org.uk wrote:
 
  This is now being handled upstream and there is a proposed fix.  We will
  apply that once it has been tested across a range of RTL8169-family
  chips.
 
 Thank you. If it can be of some help, I may test something. I am
 currently using upstream 2.6.32 compiled with make-kpkg on lenny.

The patch is:

From: François Romieu rom...@fr.zoreil.com
Subject: [PATCH] r8169: fix broken register writes
Date: Sun, 28 Mar 2010 01:31:43 +0100

This is quite similar to b39fe41f481d20c201012e4483e76c203802dda7
though said registers are not even documented as 64-bit registers
- as opposed to the initial TxDescStartAddress ones - but as single
bytes which must be combined into 32 bits at the MMIO read/write
level before being merged into a 64 bit logical entity.

Credits go to Ben Hutchings b...@decadent.org.uk for the MAR
registers (aka multicast is broken for ages on ARM) and to
Timo Teräs timo.te...@iki.fi for the MAC registers.

Signed-off-by: Francois Romieu rom...@fr.zoreil.com
---
 drivers/net/r8169.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 9d3ebf3..966407c 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2821,8 +2821,8 @@ static void rtl_rar_set(struct rtl8169_private *tp, u8 
*addr)
spin_lock_irq(tp-lock);

RTL_W8(Cfg9346, Cfg9346_Unlock);
-   RTL_W32(MAC0, low);
RTL_W32(MAC4, high);
+   RTL_W32(MAC0, low);
RTL_W8(Cfg9346, Cfg9346_Lock);

spin_unlock_irq(tp-lock);
@@ -4754,8 +4754,8 @@ static void rtl_set_rx_mode(struct net_device *dev)
mc_filter[1] = swab32(data);
}

-   RTL_W32(MAR0 + 0, mc_filter[0]);
RTL_W32(MAR0 + 4, mc_filter[1]);
+   RTL_W32(MAR0 + 0, mc_filter[0]);

RTL_W32(RxConfig, tmp);

-- 
1.6.6.1

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


signature.asc
Description: This is a digitally signed message part