Bug 3319

Summary: Kernel does assign wrong IRQ to device driver - VIA quirk
Product: ACPI Reporter: Andreas Schallenberg (Andreas.Schallenberg)
Component: Config-InterruptsAssignee: Zwane Mwaikambo (zwane)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, bjorn.helgaas
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.6 and later Subsystem:
Regression: --- Bisected commit-id:
Attachments: Output of the dmidecode command
Output of the lspci -vvv command
Extract of contents: /var/log/messages from 2.6.4 and 2.6.7 (both SuSE)
USB messages (kernel 2.6.6-rc3-bk9) / search for last working kernel version
Report on tests using kernel parameters and kernels without ACPI support
Report on futher tests using kernel parameters
dmesg output, just ACPI, USB, RhineII, APIC
debug patch
lspci -n
new test patch
dmesg output after applying patch from #17 to 2.6.10-rc2-bk13
Test patch
general VIA quirk
some of the backport to kernel 2.4 :)
2.4 version of the patch
patch for 2.4 with more debug
incremental 2.6.11 patch from Bjorn Helgaas
patch for kernel 2.4.30 (http://bugme.osdl.org/attachment.cgi?id=4799 more new email do VIA IRQ fixup always, not just in PIC mode
just the debug part
In the debug printks, you might want to also print out pci_name(dev)
test case

Description Andreas Schallenberg 2004-08-31 08:13:14 UTC
Distribution: 
SuSE 9.1 
 
Hardware Environment: 
HP Omibook xe4100 
(a very detailed table, but german: 
http://members.telering.at/willhoschek/dataSheet.html) 
 
Software Environment: 
 
Problem Description: 
The laptop has a Rhine II network chip which is accessible 
under IRQ 11. However, from the kernel version 2.6.5-bk2 on 
it is detected on other IRQ numbers which makes the network 
card dead. 
 
Situations: 
1) Used SuSE 9.1 with its 2.6.4 kernel: network ok 
2) Updated to SuSE-2.6.7: network fails 
3) Gone back to SuSE-2.6.4: network ok 
4) "acpi=no" with "noapic" on SuSE-2.6.7 kernel: network fails 
5) "pci=noacpi" on vanilla-2.6.8-cvs (24 Aug 2004): network fails 
6) Compiled a vanilla-2.6.8.1 kernel with via-rhine.c 
   from SuSE-2.6.4: network fails 
7) Then tracked down the exact kernel and the 
   bk version where it starts to fail. 
 
It appears to be a IRQ assignment problem since the 
working kernel assigns IRQ 11 to the rhine chip and 
2.6.7 uses 9. Then a message for IRQ 11 appears in the 
logs which says that nobody cared about it. 
 
SuSE-2.6.4    --> IRQ 11 --> eth0 works 
vanilla-2.6.5 --> IRQ 11 --> eth0 works 
vanilla-2.6.5-bk2 --> IRQ 11 --> eth0 works 
vanilla-2.6.6 --> IRQ 12 --> eth0 failure 
SuSE-2.6.7    --> IRQ 9  --> eth0 failure 
vanilla-2.6.8.1 (with old via-rhine.c) --> IRQ 9 -> eth0 failure 
vanilla-2.6.8.1 (with standard via-rhine.c) --> IRQ 9 -> eth0 failure 
 
If I manage to build the -rc versions I will test them, too. 
 
An additional observation:  
At least at SuSE-2.6.4 USB works, with SuSE-2.6.7 
no USB stick is being detected. Maybe an interference 
with the other problem? 
 
Steps to reproduce: 
Use any later kernel, e.g. 2.6.6 on the HP Omnibook xe4100.
Comment 1 Andreas Schallenberg 2004-08-31 08:14:34 UTC
Created attachment 3599 [details]
Output of the dmidecode command
Comment 2 Andreas Schallenberg 2004-08-31 08:15:15 UTC
Created attachment 3600 [details]
Output of the lspci -vvv command
Comment 3 Andreas Schallenberg 2004-08-31 08:16:20 UTC
Created attachment 3601 [details]
Extract of contents: /var/log/messages from 2.6.4 and 2.6.7 (both SuSE)
Comment 4 Andreas Schallenberg 2004-09-01 09:07:42 UTC
Created attachment 3616 [details]
USB messages (kernel 2.6.6-rc3-bk9) / search for last working kernel version

