12.04: How/when/where should I tweak PCI settings during boot?

Asked by frob on 2012-12-15

I try to get a D-Link DFE-580TX 4-port NIC working with a newer Intel Atom board. Unfortunately there seems to be a BIOS bug (see https://lkml.org/lkml/2007/5/4/376 ) causing two of the four ports to be unreachable. This is was dmesg says:

[ 2.017706] eth1: D-Link DFE-580TX 4 port Server Adapter at 0000000000011180, 00:00:00:00:00:00, IRQ 20.
[ 2.027222] eth1: No MII transceiver found, aborting. ASIC status ffffffff
[ 2.139840] eth1: D-Link DFE-580TX 4 port Server Adapter at 0000000000011100, 00:00:00:00:00:00, IRQ 21.
[ 2.148791] eth1: No MII transceiver found, aborting. ASIC status ffffffff
[ 2.205496] eth1: D-Link DFE-580TX 4 port Server Adapter at 0000000000011080, 00:1e:58:df:fb:66, IRQ 22.
[ 2.206577] eth1: MII PHY found at address 1, status 0x7809 advertising 01e1.
[ 2.523119] eth2: D-Link DFE-580TX 4 port Server Adapter at 0000000000011000, 00:1e:58:df:fb:67, IRQ 23.
[ 2.524254] eth2: MII PHY found at address 1, status 0x7809 advertising 01e1.

The proposed solution is to unset the NoISA bit of the pci bridge (with something like "setpci -s 05:00.0 3e.b=00" _before_ the NIC is scanned.

Which leads to my problem: Where in the hell of upstart/sysinit should I do that nowadays?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
2012-12-16
Last query:
2012-12-16
Last reply:
2012-12-15

If you boot the OS and run the command then restart the networking service, is it ok?

frob (mehl) said : #2

I am not sure whether "/etc/init.d/networking restart" still does what it used to do in former times ;)

However:

#> rmmod sundance
#> setpci -s 05:00.0 3e.b=00
#> modprobe sundance
$> ifconfig -a

gives me all the four ports.

Brilliant. You have done the hard bit. run:

gksudo gedit /usr/bin/fixusb; sudo chmod +x /usr/bin/fixusb

add these 4 lines:

#!/bin/bash
sudo modprobe -r sundance
sudo setpci -s 05:00.0 3e.b=00
sudo modprobe sundance

Save the new file, close gedit then run:

gksudo gedit /etc/rc.local

Above the 'exit 0' line, add the line:

/usr/bin/fixusb

Save the new file, close gedit. The commands will now run at boot, as root and be ok. Reboot to test

frob (mehl) said : #4

Ah. That's like kicking the hardware detection from behind -- not elegant but effective. Thanks!

(for future reference: the 05:00.0 in the setpci command addresses the "Intel Corporation 21152 PCI-to-PCI Bridge"
on the NIC card itself. That device number varies from system to system. The correct number can be found with lspci.

frob (mehl) said : #5

Thanks actionparsnip, that solved my question.

I suggest you backup the script :).

There is probably a more graceful method but if it works then who cares.