ChangeSet 1.1938.505.24, 2005/03/08 23:59:02-05:00, [EMAIL PROTECTED]

        [ACPI] Make PCI device -> interrupt link associations explicit,
        
        ACPI: PCI Interrupt 0000:00:0f.2[A] -> Link [IUSB] -> GSI 10 (level, 
low) -> IRQ 10
        
        Previously, you could sometimes infer an association based on the output
        when an interrupt link is enabled, but when interrupt links are shared
        among several PCI devices, you could only make the inference for the 
first
        device to be enabled.
        
        Signed-off-by: Bjorn Helgaas <[EMAIL PROTECTED]>
        Signed-off-by: Len Brown <[EMAIL PROTECTED]>



 drivers/acpi/pci_irq.c      |   30 ++++++++++++++++++++----------
 drivers/acpi/pci_link.c     |   14 +++++++++-----
 include/acpi/acpi_drivers.h |    3 ++-
 3 files changed, 31 insertions(+), 16 deletions(-)


diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
--- a/drivers/acpi/pci_irq.c    2005-04-01 08:13:09 -08:00
+++ b/drivers/acpi/pci_irq.c    2005-04-01 08:13:09 -08:00
@@ -281,7 +281,8 @@
        int                     device,
        int                     pin,
        int                     *edge_level,
-       int                     *active_high_low)
+       int                     *active_high_low,
+       char                    **link)
 {
        struct acpi_prt_entry   *entry = NULL;
        int segment = pci_domain_nr(bus);
@@ -301,7 +302,8 @@
        }
        
        if (entry->link.handle) {
-               irq = acpi_pci_link_get_irq(entry->link.handle, 
entry->link.index, edge_level, active_high_low);
+               irq = acpi_pci_link_get_irq(entry->link.handle,
+                       entry->link.index, edge_level, active_high_low, link);
                if (irq < 0) {
                        ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link 
routing entry\n"));
                        return_VALUE(-1);
@@ -327,7 +329,8 @@
        struct pci_dev          *dev,
        int                     pin,
        int                     *edge_level,
-       int                     *active_high_low)
+       int                     *active_high_low,
+       char                    **link)
 {
        struct pci_dev          *bridge = dev;
        int                     irq = -1;
@@ -360,7 +363,7 @@
                }
 
                irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
-                       pin, edge_level, active_high_low);
+                       pin, edge_level, active_high_low, link);
        }
 
        if (irq < 0) {
@@ -389,6 +392,7 @@
        int                     edge_level = ACPI_LEVEL_SENSITIVE;
        int                     active_high_low = ACPI_ACTIVE_LOW;
        extern int              via_interrupt_line_quirk;
+       char                    *link = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
 
@@ -411,21 +415,23 @@
         * First we check the PCI IRQ routing table (PRT) for an IRQ.  PRT
         * values override any BIOS-assigned IRQs set during boot.
         */
-       irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, 
&edge_level, &active_high_low);
+       irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
+               &edge_level, &active_high_low, &link);
 
        /*
         * If no PRT entry was found, we'll try to derive an IRQ from the
         * device's parent bridge.
         */
        if (irq < 0)
-               irq = acpi_pci_irq_derive(dev, pin, &edge_level, 
&active_high_low);
+               irq = acpi_pci_irq_derive(dev, pin, &edge_level,
+                       &active_high_low, &link);
  
        /*
         * No IRQ known to the ACPI subsystem - maybe the BIOS / 
         * driver reported one, then use it. Exit in any case.
         */
        if (irq < 0) {
-               printk(KERN_WARNING PREFIX "PCI interrupt %s[%c]: no GSI",
+               printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
                        pci_name(dev), ('A' + pin));
                /* Interrupt Line values above 0xF are forbidden */
                if (dev->irq >= 0 && (dev->irq <= 0xF)) {
@@ -443,9 +449,13 @@
 
        dev->irq = acpi_register_gsi(irq, edge_level, active_high_low);
 
-       printk(KERN_INFO PREFIX "PCI interrupt %s[%c] -> GSI %u "
-               "(%s, %s) -> IRQ %d\n",
-               pci_name(dev), 'A' + pin, irq,
+       printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ",
+               pci_name(dev), 'A' + pin);
+
+       if (link)
+               printk("Link [%s] -> ", link);
+
+       printk("GSI %u (%s, %s) -> IRQ %d\n", irq,
                (edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
                (active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high",
                dev->irq);
diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c   2005-04-01 08:13:09 -08:00
+++ b/drivers/acpi/pci_link.c   2005-04-01 08:13:09 -08:00
@@ -522,9 +522,11 @@
 
 static int acpi_irq_balance;   /* 0: static, 1: balance */
 
-static int acpi_pci_link_allocate(struct acpi_pci_link* link) {
-       int irq;
-       int i;
+static int acpi_pci_link_allocate(
+       struct acpi_pci_link    *link)
+{
+       int                     irq;
+       int                     i;
 
        ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
 
@@ -597,8 +599,9 @@
 acpi_pci_link_get_irq (
        acpi_handle             handle,
        int                     index,
-       int*                    edge_level,
-       int*                    active_high_low)
+       int                     *edge_level,
+       int                     *active_high_low,
+       char                    **name)
 {
        int                     result = 0;
        struct acpi_device      *device = NULL;
@@ -634,6 +637,7 @@
 
        if (edge_level) *edge_level = link->irq.edge_level;
        if (active_high_low) *active_high_low = link->irq.active_high_low;
+       if (name) *name = acpi_device_bid(link->device);
        return_VALUE(link->irq.active);
 }
 
diff -Nru a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
--- a/include/acpi/acpi_drivers.h       2005-04-01 08:13:09 -08:00
+++ b/include/acpi/acpi_drivers.h       2005-04-01 08:13:09 -08:00
@@ -56,7 +56,8 @@
 /* ACPI PCI Interrupt Link (pci_link.c) */
 
 int acpi_irq_penalty_init (void);
-int acpi_pci_link_get_irq (acpi_handle handle, int index, int* edge_level, 
int* active_high_low);
+int acpi_pci_link_get_irq (acpi_handle handle, int index, int *edge_level,
+       int *active_high_low, char **name);
 
 /* ACPI PCI Interrupt Routing (pci_irq.c) */
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to