Subject: bin/7658: Some de(4) cards do not work when compiled w/o optimization
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Wrede <andreas@planix.com>
List: netbsd-bugs
Date: 05/27/1999 19:51:07
>Number:         7658
>Category:       bin
>Synopsis:       Some de(4) cards do not work when compiled w/o optimization
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 27 19:50:01 1999
>Last-Modified:
>Originator:     Andreas Wrede
>Organization:
Planix, Inc.
>Release:        NetBSD-1.4 Release
>Environment:
System: NetBSD test1 1.4 NetBSD 1.4 (TECTROL) #0: Thu May 27 21:55:43 EDT 1999     root@test1:/usr/src/sys/arch/i386/compile/TECTROL i386

>Description:
I have 2 21041-AA based D-Link DE-530  ethernet cards installed in a 
i386/Pentium II-Celeron based system which will not work unless if_de.c 
is compiled with -O2 (maybe -O1). The probe messages from the driver are 
identical in both cases (w and w/o -O2) but only the 'optimized' driver 
will manage to turn on the link light during the probe. 

The probe reports the cards as '21041 [10Mb/s] pass 1.1'. BTW, 21140
pass 2.2 cards work ok with and w/o optimized if_de.c.

This looks like a reverse compiler optimization bug, ie things break
when NOT optimized.

The runtime and build environment is stock 1.4 release.

>How-To-Repeat:
Compile if_de.c w/o -O2 by placing the line 'COPTS=' in /etc/mk.conf.
Build kernel. Boot. Observe link indicator on Ethernet hub/switch.

>Fix:
Unknown

----
NetBSD 1.4 (TECTROL) #0: Thu May 27 13:26:26 PDT 1999
    root@test1:/usr/src/sys/arch/i386/compile/TECTROL
cpu0: family 6 model 6 step 0
cpu0: Intel Pentium II (Celeron) (686-class)
real mem  = 133758976
avail mem = 121724928
using 1658 buffers containing 6791168 bytes of memory
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o enabled, memory enabled
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82443BX Host Bridge/Controller (rev. 0x03)
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o enabled, memory enabled
pcib0 at pci0 dev 7 function 0
pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <FUJITSU MPD3084AT>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 8063MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 16514064 sectors
wd0: 32-bits data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4, Ultra-DMA mode 3, 
Ultra-DMA mode 2
pciide0: primary channel interrupting at irq 14
pciide0: secondary channel wired to compatibility mode
wd1 at pciide0 channel 1 drive 0: <FUJITSU MPD3084AT>
wd1: drive supports 16-sector pio transfers, lba addressing
wd1: 8063MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 16514064 sectors
wd1: 32-bits data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4, Ultra-DMA mode 3, 
Ultra-DMA mode 2
pciide0: secondary channel interrupting at irq 15
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
wd1(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
uhci0 at pci0 dev 7 function 2: Intel 82371AB USB Host Controller (PIIX4) (rev. 
0x01)
uhci0: interrupting at irq 9
uhci0: USB version 1.0
usb0 at uhci0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
Intel 82371AB Power Management Controller (PIIX4) (miscellaneous bridge, revisio
n 0x02) at pci0 dev 7 function 3 not configured
vga1 at pci0 dev 13 function 0: S3 Trio64V2/DX (rev. 0x16)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
de0 at pci0 dev 14 function 0
de0: interrupting at irq 5
de0: 21041 [10Mb/s] pass 1.1
de0: address 00:80:c8:32:da:a4
de1 at pci0 dev 15 function 0
de1: interrupting at irq 10
de1: 21041 [10Mb/s] pass 1.1
de1: address 00:80:c8:32:da:a9
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
lpt0 at isa0 port 0x378-0x37b irq 7
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
apm0 at mainbus0: Power Management spec V1.1
apm0: A/C state: on
apm0: battery charge state: no battery
biomask c240 netmask c660 ttymask c6e2
wscons: wskbd0 glued to wsdisplay0 (console)
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
de0: enabling 10baseT port


>Audit-Trail:
>Unformatted: