LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   forcing e1000e driver on new device (old kernel... old everything) (http://www.linuxquestions.org/questions/linux-hardware-18/forcing-e1000e-driver-on-new-device-old-kernel-old-everything-4175428961/)

eantoranz 09-25-2012 10:45 AM

forcing e1000e driver on new device (old kernel... old everything)
 
Hi!

I've got this box that (for whatever reason, can't really tell why) got a ubuntu 10.04 installed on it. The problem is that it's got an intel ethernet card that's not got registered to use e1000e driver (and I check in my updated kubuntu box and it uses e1000e by modules.pcimap).

The card has PCI id 8086:1503.

Now, we hacked modules.pcimap and added a line like the one I have in my computer, then modprobed e1000e, the module got loaded but no new device.

Then rebooted, just in case, and the module didn't get loaded... so I bet there's something missing.

So, how can I force e1000e to use this device? I checked with modinfo and I don't see a parameter to tell e1000e which PCI id to use. Thanks in advance.

Didier Spaier 09-25-2012 11:17 AM

Yes e1000e is the driver for this card and it *should* be automatically loaded.

Maybe it's conflicting with another one, loaded first.

To find out, please send output of following command:
Code:

lspci -k | grep -A3 net
And attach to your next post the file lsmod.txt that you will write this way:
Code:

lsmod | sort > lsmod.txt
PS And please give us the output of
Code:

uname -r
as well so we know how old is your kernel. That could help determine how the modules are supposed to be selected then loaded.

eantoranz 09-25-2012 11:30 AM

It's an old kernel.... but I don't have the computer in front of me. Just asked the guys in front of the computer to do it... hold on a second. Just keep in mind that the device is not (was not, anyways) in modules.pcimap.... So there has to be a way to force the module to try to work on the device even if it thinks it shouldn't.

eantoranz 09-25-2012 12:05 PM

First command:
Code:

00:19.0 Ethernet controller: Intel Corporation Device 1503 (rev 05)
        Kernel modules: e1000e
00:1a.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #2 (rev 05)
        Kernel driver in use: ehci_hcd

Second
Code:

ahci                  32232  1
bitblit                4707  1 fbcon
fbcon                  35102  71
font                    7557  1 fbcon
hid                    67032  1 usbhid
lp                      7028  0
Module                  Size  Used by
parport                32635  3 ppdev,parport_pc,lp
parport_pc            26250  1
ppdev                  5259  0
psmouse                63245  0
serio_raw              3978  0
shpchp                28884  0
snd                    54148  6 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
snd_hda_codec          74201  2 snd_hda_codec_realtek,snd_hda_intel
snd_hda_codec_realtek  203312  0
snd_hda_intel          22037  0
snd_hwdep              5412  1 snd_hda_codec
snd_page_alloc          7172  2 snd_hda_intel,snd_pcm
snd_pcm                70886  2 snd_hda_intel,snd_hda_codec
snd_timer              19098  1 snd_pcm
softcursor              1189  1 bitblit
soundcore              6620  1 snd
tileblit                2031  1 fbcon
usbhid                36174  0
usb_storage            39457  0
vga16fb                11385  1
vgastate                8961  1 vga16fb

uname:
Code:

2.6.32-24-generic-pae
I guess in the first command, the module that shows up is because of the line we hacked in pcimap.

Didier Spaier 09-25-2012 12:41 PM

What puzzles me is ther be no driver in use. My Ethernet card needs the same driver and this is what I get as output of the first command:
Code:

00:19.0 Ethernet controller: Intel Corporation 82566MM Gigabit Network Connection (rev 03)
        Subsystem: Lenovo ThinkPad T61
        Kernel driver in use: e1000e
        Kernel modules: e1000e

So:
(1) Does e1000e shows in lsmod after you issue the"modprobe e1000e" command?
(2) Type as root "tail -f /var/log/messages in a terminal", then:
(a) unplug the Ethernet wire then
(b) plug it in
What do you see in the log?
(3) same as (2) but type as root
(a) "ifconfig eth0 up" then
(b) "ifconfig eth0 down"

Anyway, 2.6.32 is not that old and your card is supposed to be supported.

eantoranz 09-25-2012 01:29 PM

I just checked in vanilla 2.6.32 and it's not supported from what I can see.

In 3.6-rc5
http://git.kernel.org/?p=linux/kerne...1a24195dd08217 Line 412:
Code:

#define E1000_DEV_ID_PCH2_LV_V                  0x1503
Not so in 2.6.32. Take a look: http://git.kernel.org/?p=linux/kerne...d34d935308c8d7

Didier Spaier 09-25-2012 02:16 PM

That's right.

So I suggest you simply upgrade your e1000e driver to the most recent version that you will find here.

In the tarball, named e100e-2.1.4.tar.gz you will find a README including instructions to compile and install it. Of course your card is supported in it, I just checked ;)

eantoranz 09-25-2012 03:08 PM

Dude, you rock. :-)

eantoranz 09-25-2012 03:20 PM

The guys in maracaibo are checking if it works with the ubuntu server (I just tested compiling it on my updated laptop).

Now, let's suppose it works.... I dare making the same question: Is it possible to force a module to use a device? Perhaps with something generic like

Code:

modprobe e1000e pciid=8086:1503
Thanks in advance.

Didier Spaier 09-25-2012 04:24 PM

Your command won't bind the kernel module to the device. To do that "modprobe e1000e" is sufficient, provided the device be not yet claimed by another driver.

But don't bother to do manually what udev is supposed to do automatically for you.

If I understand correctly:
(1) After installing a module, run as root the command "modprobe -a". This will update the modules dependencies (needed by modprobe to work properly) and in addition update the file /lib/modules<kernel version>/modules.alias. To do that the command "modinfo <kernel module>" is automatically run for all installed modules and the lines beginning with "alias:" of the command's output are written in the aforementioned file, followed by the module's name.
(2) an udev rule like this one:
Code:

ACTION=="add", SUBSYSTEM=="pci", MODALIAS=="*", RUN+="/sbin/modprobe $modalias"
is usually triggered by a "udevadm trigger <options>" command, included in a startup script, which request device events from the kernel and apply the rule to theses events.

In our example the "modinfo e1000e" command's output includes, among others, following line:
Code:

alias:          pci:v00008086d00001503sv*sd*bc*sc*i*
which says "this is an alias for pci id 8086:1503".
So after running "depmod -a" we will see in /lib/modules<kernel version>/modules.alias following line:
Code:

alias pci:v00008086d00001503sv*sd*bc*sc*i* e1000e
When the "udevadm trigger <options>" command will be run at startup, the kernel will say "Eh, I've found the pci device 8086:1503", then the udev rule will be applied, which after reading the relevant line of modules.alias, will trigger the "/sbin/modprobe e1000e" command for you.

Of course, all that process takes much less time to be executed than it took me to write it down ;)

To know more, see here.

eantoranz 09-25-2012 04:38 PM

Pretty insightful.


All times are GMT -5. The time now is 12:09 PM.