Bug 5736

Summary: pci broken on PIIX/ICH laptop (CARDBUS_IO_SIZE too small?)
Product: Drivers Reporter: Sascha Lucas (sascha.lucas)
Component: PCIAssignee: Greg Kroah-Hartman (greg)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: bunk, kernel, torvalds
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.15-rc5 Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 5829    
Attachments: config off 2.6.13-gentoo-r3
config of 2.6.15-rc5
dmesg off 2.6.13-gentoo-r3
/proc/pci with 2.6.13-gentoo-r3
output from lspci -v
CARDBUS_IO_SIZE 256 -> 4*1024
dmesg output with working 2.6.15 (CARDBUS_IO_SIZE=4*1024)

Description Sascha Lucas 2005-12-13 06:25:33 UTC
Most recent kernel where this bug did not occur: 2.6.13

Distribution: gentoo (gentoo+vanilla sources)

Hardware Environment: PIII-M 600MHz, PIIX4/ICH, TI PCI1410 card Cardbus

Software Environment: gcc 3.3.5/3.3.6

Problem Description: kernel boot stops when it comes to PCI initialisation
(log writen by hand):

PCI: Bus 1, cardbus bridge: 0000:00:08.0
  IO window: 00001000-000010ff
  IO window: 00001400-000014ff
  PREFETCH window: 12000000-13ffffff
  MEM window: 14000000-15ffffff
PCI: Found IRQ 10 for device 0000:00:08.0
Machine check exception polling timer started.

After this system hangs.

I noticed that all window-lines have different adresses in 2.6.13.

Steps to reproduce: boot >=2.6.14
Comment 1 Sascha Lucas 2005-12-13 06:26:54 UTC
Created attachment 6810 [details]
config off 2.6.13-gentoo-r3
Comment 2 Sascha Lucas 2005-12-13 06:27:36 UTC
Created attachment 6811 [details]
config of 2.6.15-rc5
Comment 3 Sascha Lucas 2005-12-13 06:28:29 UTC
Created attachment 6812 [details]
dmesg off 2.6.13-gentoo-r3
Comment 4 Sascha Lucas 2005-12-13 06:30:49 UTC
Created attachment 6813 [details]
/proc/pci with 2.6.13-gentoo-r3
Comment 5 Sascha Lucas 2005-12-13 06:31:43 UTC
Created attachment 6814 [details]
output from lspci -v
Comment 6 Daniel Drake 2005-12-13 07:27:35 UTC
Downstream bug: http://bugs.gentoo.org/115101
Comment 7 Greg Kroah-Hartman 2006-01-04 14:38:04 UTC
Does this still happen on 2.6.15?
Comment 8 Sascha Lucas 2006-01-11 12:36:42 UTC
Sorry for being late (christmas holiday).

Yes the problem still exists with 2.6.15.
Comment 9 Sascha Lucas 2006-01-19 09:48:18 UTC
arg... its a one line patch... picked just the value from 2.6.13 in drivers/pci/
setup-bus.c: define CARDBUS_IO_SIZE

I learned pascal at school, nothing more. Why nobody helped me?
Comment 10 Sascha Lucas 2006-01-19 09:50:47 UTC
Created attachment 7076 [details]
CARDBUS_IO_SIZE 256 -> 4*1024
Comment 11 Daniel Drake 2006-01-19 10:32:30 UTC
Linus,

Your commit 26aad69e3dd854abe9028ca873fb40b410a39dd7
(http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=26aad69e3dd854abe9028ca873fb40b410a39dd7)
from back in August appears to have caused this regression.

Any ideas?
Comment 12 Linus Torvalds 2006-01-19 10:48:47 UTC

On Thu, 19 Jan 2006, bugme-daemon@bugzilla.kernel.org wrote:
> 
> Your commit 26aad69e3dd854abe9028ca873fb40b410a39dd7
> (http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=26aad69e3dd854abe9028ca873fb40b410a39dd7)
> from back in August appears to have caused this regression.
> 
> Any ideas?

I bet that his machine has something magical that is covered by either of 
the new IO window selection logic:

	PCI: Bus 1, cardbus bridge: 0000:00:08.0
	  IO window: 00001000-000010ff
	  IO window: 00001400-000014ff

and the cardbus IO size thing was just totally random in that it just 
caused a different IO allocation layout.

In the working config, the bigger windows means that the allocation is 
instead

	PCI: Bus 1, cardbus bridge: 0000:00:08.0
	  IO window: 00002000-00002fff
	  IO window: 00004000-00004fff

but I _really_ don't see what it could be.

Sasha: can you try 2.6.15 with that one line changed back? I'd like to see 
the bootup dmesg output for that (to see if you have any mention of the 
magic PIIX4 resources in your allocations..)

			Linus

Comment 13 Sascha Lucas 2006-01-19 11:44:55 UTC
Created attachment 7079 [details]
dmesg output with working 2.6.15 (CARDBUS_IO_SIZE=4*1024)
Comment 14 Daniel Ritz 2006-08-17 06:19:19 UTC
later kernels (2.6.18-rc2 and higher) should have this fixed by this commit:
http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c67646641cab01c93a56674bfcd963f55442dad5
it's a one-liner and should apply to earlier kernels as well.
Comment 15 Sascha Lucas 2006-08-17 06:57:14 UTC
Thanks Daniel! The effected laptop is 500 km and 14 days away. Will test your 
patch as soon as I have it back.
Comment 16 Sascha Lucas 2006-09-14 02:36:34 UTC
confirmed. the patch listed above with the acpi quirk works (tested with 
2.6.17.11).