bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Grub 0.93 3C90x Bug/Fix


From: Neil Newell
Subject: Grub 0.93 3C90x Bug/Fix
Date: Mon, 26 May 2003 19:54:09 +0100

Hi,

Herewith a bug report for grub 0.93, regarding the network driver for 3COM
PCI cards. I'm pretty sure I understand the cause, and attach a fix for it
(unified diff format). Also there's a CHANGELOG entry below.

Basically, I built 'nbgrub' from grub 0.93 for several PCs (Dell Dimension
PIII/800Mhz, ASUS P4B PII/400Mhz and Advantech PCA6179 PIII/1Ghz) fitted
with a mix of 3COM 3C905B and 3C905C cards. In every case 'nbgrub' locked
the system while probing the network card.

Investigating, I added debug to the 3c90x.c driver and mysteriously it then
started to work. Then I changed the debug and it failed again. To cut a
long story short, it turned out to be because the driver passes the address
of some internal structures to the card (which retrieves them via bus
mastering), and these structures were misaligned.

Emprically, it seems that if these structures are aligned on a 64-bit
boundary, all works ok (address is 0xxxx0 or 0xxxx8). If however they fall
in-between (typically 0xxxx4 or 0xxxxC) then the card fails to respond and
the result is a locked system.

The fix is simple: add "__attribute__ (aligned(8))" after the TXD and RXD
structures in the 3c90x.c source file (diff attached).

I've also submitted this fix to Etherboot as the original source of the
driver.

Also, I encountered a build error when building grub, as my version of GCC
does not support labelled structures. The problem was with the terminfo
structure at the top of terminfo.c, and the fix is of course to remove the
labels (if you want to support older versions of GCC).

Regards, and thanks for the program!

Neil Newell

My Build environment
--------------------

$uname -a
Linux liner.woodbarn.com 2.0.34 #1 Tue Jun 23 02:10:50 EDT 1998 i486 unknown

$gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs
gcc version 2.7.2.3

$ld -v
GNU ld version 2.10.1 (with BFD 2.10.1)

CHANGELOG
---------

2003-26-05 Neil Newell <address@hidden>

  * netboot/3c90x.c: Made structures passed to card 64-bit aligned
  to fix driver failures.

Attachment: 3c90x.c.diff
Description: Text document






reply via email to

[Prev in Thread] Current Thread [Next in Thread]