Re: [chandragorentla@xxxxxxxxxxx: PCI_INTERRUPT_LINE - GSI - IRQ on a x86 SMP machine]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> This is about translation of PCI_INTERRUPT_LINE to
> IRQ on a x86 SMP machine.  I am curious about how this happens.  For
> example I am seeing 0xB in the PCI_INTERRUPT_LINE register of a PCI
> board I have; The GSI (global system interrupt) for this board is 16;
> The IRQ assigned for this board is 169.  Can you please suggest some
> links (documents/source code files etc. I tried - http://lxr.linux.no/
> - this did not help me) where I can find how '0xb' of PCI interrupt
> line register contents is translated to the IRQ # 169?

Start by looking at acpi_pci_irq_enable() in drivers/acpi/pci_irq.c.
The short answer is that the IRQ is not a function of the "interrupt
line" register in PCI config space.

The "interrupt pin" register tells us which wire on the PCI bus the
device is using, e.g., A, B, C, D.  That wire is connected to an IOAPIC
input.  The ACPI _PRT table tells us the mapping: it maps a device and
pin to a GSI.  The GSI just identifies a specific pin across all the
IOAPICs in the system.  Then architecture-specific code assigns an IRQ
that corresponds to the GSI.

A driver should not read the "interrupt line" register and expect it
to mean anything.  It should always use the pci_dev->irq field.  If
you're running in PIC mode, you might see the correlation you're
expecting, but in IOAPIC mode, the "interrupt line" register is
basically irrelevant.

> -------------------------------
> Following is the part of the '/var/log/message'.
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 169
> May 28 17:44:25 RHL-4-Dev rc: Starting lm_sensors:  succeeded
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1c.0[A] -> GSI 17 (level, low) -> IRQ 177
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 185
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 193
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 201
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1d.3[D] -> GSI 16 (level, low) -> IRQ 169
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1d.7[A] -> GSI 23 (level, low) -> IRQ 185
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 18 (level, low) -> IRQ 201
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:00:1f.3[B] -> GSI 19 (level, low) -> IRQ 193
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:02:01.0[A] -> GSI 24 (level, low) -> IRQ 209
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:03:00.0[A] -> GSI 16 (level, low) -> IRQ 169 <--- I am referring to this.
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:0a:01.0[A] -> GSI 20 (level, low) -> IRQ 217
> May 28 17:44:25 RHL-4-Dev kernel: ACPI: PCI interrupt 0000:0a:03.0[A] -> GSI 21 (level, low) -> IRQ 225
> .
> .
> .
> 
> 
> Following is the 'lspci -x' output for the board I am referring.
> [root@RHL-4-Dev ~]# lspci -x
> .
> .
> .
> 00: d8 12 30 e1 07 01 10 00 01 00 80 07 08 00 00 00
> 10: 00 00 70 dd 01 50 00 00 00 00 60 dd 00 00 50 dd
> 20: 00 00 40 dd 00 00 00 00 00 00 00 00 b6 12 68 65
> 30: 00 00 00 00 b0 00 00 00 00 00 00 00 0b 01 00 00
> .
> .
> .
> 
> 
> [root@RHL-4-Dev ~]# cat /proc/interrupts
>            CPU0       CPU1
>   0:     119886      80025    IO-APIC-edge  timer
>   1:         11          0    IO-APIC-edge  i8042
>   8:          1          0    IO-APIC-edge  rtc
>   9:          0          0   IO-APIC-level  acpi
>  14:       6245       2057    IO-APIC-edge  ide0
> 169:          1          0   IO-APIC-level  cg6k <--- This is the board I am referring
> 185:          0          0   IO-APIC-level  ehci_hcd
> 209:          3          0   IO-APIC-level  cg6k
> 217:        493          0   IO-APIC-level  eth0
> NMI:          0          0
> LOC:     199714     199713
> ERR:          0
> MIS:          0
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux