Hi,

The pcibios_fixup_devices() (of 2.1.125) does this:

irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);

and the IO_APIC_get_PCI_irq_vector() only does the job if the bus number
matches the srcbus field of the corresponding IO interrupt entry in MP table.
Now, imagine that you have a plugin card with PCI-PCI bridge on it and a device
downstream, whose PCI header in config space was initialised (by PCI BIOS) 
with PCI_INTERRUPT_LINE value corresponding to a not-connected pin of IO-APIC
as would be mapped by pin_2_irq() of arch/i386/kernel/io_apic.c.
Also, the MP BIOS will be unaware of that card and prepare a nice
MP table with only entries for the "onboard" PCI buses (see mptable and /proc/pci
below).
Then pcibios_fixup() will not
fix it and leave it with the value unmanageable by IO APIC. Then a device driver 
comes along and trusts the dev->irq value enabling irq which never occurs. 

Is this really bad or am I paranoid? It would be better if I knew how to fix it...
But I think one could enhance IO_APIC_get_PCI_irq_vector() to not give up
if the busid does not match but check if we are behind a bridge and go back
closer to the buses listed in MP table (swizzling the pin along the way 
in the manner of PCI-PCI bridge spec), where the current version of 
IO_APIC_get_PCI_irq_vector() works fine.

Any ideas will be welcome.
------ -------- --------- -------- --  - -- ---- --
Tigran A. Aivazian           | http://www.sco.com
Escalations Research Group   | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd     | Email: [EMAIL PROTECTED]

PS. I don't like the idea of cc'ing multiple mailing lists but it was too
hard to choose between PCI and SMP for this one, sorry.

PPS. The output of dmsg (with SMP_DEBUG on) is


