Bug 67151 - sky2 module causes kernel BUG in /usr/include/linux/netdevice.h:501
Summary: sky2 module causes kernel BUG in /usr/include/linux/netdevice.h:501
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: IA-32 Linux
: P1 blocking
Assignee: drivers_network@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-17 02:51 UTC by ebrahim.azarisooreh
Modified: 2014-01-25 15:40 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.12.8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
sky2_napi_init.patch (709 bytes, text/plain)
2014-01-23 18:34 UTC, Stanislaw Gruszka
Details

Description ebrahim.azarisooreh 2013-12-17 02:51:55 UTC
sky2 module causes random occurence of kenel bug error on boot-up, for newer versions. However using Linux 3.10.24-1-lts does not produce any issues for me.

My Ethernet Controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)

When I do see the error, the boot cycle goes straight to a black screen and halts. I am forced to fall back and log into non-gui environment, and am eventually forced into a hard reset. When I don't see the error everything runs fine.

I see this on bootup (a majority of my reboots, but not 100% reproducible):

[    9.699863] sky2: driver version 1.30
[    9.699960] sky2 0000:02:00.0: Yukon-2 EC Ultra chip revision 2
[    9.700020] sky2 0000:02:00.0: irq 45 for MSI/MSI-X
[    9.700498] ------------[ cut here ]------------
[    9.703391] kernel BUG at include/linux/netdevice.h:501!
[    9.703391] invalid opcode: 0000 [#1] PREEMPT SMP 
[    9.703391] Modules linked in: sky2(+) i2c_core snd_hda_codec_analog acpi_cpufreq processor button snd_hda_intel(+) snd_hda_codec snd_hwdep snd_pcm snd_page_alloc snd_timer snd soundcore shpchp intel_agp asus_atk0110 intel_gtt agpgart ext4 crc16 mbcache jbd2 sd_mod hid_logitech ff_memless usbhid hid firewire_ohci ahci libahci firewire_core crc_itu_t libata scsi_mod ehci_pci uhci_hcd ehci_hcd usbcore usb_common
[    9.703391] CPU: 0 PID: 155 Comm: dhcpcd Not tainted 3.12.5-1-ARCH #1
[    9.703391] Hardware name: System manufacturer P5K-E/P5K-E, BIOS 0906    12/10/2007
[    9.703391] task: f562f4d0 ti: f50fa000 task.ti: f50fa000
[    9.703391] EIP: 0060:[<fa99372f>] EFLAGS: 00010246 CPU: 0
[    9.703391] EIP is at sky2_setup_irq+0x9f/0xb0 [sky2]
[    9.703391] EAX: 00000000 EBX: f51c8100 ECX: 00000089 EDX: 00000000
[    9.703391] ESI: f5dfb000 EDI: 00000000 EBP: f50fbdf0 ESP: f50fbdd8
[    9.703391]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[    9.830016] sky2 0000:02:00.0 eth0: addr 00:1b:fc:61:1c:91
[    9.830018] CR0: 80050033 CR2: f9133760 CR3: 356f4000 CR4: 000007d0
[    9.830018] Stack:
[    9.830018]  00000000 f51b1000 f51c8100 f51b1000 f51c8100 00000000 f50fbe2c fa996169
[    9.830018]  00000020 00000000 c1007210 00000400 f51b15b4 00000000 f50fbe1c c1007210
[    9.830018]  f51b1500 000000e0 f51b1000 fa999f40 00000000 f50fbe50 c135ed4b 00000246
[    9.830018] Call Trace:
[    9.830018]  [<fa996169>] sky2_open+0x309/0x360 [sky2]
[    9.830018]  [<c1007210>] ? via_no_dac+0x40/0x40
[    9.830018]  [<c1007210>] ? via_no_dac+0x40/0x40
[    9.830018]  [<c135ed4b>] __dev_open+0x9b/0x120
[    9.830018]  [<c1431cbe>] ? _raw_spin_unlock_bh+0x1e/0x20
[    9.830018]  [<c135efd9>] __dev_change_flags+0x89/0x150
[    9.830018]  [<c135f148>] dev_change_flags+0x18/0x50
[    9.830018]  [<c13bb8e0>] devinet_ioctl+0x5d0/0x6e0
[    9.830018]  [<c13bcced>] inet_ioctl+0x6d/0xa0
[    9.830018]  [<c1346094>] sock_ioctl+0x114/0x250
[    9.830018]  [<c1345f80>] ? sock_fasync+0x80/0x80
[    9.830018]  [<c1166416>] do_vfs_ioctl+0x2e6/0x4e0
[    9.830018]  [<c1435127>] ? __do_page_fault+0x2e7/0x580
[    9.830018]  [<c11576f6>] ? __fput+0x106/0x1f0
[    9.830018]  [<c116668f>] SyS_ioctl+0x7f/0x90
[    9.830018]  [<c143874d>] sysenter_do_call+0x12/0x28
[    9.830018] Code: 8d 74 26 00 8b 86 d8 01 00 00 83 c6 64 89 34 24 c7 44 24 04 91 97 99 fa 89 44 24 08 e8 fb d1 95 c6 89 f8 83 c4 0c 5b 5e 5f 5d c3 <0f> 0b eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 90 55 89 e5 53
[    9.830018] EIP: [<fa99372f>] sky2_setup_irq+0x9f/0xb0 [sky2] SS:ESP 0068:f50fbdd8
[   10.114977] ---[ end trace 6853181d11e5e45a ]---
Comment 1 Stanislaw Gruszka 2014-01-23 18:34:09 UTC
Created attachment 123201 [details]
sky2_napi_init.patch

Does the attached patch fix the problem ?
Comment 2 ebrahim.azarisooreh 2014-01-24 06:52:36 UTC
(In reply to Stanislaw Gruszka from comment #1)
> Created attachment 123201 [details]
> sky2_napi_init.patch
> 
> Does the attached patch fix the problem ?
Comment 3 ebrahim.azarisooreh 2014-01-24 06:57:32 UTC
(In reply to Stanislaw Gruszka from comment #1)
> Created attachment 123201 [details]
> sky2_napi_init.patch
> 
> Does the attached patch fix the problem ?

Stanislaw, thank you for your response. I have applied your patch to sky2.c with the kernel 3.12.8 (There was no difference between that one and 3.12.5), and was able to successfully compile the module, however the sky2 does not load succesfully on boot-up. I am working on the issue at the moment, and when I find time I will try to isolate what is going on, and apprise you of the results afterwards.
Comment 4 Stanislaw Gruszka 2014-01-24 11:53:37 UTC
Perhaps patch cause that not-load issue (but AFICT it should not) ? What happen if you reload module manually by "modprobe -r sky2 ; modprobe sky2" ?
Comment 5 ebrahim.azarisooreh 2014-01-24 11:58:53 UTC
Stanislaw, silly me I realized that I was only loading the module via modprobe, but not loading the entire compiled kernel... AFAIK you can only do that if you enable DKMS. So my "unsuccessful" modprobe is not a valid result (it was saying bad exec format). I will try again. Thank you for following up.
Comment 6 ebrahim.azarisooreh 2014-01-24 12:04:34 UTC
(In reply to Stanislaw Gruszka from comment #4)
> Perhaps patch cause that not-load issue (but AFICT it should not) ? What
> happen if you reload module manually by "modprobe -r sky2 ; modprobe sky2" ?

Actually dkms should not matter here, because I am loading sky2 via modprobe. So recompiling the kernel is not necessary .... My error says:

ERROR: could not insert 'sky2': Exec format error

Any idea?
Comment 7 Stanislaw Gruszka 2014-01-24 13:27:33 UTC
You compile external sky2 module with wrong kernel sources. You should set proper kernel directory in the Makefile, for example:

KDIR  := /lib/modules/$(shell uname -r)/build
obj-m := sky2.o
all:
        $(MAKE) -C $(KDIR) M=$(PWD)
Comment 8 Stanislaw Gruszka 2014-01-24 13:32:14 UTC
Or perhaps you compile for wrong architecture i.e. for 32-bit instead of 64 bit, then you have to specify ARCH= parameter, for example:

        $(MAKE) ARCH=x86_64 -C $(KDIR) M=$(PWD)
Comment 9 ebrahim.azarisooreh 2014-01-24 21:41:44 UTC
(In reply to Stanislaw Gruszka from comment #8)
> Or perhaps you compile for wrong architecture i.e. for 32-bit instead of 64
> bit, then you have to specify ARCH= parameter, for example:
> 
>         $(MAKE) ARCH=x86_64 -C $(KDIR) M=$(PWD)

It works! All success! Network is up, and no crash on bootup; earlier I was stripping the debug symbols, I guess linux does not like that? Anyway, thank you for your help and patience, and being a nice guy through it all. One more thing: Who should I notify of this bug?
Comment 10 Stanislaw Gruszka 2014-01-25 10:34:33 UTC
I'll post the patch, it will be queued and applied, but it can take some time before patch will be released with new kernel version.
Comment 11 ebrahim.azarisooreh 2014-01-25 15:40:09 UTC
Okay, sound good to me. By the way, try linux-ck kernel if you haven't already, it is awesome. [=
And one last expression of my gratitude again; I am in your debt.

Note You need to log in before you can comment on or make changes to this bug.