Bug 15454

Summary: r8169 exits with error -22 since 2.6.33
Product: Drivers Reporter: Conrad Kostecki (ck+kernelbugzilla)
Component: NetworkAssignee: Francois Romieu (romieu)
Severity: normal CC: akpm, dave, florian, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.33 Tree: Mainline
Regression: Yes
Bug Depends on:    
Bug Blocks: 14885    
Attachments: /var/log/dmesg
Failure to enable MWI should not be fatal

Description Conrad Kostecki 2010-03-05 22:32:00 UTC
I've some strange problems here.
With Kernel 2.6.32 my network is working fine. The r8169 driver loads fine.
But I am unable to use the newest kernel. With 2.6.33, r8169 can't be loaded due error -22.

OS: Gentoo Linux
Kernel: 2.6.33-gentoo & 2.6.33-vanilla (tried both)

What now? Which moreinfos do you need?
Comment 1 Conrad Kostecki 2010-03-05 22:32:25 UTC
Created attachment 25372 [details]

attaching /var/log/dmesg
Comment 2 Conrad Kostecki 2010-03-05 22:33:31 UTC
r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
r8169 0000:06:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
r8169 0000:06:00.0: PCI INT A disabled
r8169: probe of 0000:06:00.0 failed with error -22
Comment 3 Andrew Morton 2010-03-05 22:41:14 UTC
Assigned to Francois, marked as a regression.
Comment 4 Francois Romieu 2010-04-03 19:45:30 UTC
Created attachment 25838 [details]
Failure to enable MWI should not be fatal
Comment 5 David Dillow 2010-04-09 01:26:50 UTC
I think r8169 is a canary pointing to a different problem.

The only reason pci_set_mwi() should return -EINVAL is if pci_set_cacheline_size() returns it, and that only happens if pci_cache_line_size is 0 or otherwise not supported by the card.

Does reverting ac1aa47b131416a6ff37eb1005a0a1d2541aad6c fix the issue?

If so, it would be interesting to see what the value of pci_cache_line_size is when it fails.
Comment 6 Conrad Kostecki 2010-04-09 13:43:44 UTC
I am not sure, what the problem is. But I've tracked it down.

I need to enable CONFIG_PCI_QUIRKS, when I am using CONFIG_EMBEDDED. Without this, Kernel 2.6.33 won't work with R8169.

But, Kernel 2.6.32 works fine with R8169 and without CONFIG_PCI_QUIRKS and enabled CONFIG_EMBEDDED.
Comment 7 Florian Mickler 2010-12-08 07:06:35 UTC
I don't really know if this is a bug or not. I'm guessing it is not a bug, as the CONFIG_EMBEDDED option comes with a guarantee-void warning:

"This option allows certain base kernel options and settings to be disabled or tweaked. This is for specialized environments which can tolerate a "non-standard" kernel. Only use this if you really know what you are doing."

If no one shouts, I'm going to close this as ... invalid?. 

The patch in comment #4 ( https://bugzilla.kernel.org/attachment.cgi?id=25838 ) got merged in 2.6.34-rc6: 
commit 87aeec767e1de60d7f76abbb44df5372b0932b7b
Author: fran├žois romieu <romieu@fr.zoreil.com>
Date:   Mon Apr 26 11:42:06 2010 +0000

    r8169: failure to enable mwi should not be fatal