<4>Linux version 2.1.125 (root@tigran-test) (gcc version 2.7.2.3) #34 SMP Tue Oct 20 
16:10:30 GMT 1998
<4>Scan SMP from c0000000 for 1024 bytes.
<4>Scan SMP from c009fc00 for 1024 bytes.
<4>Scan SMP from c00f0000 for 65536 bytes.
<4>Intel MultiProcessor Specification v1.4
<4>    Virtual Wire compatibility mode.
<4>OEM ID: COMPAQ   Product ID: PROLIANT     APIC at: 0xFEE00000
<4>Processor #1 Pentium(tm) Pro APIC version 16
<4>    Floating point unit present.
<4>    Machine Exception supported.
<4>    64 bit compare & exchange supported.
<4>    Internal APIC present.
<4>    Bootup CPU
<4>Processor #0 Pentium(tm) Pro APIC version 16
<4>    Floating point unit present.
<4>    Machine Exception supported.
<4>    64 bit compare & exchange supported.
<4>    Internal APIC present.
<4>Bus #0 is PCI   
<4>Bus #1 is PCI   
<4>Bus #9 is ISA   
<4>I/O APIC #8 Version 17 at 0xFEC00000.
<4>Processors: 2
<4>mapped APIC to ffffe000 (fee00000)
<4>mapped IOAPIC to ffffd000 (fec00000)
<4>Console: colour VGA+ 80x25
<4>Calibrating delay loop... 398.13 BogoMIPS
<4>Memory: 63308k/65536k available (764k kernel code, 416k reserved, 988k data, 60k 
init)
<6>Checking 386/387 coupling... OK, FPU using exception 16 error reporting.
<6>Checking 'hlt' instruction... OK.
<4>POSIX conformance testing by UNIFIX
<4>mtrr: v1.26 (19981001) Richard Gooch ([EMAIL PROTECTED])
<4>CPU1: Intel Pentium II (Deschutes) stepping 01
<4>Getting VERSION: 40011
<4>Getting VERSION: 40011
<4>Getting LVT0: 700
<4>Getting LVT1: 400
<4>setup_APIC_clock() called.
<4>calibrating APIC timer ... 
<4>..... 3990861 CPU clocks in 1 timer chip tick.
<4>..... 997713 APIC bus clocks in 1 timer chip tick.
<4>..... CPU clock speed is 399.0861 MHz.
<4>..... APIC bus clock speed is 99.7713 MHz.
<4>CPU map: 3
<4>Booting processor 0 eip 2000
<4>Setting warm reset code and vector.
<4>1.
<4>2.
<4>3.
<4>Asserting INIT.
<4>Deasserting INIT.
<4>Sending STARTUP #1.
<4>After apic_write.
<4>Before start apic_write.
<4>Startup point 1.
<4>Sleeping.
<4>CALLIN 0 0
<4>setup_APIC_clock() called.
<4>waiting for other CPU calibrating APIC ... done, continuing.
<4>Calibrating delay loop... 398.13 BogoMIPS
<4>Stack at about c009dfe8
<4>Sending STARTUP #2.
<4>After apic_write.
<4>Before start apic_write.
<4>Startup point 1.
<4>Sleeping.
<4>After Startup.
<4>OK.
<4>CPU0: Intel Pentium II (Deschutes) stepping 01
<4>CPU has booted.
<4>Before bogomips.
<6>Total of 2 processors activated (796.26 BogoMIPS).
<4>Before bogocount - setting activated=1.
<4>Boot done.
<4>enabling symmetric IO mode... ...done.
<4>ENABLING IO-APIC IRQs
<4>init IO_APIC IRQs
<4> IO-APIC pin 0, 5, 9, 10, 11WARNING: ASSIGN_IRQ_VECTOR wrapped back to 52
<4>, 31, 32, 33, 34 not connected.
<4>number of MP IRQ sources: 39.
<4>number of IO-APIC registers: 35.
<4>testing the IO APIC.......................
<4>.... register #00: 00000000
<4>.......    : physical APIC id: 00
<4>.... register #01: 00220011
<4>.......     : max redirection entries: 0022
<4> WARNING: unexpected IO-APIC, please mail
<4>          to [EMAIL PROTECTED]
<4>.......     : IO APIC version: 0011
<4>.... register #02: 00000000
<4>.......     : arbitration: 00
<4>.... IRQ redirection table:
<4> NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:   
<4> 00 000 00  1    0    0   0   0    0    0    00
<4> 01 000 00  0    0    0   0   0    1    1    59
<4> 02 0FF 0F  0    0    0   0   0    1    1    51
<4> 03 000 00  0    0    0   0   0    1    1    61
<4> 04 000 00  0    0    0   0   0    1    1    69
<4> 05 000 00  1    0    0   0   0    0    0    00
<4> 06 000 00  0    0    0   0   0    1    1    71
<4> 07 000 00  0    0    0   0   0    1    1    79
<4> 08 000 00  0    0    0   0   0    1    1    81
<4> 09 000 00  1    0    0   0   0    0    0    00
<4> 0a 000 00  1    0    0   0   0    0    0    00
<4> 0b 000 00  1    0    0   0   0    0    0    00
<4> 0c 000 00  0    0    0   0   0    1    1    89
<4> 0d 000 00  1    0    0   0   0    0    0    00
<4> 0e 000 00  0    0    0   0   0    1    1    91
<4> 0f 000 00  0    0    0   0   0    1    1    99
<4> 10 0FF 0F  1    1    0   1   0    1    1    A1
<4> 11 0FF 0F  1    1    0   1   0    1    1    A9
<4> 12 0FF 0F  1    1    0   1   0    1    1    B1
<4> 13 0FF 0F  1    1    0   1   0    1    1    B9
<4> 14 0FF 0F  1    1    0   1   0    1    1    C1
<4> 15 0FF 0F  1    1    0   1   0    1    1    C9
<4> 16 0FF 0F  1    1    0   1   0    1    1    D1
<4> 17 0FF 0F  1    1    0   1   0    1    1    D9
<4> 18 0FF 0F  1    1    0   1   0    1    1    E1
<4> 19 0FF 0F  1    1    0   1   0    1    1    E9
<4> 1a 0FF 0F  1    1    0   1   0    1    1    F1
<4> 1b 0FF 0F  1    1    0   1   0    1    1    F9
<4> 1c 0FF 0F  1    1    0   1   0    1    1    52
<4> 1d 0FF 0F  1    1    0   1   0    1    1    5A
<4> 1e 0FF 0F  1    1    0   1   0    1    1    62
<4> 1f 000 00  1    0    0   0   0    0    0    00
<4> 20 000 00  1    0    0   0   0    0    0    00
<4> 21 000 00  1    0    0   0   0    0    0    00
<4> 22 000 00  1    0    0   0   0    0    0    00
<7>IRQ to pin mappings:
<7>IRQ0 -> 2
<7>IRQ1 -> 1
<7>IRQ3 -> 3
<7>IRQ4 -> 4
<7>IRQ6 -> 6
<7>IRQ7 -> 7
<7>IRQ8 -> 8
<7>IRQ12 -> 12
<7>IRQ13 -> 13
<7>IRQ14 -> 14
<7>IRQ15 -> 15
<7>IRQ16 -> 16
<7>IRQ17 -> 17
<7>IRQ18 -> 18
<7>IRQ19 -> 19
<7>IRQ20 -> 20
<7>IRQ21 -> 21
<7>IRQ22 -> 22
<7>IRQ23 -> 23
<7>IRQ24 -> 24
<7>IRQ25 -> 25
<7>IRQ26 -> 26
<7>IRQ27 -> 27
<7>IRQ28 -> 28
<7>IRQ29 -> 29
<7>IRQ30 -> 30
<4>.................................... done.
<4>Setting commenced=1, go go go
<4>mtrr: your CPUs had inconsistent fixed MTRR settings
<4>mtrr: probably your BIOS does not setup all CPUs
<4>PCI: PCI BIOS revision 2.10 entry at 0xf0080
<4>PCI: Using configuration type 1
<4>PCI: Probing PCI hardware
<4>PCI: Assigning I/O space 5800-581f to device 00:a2
<4>PCI: Enabling I/O for device 00:a2
<4>PCI->APIC IRQ transform: (B1,I7,P0) -> 30
<4>PCI->APIC IRQ transform: (B1,I9,P0) -> 23
<4>PCI: Assigning I/O space 5900-59ff to device 01:49
<4>PCI: Enabling I/O for device 01:49
<4>PCI->APIC IRQ transform: (B1,I9,P1) -> 22
<4>PCI: Device 00:00 not found by BIOS
<4>PCI: Device 00:a0 not found by BIOS
<4>PCI: Device 00:a1 not found by BIOS
<4>PCI: Device 00:a2 not found by BIOS
<4>PCI: Device 00:a3 not found by BIOS
<6>Swansea University Computer Society NET3.039 for Linux 2.1
<6>NET3: Unix domain sockets 0.16 for Linux NET3.038.
<6>Swansea University Computer Society TCP/IP for NET3.037
<6>IP Protocols: ICMP, UDP, TCP
<4>Starting kswapd v 1.5 
<6>Serial driver version 4.26 with no serial options enabled
<6>ttyS00 at 0x03f8 (irq = 4) is a 16550A
<6>ttyS01 at 0x02f8 (irq = 3) is a 16550A
<4>pty: 256 Unix98 ptys configured
<6>PS/2 auxiliary pointing device detected -- driver installed.
<6>Real Time Clock Driver v1.09
<6>Floppy drive(s): fd0 is 1.44M
<6>FDC 0 is a National Semiconductor PC87306
<6>ncr53c8xx: at PCI bus 1, device 9, function 0
<6>ncr53c8xx: 53c875 detected 
<6>ncr53c8xx: at PCI bus 1, device 9, function 1
<4>ncr53c8xx: not initializing, BUS MASTERING was disabled
<6>ncr53c875-0: rev=0x14, base=0xc6dfef00, io_port=0x2000, irq=23
<6>ncr53c875-0: ID 7, Fast-20, Parity Checking
<6>ncr53c875-0: on-chip RAM at 0xc6dff000
<6>ncr53c875-0: restart (scsi reset).
<4>ncr53c875-0: Downloading SCSI SCRIPTS.
<4>scsi0 : ncr53c8xx - revision 3.0i
<4>scsi : 1 host.
<6>ncr53c875-0-<4,*>: FAST-20 WIDE SCSI 40.0 MB/s (50 ns, offset 15)
<4>  Vendor: COMPAQ    Model: ST34371W          Rev: 0682
<4>  Type:   Direct-Access                      ANSI SCSI revision: 02
<4>Detected scsi disk sda at scsi0, channel 0, id 4, lun 0
<6>ncr53c875-0-<4,0>: tagged command queue depth set to 8
<4>scsi : detected 1 SCSI disk total.
<4>SCSI device sda: hdwr sector= 512 bytes. Sectors= 8386000 [4094 MB] [4.1 GB]
<4>TLAN 1.0:  eth0 irq=30 io=2400, Compaq Netelligent Integrated 10/100 TX UTP, Rev. 16
<4>Partition check:
<4> sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
<4>VFS: Mounted root (ext2 filesystem) readonly.
<4>Freeing unused kernel memory: 60k freed
<6>Adding Swap: 104384k swap-space (priority -1)
<4>TLAN:  eth0: Starting autonegotiation.
<4>TLAN:  eth0: Autonegotiation complete.
<4>TLAN:  eth0: Link active.

