Bug 5966

Summary: irq 10: nobody cared - Thinkpad 600E
Product: ACPI Reporter: Len Brown (lenb)
Component: BIOSAssignee: Len Brown (lenb)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.16-rc1 Subsystem:
Regression: --- Bisected commit-id:
Attachments: acpidump output for BIOS INET28WW - 11/20/1999
dmesg from 2.6.16-rc1 with Debug lines in DSDT
AML source showing Debug lines used above
acpidump output for BIOS INET36WW - 11/20/1999
patch to set "acpi=noirq" on all Thinkpad 600E systems
update patch to apply to both model 2645 and 2646

Description Len Brown 2006-01-26 09:57:23 UTC
This laptop has a BIOS from 1999 that has not often run ACPI
due to the traditional blacklist date.  However, some
have deleted the blacklist date, exposing an ACPI failure.

It appears that the PCI Interupt Link Devices are are reading
0 from the underlying PIIX4 PIRQx Route Control Registers.
Futher, it appears that writes to those registers have no effect.

eg. for LNKA:

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.

ACPI: PCI Interrupt Link [LNKA] disabled and referenced, BIOS bug.
ACPI: PCI Interrupt Link [LNKA] BIOS reported IRQ 0, using IRQ 9
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 9

But instrumentation from a modified DSDT shows that the register
is 0 both before and after writing 9 to it.
Comment 1 Len Brown 2006-01-26 09:59:47 UTC
Created attachment 7155 [details]
acpidump output for BIOS INET28WW - 11/20/1999
Comment 2 Len Brown 2006-01-26 10:04:23 UTC
Created attachment 7158 [details]
dmesg from 2.6.16-rc1 with Debug lines in DSDT
Comment 3 Len Brown 2006-01-26 10:05:35 UTC
Created attachment 7159 [details]
AML source showing Debug lines used above
Comment 4 Len Brown 2006-01-27 20:08:00 UTC
sh-3.00# lspci | grep PIIX
00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 02)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)

The datasheet for the PIIX4 says the ISA bridge is function 0
with device id 7110

sh-3.00# lspci -n -s 0:07.0
00:07.0 Class 0680: 8086:7110 (rev 02)
bingo.

The PIRQ routers are at offset 60 in the device config space...
sh-3.00# lspci -xxx -s0:07.0                                                   
                                                                        
00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 02)
00: 86 80 10 71 0f 00 80 02 02 00 80 06 00 00 80 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 09 00 27 04
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 0b 0b 80 0b 90 00 00 00 00 fe 80 00 00 00 00 00
70: 00 00 00 00 00 00 0c 0c 00 00 00 00 00 00 00 00
80: 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 17 81 01 10 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 2d 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 30 0f 00 00 00 00 00 00

This shows
60: PIRQRCA = 0b = IRQ 11
61: PIRQRCB = 0b = IRQ 11
62: PIRQRCC = 80 = disabled
63: PIRQRCD = 90 = IRQ 9
Comment 5 Len Brown 2006-01-27 21:13:27 UTC
enabling acpi_dbg_level=0xffffffff and waiting a long time...
the log shows that the AML is reading from PCI device 1
to access the PIRQ register:

exregion-0362 [25] ex_pci_config_space_ha: pci_config 0 (8) Seg(0000) Bus(0000)
Dev(0001) Func(0000) Reg(0060)
exregion-0384 [25] ex_pci_config_space_ha: ----Exit- AE_OK
evregion-0421 [24] ev_address_space_dispa: ----Exit- AE_OK
 exfldio-0269 [23] ex_access_region      : ----Exit- AE_OK
 exfldio-0510 [22] ex_field_datum_io     : Value Read 0000000000000000, Width 1

But device 1 is the PCI bridge.
It should be reading from device 7, the PIIX4

Lets try patching up the DSDT:

diff -c DSDT.dsl.orig DSDT.dsl