The attached file contains all messages which refer to
the USB driver in kernel 2.6.6-rc3-bk9. Just in case
it matters.

Somewhere between 2.6.5bk2 and 2.6.6rc2 the touchpad
starts to fail (but works in recent kernel versions again).

Further kernel versions on this notebook:
2.6.6-rc3: eth0 works, touchpad fails, USB works
2.6.6-rc3-bk6: eth0 works, touchpad fails, USB not tested
2.6.6-rc3-bk7: eth0 works, touchpad fails, USB not tested
2.6.6-rc3-bk8: eth0 fails, touchpad fails, USB unknown
 (same messages as bk9)
2.6.6-rc3-bk9: eth0 fails, touchpad fails, USB unknown
 (has IRQ problems, see attachment text)
2.6.6: eth0 fails, touchpad and USB not tested

The touchpad works in more recent kernel versions
(known for SuSE-2.6.7).

So the critical change is introduced in 2.6.6-rc3-bk6.
Comment 5 Andreas Schallenberg 2004-09-01 09:09:31 UTC
Ooops, its in since bk8... typo 
Comment 6 Andreas Schallenberg 2004-09-02 09:27:34 UTC
Created attachment 3621 [details]
Report on tests using kernel parameters and kernels without ACPI support
Comment 7 Andreas Schallenberg 2004-09-03 00:34:49 UTC
Created attachment 3628 [details]
Report on futher tests using kernel parameters
Comment 8 Shaohua 2004-09-03 02:25:08 UTC
Does this workaround help? (comment one line 'link->irq.active = 0;' in 
drivers/acpi/pci_link.c)
	/*
	 * forget active IRQ that is not in possible list
	 */
	if (i == link->irq.possible_count) {
		if (acpi_strict)
			printk(KERN_WARNING PREFIX "_CRS %d not found"
				" in _PRS\n", link->irq.active);
+//		link->irq.active = 0;
	}
Comment 9 Andreas Schallenberg 2004-09-03 06:21:19 UTC
Tested the workaround on kernel 2.6.8.1. 
Yes, network works again, no USB errors anymore. 
Comment 10 Zwane Mwaikambo 2004-11-30 23:45:34 UTC
Could you please test current kernel without your workaround
Comment 11 Andreas Schallenberg 2004-12-02 02:28:05 UTC
Created attachment 4195 [details]
dmesg output, just ACPI, USB, RhineII, APIC

extract from dmesg output, tested with 2.6.10-rc2-bk13:
- Touchpad: works good
- Console login possible
- USB IRQ 11, does not work
- eth0 using IRQ 9, does not work
- booting with "lapic" does not help (network dead),
  it says "disabled by BIOS -- reenabling" and "Could ot enable APIC",
  finally "mapped APIC to ffffd000"
Comment 12 Shaohua 2004-12-02 17:15:35 UTC
Created attachment 4202 [details]
debug patch

The intergrated devices in VIA chipset generally need a quirk. Could you please
test the debug patch to verify if NIC works? If it works, please send the
'lspci -n' output, so I can make a quirk for the USB. I can't find the USB id
in previous lspci. Thanks.
Comment 13 Andreas Schallenberg 2004-12-03 07:30:05 UTC
Created attachment 4208 [details]
lspci -n

eth0 works now! USB untested (i've seen no
error messages but this could be my fault).
Will report on USB in future.
Comment 14 Shaohua 2004-12-03 07:47:39 UTC
From the lspci, the USB quirk has been in 2.6 kernel, so I suppose it works.
Comment 15 Zwane Mwaikambo 2004-12-03 08:52:09 UTC
Thank you gentlemen, i'll close this bug with a resolution of CODE_FIX i presume
you'll do the honours of sending things upstream.
Comment 16 Len Brown 2004-12-03 19:43:17 UTC
applied patch in comment #12 to acpi tree 
Comment 17 Shaohua 2004-12-06 22:58:27 UTC
Created attachment 4241 [details]
new test patch