-----------------------------------------------------------------------------------------

The output of mptable is:



============================================================================
===

MPTable, version 2.0.12

----------------------------------------------------------------------------
---

MP Floating Pointer Structure:

  location:                     BIOS
  physical address:             0x000f4ff0
  signature:                    '_MP_'
  length:                       16 bytes
  version:                      1.4
  checksum:                     0x9d
  mode:                         Virtual Wire

----------------------------------------------------------------------------
---

MP Config Table Header:

  physical address:             0x000f27cd
  signature:                    'PCMP'
  base table length:            444
  version:                      1.4
  checksum:                     0x2d
  OEM ID:                       'COMPAQ  '
  Product ID:                   'PROLIANT    '
  OEM table pointer:            0x00000000
  OEM table size:               0
  entry count:                  47
  local APIC address:           0xfee00000
  extended table length:        76
  extended table checksum:      86

----------------------------------------------------------------------------
---

MP Config Base Table Entries:

--
Processors:     APIC ID Version State           Family  Model   Step    Flags
                 1       0x10    BSP, usable     6       5       1       0x183fbff
                 0       0x10    AP, usable      6       5       1       0x183fbff
--
Bus:            Bus ID  Type
                 0       PCI   
                 1       PCI   
                 9       ISA   
--
I/O APICs:      APIC ID Version State           Address
                 8       0x11    usable          0xfec00000