*** DSDT.dsl.orig       2006-01-25 22:52:11.000000000 -0500
--- DSDT.dsl    2006-01-27 23:31:41.000000000 -0500
***************
*** 2015,2021 ****

              Device (ISA0)
              {
!                 Name (_ADR, 0x00010000)
                  OperationRegion (PIRQ, PCI_Config, 0x60, 0x60)
                  Field (PIRQ, AnyAcc, NoLock, Preserve)
                  {
--- 2015,2021 ----

              Device (ISA0)
              {
!                 Name (_ADR, 0x00070000)
                  OperationRegion (PIRQ, PCI_Config, 0x60, 0x60)
                  Field (PIRQ, AnyAcc, NoLock, Preserve)
                  {

iasl -tc DSDT.dsl
cp DSDT.hex include
grep DSDT .config
CONFIG_ACPI_CUSTOM_DSDT=y
CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"

and bingo:

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)             
                                                                        

Looking at the Thinkpad web site, there is a newer BIOS for the 600E.
I've got INET28WW (1.08), and INET36WW (1.16) is available.
Unfortunately, the utility doesn't let me update unless
I have a charged battery, and the battery on this unit
will not hold a charge...

Comment 6 Len Brown 2006-01-30 23:13:12 UTC
Created attachment 7187 [details]
acpidump output for BIOS INET36WW - 11/20/1999

Latest BIOS unfortunately still has exactly the same problem.
The DSDT fix continues to be this:

	      Device (ISA0)
	      {
! //		    Name (_ADR, 0x00010000)
!		  Name (_ADR, 0x00070000)
		  OperationRegion (PIRQ, PCI_Config, 0x60, 0x60)
		  Field (PIRQ, AnyAcc, NoLock, Preserve)
		  {

Cute, IBM gives fake BIOS dates on this box to prevent Win98SE
from running in ACPI mode.
Comment 7 Len Brown 2006-01-30 23:40:01 UTC
I booted Windows 2000 on the 600E and it comes up in ACPI mode
w/o getting confused by this broken DSDT.
Curiously it moves yenta and USB on IRQ9 along with ACPI:

1       Standard 101/102-Key or Microsoft Natural PS/2 Keyboard
3       IBM ThinkPad Fast Infrared Port
4       Communications Port (COM1)
5       ThinkPad Modem
6       Standard floppy disk controller
7       Crystal WDM Audio Codec
8       System CMOS/real time clock
9       Crystal SoundFusion(tm)
9       Intel 82371AB/EB PCI to USB Universal Host Controller
9       Intel(R) PRO/100 CardBus II
9       Microsoft ACPI-Compliant System
9       Texas Instruments PCI-1251 CardBus Controller
9       Texas Instruments PCI-1251 CardBus Controller
11      ThinkPad Digital Signal Processor
12      IBM PS/2 TrackPoint
13      Numeric data processor
14      Primary IDE Channel

Linux in acpi=off doesn't move IRQs and it finds these on IRQ11 --
which means that W2K somehow picked them up and moved them.

  0:      81905          XT-PIC  timer
  1:         10          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  6:          5          XT-PIC  floppy
  8:          1          XT-PIC  rtc
 11:        326          XT-PIC  uhci_hcd:usb1, yenta, yenta, eth0
 12:        110          XT-PIC  i8042
 14:       3218          XT-PIC  ide0
NMI:          0
ERR:          0

Booting Linux with the DSDT fix in ACPI mode also finds
these links and these devices on IRQ11:

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
           CPU0
  0:      21324          XT-PIC  timer
  1:          8          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  4:        448          XT-PIC  serial
  8:          1          XT-PIC  rtc
  9:        310          XT-PIC  acpi
 11:        232          XT-PIC  uhci_hcd:usb1, yenta, yenta, eth0
 12:        153          XT-PIC  i8042
 14:       3478          XT-PIC  ide0
NMI:          0
LOC:          0
ERR:          0
MIS:          0

I can't explain how W2K does this.  It couldn't possibly have
used the ACPI PCI Interrupt Links with the bad ISA0 address --
unless it has some platform-specific workaround.  Perhaps it
sees that the Links are not working and silently falls back
to legacy PIRQ routing. Unclear that any of the other AML
in the DSDT besides the links will fail due to the bad
PCI devnum.  First glaces shows just IO space accesses,
so maybe the other things under ISA0 are okay with the
broken DSDT.

Comment 8 Len Brown 2006-01-30 23:56:42 UTC
Created attachment 7188 [details]
patch to set "acpi=noirq" on all Thinkpad 600E systems

Rather than requiring 600E users to modify their DSDT,
here is a patch to set "acpi=noirq" automatically for
all 600E systems.

A better way to go, of course, would be to figure out
how to do this automatically at run-time for all similar
systems w/o the clutter of a DMI entry.
But it isn't immediately clear when and where to do so
without the risk of confusing other mis-behaving systems.

So what is the benefit of running the 600E in ACPI mode vs APM?

Running the 600E in ACPI mode will give it a SW power switch
that invokes a graceful shutdown instead of an abrupt poweroff.
ACPI also gives the 600E C3 in idle for power savings.

Suspend/resume is a wash, as it didn't work for me either way.
ACPI came back with enabled -- but garbled -- video and hanged.
APM came back with correct video, but it also hanged.

There are no P-states on this box, though ACPI does make T-states
available if somebody wants to use them.
Comment 9 Len Brown 2006-02-01 18:06:54 UTC
Created attachment 7214 [details]
update patch to apply to both model 2645 and 2646

Note that this use of the 1st 4 digits of the model number will
make the patch apply to the IBM 600 and 600X in addition to the 600E.
Comment 10 Len Brown 2007-03-07 23:51:47 UTC
patch from comment #9 applied to acpi-test
Comment 11 Len Brown 2007-03-10 21:30:24 UTC
shipped in 2.6.21-rc3-git6
closed