update 16-Sep-00
As of the official Linux 2.2.17 kernel (and probably before), all the changes referred to here appear to have been rolled into the official kernel tree; therefore, this patch should not be necessary.
significance of the patch
- The issue may be specific to the 6500, which, with its UnPerforma form-factor, does not have built-in ethernet. Some other 6500 owners do not report this failure. It could somehow be related to the ethernet card used, but I believe this to be unlikely. My failure description is similar to several past pleadings to the dominant LinuxPPC user list. To wit, with respect to certain [most all, to be described below] kernels, the ethernet fails repeatably in the following way:
- In a terminal window, start pinging a destination. This destination can be anything from the resident ethernet card (loopback address) to any IP on the LAN or outside net. The pings proceed normally.
- Launch Netscape or vanilla ftp and begin browsing or ftp-ing.
- Within a short while (a couple of web pages or ftp directory changes), the Netscape or ftp client stalls, and the ping terminal-output stops cold, never to continue.
- From time to time, the ping exhibits an odd pattern before failure: amongst the normal 200-600 ms ping returns, there are interspersed (every 6 or 7 pings) return times of 6000-7000 ms, very repeatable when it happens, but it does not always occur before failure.
- Pinging from the other side (LAN or external ethernet) to the Linux-resident ethernet card again seems fine until the failure, when suddenly no pings are returned at all.
- Reboot cures it until the procedure is tried again, which brings the same overall failure 100% of the time.
- With some kernels there is a crash (freeze) on reboot, right at the shutdown message about not being able to close the net-pf-4 module. net-pf-4 is not relevant; rather, this point in the shutdown is very close to where the ifdown scripts are being run to tear down the routing table, IIRC.
- here is what I tried, looking for a solution:
- used ppp. No problem using Netscape and/or ftp.
- tried a different physical LAN. same failure.
- consulted privately with local Linux gurus.
- tried different ethernet cards (Farallon 10, ZYNX 10/100 cards). same failure.
- began poking at de4x5.c, thinking maybe the autosensing might be screwed up or something. Recompiled with various minor changes. same failure.
- tried all kernels I could find from 2.1.125 to present. The 2.1.24 kernel with the R4 distribution never worked at all w.r.t. ehternet, so it is irrelevant. The entire 2.1.xxx and 2.2-preX series all failed as described above, as well as the current 2.2.x kernels. The exception was the 2.1.130 and 2.2.1 prebuilt kernels from Paul Makerras' site. This was the crucial clue.
- here is a response I got from Paul Mackerras on the issue:
The problem is, AFAICT, caused by a hardware bug in the 6500 where it doesn't correctly maintain cache coherency between the cpu and a dma-capable device (e.g. your ethernet card) in the comms slot. My version of drivers/net/de4x5.c contains a workaround for this problem. (I have sent the patch off to Linus and the de4x5 maintainer but I haven't got any response.) That's why kernels built with the source from samba work whereas the vger source doesn't.
- usage notes:
I have never run a CSII (comm slot) card in the 6500. When I used R4, I had a Farallon 10BT card, and this patch was absolutely required to use the ethernet for more than a minute or so on the internet on all kernels up to 2.2.8 (the last one I tried on R4). Interestingly, without the patch LAN performance was much better than outside internet usage but could still be intermittent at times.
With R5, I am using an Apple OEM 10/100BT card. I note that without the patch, the internet usage is much better than with the Farallon card, while the LAN usage can still be intermittent. With the patch, things seem much better again, but I have no physical benchmarks.
I have heard from a number of people that this patch definitely helped with ethernet on the 6500. It may make a difference on other Macs as well. I have noted in running R5 on a PowerTowerPro that this patch seems irrelevant.
where to get the patch
how to apply it
- put the patch file in your /usr/src/linux directory and name it patch-de4x5-2.2.x
- run patch -p1 < patch-de4x5-2.2.x from /usr/src/linux
- result should be
patching file `drivers/net/de4x5.c'