--
I/O Ints:       Type    Polarity    Trigger     Bus ID   IRQ    APIC ID I
NT#
                INT     active-lo       level        1   9:A          8   23
                INT     active-lo       level        1   9:B          8   22
                INT     active-lo       level        1   7:A          8   30
                INT     active-lo       level        1  13:A          8   18
                INT     active-lo       level        1  13:C          8   18
                INT     active-lo       level        1  13:B          8   26
                INT     active-lo       level        1  13:D          8   26
                INT     active-lo       level        1  11:A          8   17
                INT     active-lo       level        1  11:C          8   17
                INT     active-lo       level        1  11:B          8   25
                INT     active-lo       level        1  11:D          8   25
                INT     active-lo       level        1  10:A          8   16
                INT     active-lo       level        1  10:C          8   16
                INT     active-lo       level        1  10:B          8   24
                INT     active-lo       level        1  10:D          8   24
                INT     active-lo       level        0  18:A          8   21
                INT     active-lo       level        0  18:C          8   21
                INT     active-lo       level        0  18:B          8   29
                INT     active-lo       level        0  18:D          8   29
                INT     active-lo       level        0  16:A          8   20
                INT     active-lo       level        0  16:C          8   20
                INT     active-lo       level        0  16:B          8   28
                INT     active-lo       level        0  16:D          8   28
                INT     active-lo       level        0  15:A          8   19
                INT     active-lo       level        0  15:C          8   19
                INT     active-lo       level        0  15:B          8   27
                INT     active-lo       level        0  15:D          8   27
                INT     active-hi        edge        9     1          8    1
                INT     active-hi        edge        9     0          8    2
                INT     active-hi        edge        9     3          8    3
                INT     active-hi        edge        9     4          8    4
                INT     active-hi        edge        9     6          8    6
                INT     active-hi        edge        9     7          8    7
                INT     active-hi        edge        9     8          8    8
                INT     active-hi        edge        9    12          8   12
                INT     active-lo        edge        9    13          8   13
                INT     active-hi        edge        9    14          8   14
                INT     active-hi        edge        9    15          8   15
--
Local Ints:     Type    Polarity    Trigger     Bus ID   IRQ    APIC IDtINT#
                ExtINT   conforms    conforms        9     0        255    0
                NMI      conforms    conforms        9     0        255    1

----------------------------------------------------------------------------
---

MP Config Extended Table Entries:

Extended Table HOSED!

Reply via email to