Made quirk for every device is really tough. Could you please remove previous
patch and try this patch? This patch looks more generic. Thanks.
Comment 18 Andreas Schallenberg 2004-12-08 02:15:50 UTC
Created attachment 4245 [details]
dmesg output after applying patch from #17 to 2.6.10-rc2-bk13

Unfortunately this did not work, eth0 is dead
Comment 19 Shaohua 2004-12-12 18:23:15 UTC
Created attachment 4258 [details]
Test patch

Oh the patch has typo, sorry. Please try this one. Thanks.
Comment 20 Andreas Schallenberg 2004-12-13 02:08:53 UTC
eth0 works with patch from #19 
 
Thanks a lot! 
Comment 21 Shaohua 2004-12-16 22:11:36 UTC
Created attachment 4273 [details]
general VIA quirk

Len would like remove specific VIA quirks and apply generic VIA quirk. Let's
see if it's a bad idea in next -mm tree.
Comment 22 Len Brown 2004-12-23 20:39:54 UTC
applied patch in comment #21, with minor syntax update, to acpi-test tree 
Comment 23 Sérgio M Basto 2004-12-26 17:37:20 UTC
Created attachment 4302 [details]
some of the backport to kernel 2.4 :)

Hi I think this could be good stuuf to apply on kernel-2.4.28, but I don't know
how apply this part of the patch !

+   if (interrupt_line_quirk)
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq & 15);
+
Comment 24 Len Brown 2005-01-24 21:34:43 UTC
Created attachment 4461 [details]
2.4 version of the patch

Please test this 2.4 version of the patch from David Shaohua Li.
Comment 25 Andreas Schallenberg 2005-01-31 02:34:56 UTC
It will take some time before I can test that patch, sorry. 
First, I have to prepare a CD from which I can boot a 2.4-kernel 
and patch that. 
 
Comment 26 Sérgio M Basto 2005-02-02 14:49:55 UTC
Created attachment 4503 [details]
patch for 2.4 with more debug

for whose want debug a little more on via motherboard at really is going on.
Just add printtk  in others via_quirks
Comment 27 Len Brown 2005-03-02 19:27:07 UTC
2.4 patch in comment #24 shipped in Linux-2.4.30-pre1
closing.
Comment 28 Len Brown 2005-03-25 11:07:05 UTC
Created attachment 4799 [details]
incremental 2.6.11 patch from Bjorn Helgaas

applied this incremental patch to 26 acpi-test tree
Comment 29 Sérgio M Basto 2005-05-10 18:32:28 UTC
Created attachment 5039 [details]
patch for kernel 2.4.30 (http://bugme.osdl.org/attachment.cgi?id=4799 more new email do VIA IRQ fixup always, not just in PIC mode
Comment 30 Sérgio M Basto 2005-05-10 18:35:03 UTC
Created attachment 5040 [details]
just the debug part
Comment 31 Sérgio M Basto 2005-05-10 20:52:51 UTC
btw: debug part is for kernel 2.4.30,
and I had this results :
#dmesg | grep Appl
Applying quirk_via_irq.
Applying quirk_via_irq.
Applying quirk_via_irq.
Applying quirk_via_irq.
Applying quirk_via_irq.
Applying quirk_vt82c686_acpi.
Applying quirk_via_irq.
Applying quirk_via_acpi.
Applying quirk_via_irq.
Applying VIA southbridge workaround. (VIA Apollo KT133 needs PCI latency patch,
applying quirk_vialatency).
Comment 32 Sérgio M Basto 2005-05-11 20:25:04 UTC
Created attachment 5050 [details]
In the debug printks, you might want to also print out pci_name(dev)

cool :) Bjorn, this pacth is for kernel 2.4.30 to debug this via pci irq part
Comment 33 Sérgio M Basto 2005-05-11 20:27:25 UTC
Created attachment 5051 [details]
test case
Comment 34 Len Brown 2005-07-20 07:59:38 UTC
Sergio, in comment #29, i don't understand the bug id reference,
did you mean to point to a different bug?
Comment 35 Sérgio M Basto 2005-07-20 11:53:14 UTC
> Sergio, in comment #29, i don't understand the bug id reference,
> did you mean to point to a different bug?

hi, Len 
No I dont to point a different bug, I just join 2 patchs. The first patch is
alrady in kernels and second patch is "VIA IRQ fixup always, not just in PIC mode"