[ACPI] Merge acpi-2.6.12 branch into 2.6.13-rc3
authorLen Brown <len.brown@intel.com>
Fri, 5 Aug 2005 04:31:42 +0000 (00:31 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 5 Aug 2005 04:31:42 +0000 (00:31 -0400)
Signed-off-by: Len Brown <len.brown@intel.com>
12 files changed:
arch/i386/kernel/acpi/boot.c
arch/ia64/kernel/acpi.c
arch/ia64/kernel/iosapic.c
drivers/acpi/Kconfig
drivers/acpi/pci_irq.c
drivers/acpi/pci_link.c
drivers/acpi/video.c
drivers/char/hpet.c
drivers/pnp/pnpacpi/rsparser.c
drivers/serial/8250_acpi.c
include/asm-ia64/acpi-ext.h
include/linux/acpi.h

index b7808a89d94507fd41abf6c24bd471d5d9099209..55c0fbd689569a506b30eb61eb1cf341f7fb687d 100644 (file)
@@ -484,7 +484,11 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
        return 0;
 }
 
-unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
+/*
+ * success: return IRQ number (>=0)
+ * failure: return < 0
+ */
+int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
 {
        unsigned int irq;
        unsigned int plat_gsi = gsi;
index 9609f243e5d05d2591393a66e1a542cb6058ecbc..d362ecf5381bc8681d171e8dd922913221cd9192 100644 (file)
@@ -563,7 +563,11 @@ acpi_numa_arch_fixup (void)
 }
 #endif /* CONFIG_ACPI_NUMA */
 
-unsigned int
+/*
+ * success: return IRQ number (>=0)
+ * failure: return < 0
+ */
+int
 acpi_register_gsi (u32 gsi, int edge_level, int active_high_low)
 {
        if (has_8259 && gsi < 16)
index 7936b62f7a2e323a0f1d5d4ee4c46a2894bf5682..8f53915f4ae673b043dcac7cd346e56472c5dadf 100644 (file)
@@ -561,7 +561,7 @@ static inline int vector_is_shared (int vector)
        return (iosapic_intr_info[vector].count > 1);
 }
 
-static void
+static int
 register_intr (unsigned int gsi, int vector, unsigned char delivery,
               unsigned long polarity, unsigned long trigger)
 {
@@ -576,7 +576,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
        index = find_iosapic(gsi);
        if (index < 0) {
                printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi);
-               return;
+               return -ENODEV;
        }
 
        iosapic_address = iosapic_lists[index].addr;
@@ -587,7 +587,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
                rte = iosapic_alloc_rte();
                if (!rte) {
                        printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__);
-                       return;
+                       return -ENOMEM;
                }
 
                rte_index = gsi - gsi_base;
@@ -603,7 +603,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
                struct iosapic_intr_info *info = &iosapic_intr_info[vector];
                if (info->trigger != trigger || info->polarity != polarity) {
                        printk (KERN_WARNING "%s: cannot override the interrupt\n", __FUNCTION__);
-                       return;
+                       return -EINVAL;
                }
        }
 
@@ -623,6 +623,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
                               __FUNCTION__, vector, idesc->handler->typename, irq_type->typename);
                idesc->handler = irq_type;
        }
+       return 0;
 }
 
 static unsigned int
@@ -710,7 +711,7 @@ int
 iosapic_register_intr (unsigned int gsi,
                       unsigned long polarity, unsigned long trigger)
 {
-       int vector, mask = 1;
+       int vector, mask = 1, err;
        unsigned int dest;
        unsigned long flags;
        struct iosapic_rte_info *rte;
@@ -734,11 +735,11 @@ again:
        spin_unlock_irqrestore(&iosapic_lock, flags);
 
        /* If vector is running out, we try to find a sharable vector */
-       vector = assign_irq_vector(AUTO_ASSIGN);
+       vector = assign_irq_vector_nopanic(AUTO_ASSIGN);
        if (vector < 0) {
                vector = iosapic_find_sharable_vector(trigger, polarity);
-               if (vector < 0)
-                       panic("%s: out of interrupt vectors!\n", __FUNCTION__);
+               if (vector < 0)
+                       Return -ENOSPC;
        }
 
        spin_lock_irqsave(&irq_descp(vector)->lock, flags);
@@ -753,8 +754,13 @@ again:
                }
 
                dest = get_target_cpu(gsi, vector);
-               register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
+               err = register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
                              polarity, trigger);
+               if (err < 0) {
+                       spin_unlock(&iosapic_lock);
+                       spin_unlock_irqrestore(&irq_descp(vector)->lock, flags);
+                       return err;
+               }
 
                /*
                 * If the vector is shared and already unmasked for
index ba13896cae407732b29342116790613fe9a5d083..66c60982ba4677421c351447fca646d0c451d711 100644 (file)
@@ -154,12 +154,10 @@ config ACPI_PROCESSOR
          support it.
 
 config ACPI_HOTPLUG_CPU
-       bool "Processor Hotplug (EXPERIMENTAL)"
-       depends on ACPI_PROCESSOR && HOTPLUG_CPU && EXPERIMENTAL
+       bool
+       depends on ACPI_PROCESSOR && HOTPLUG_CPU
        select ACPI_CONTAINER
-       default n
-        ---help---
-        Select this option if your platform support physical CPU hotplug.
+       default y
 
 config ACPI_THERMAL
        tristate "Thermal Zone"
index bb973d2109a11e7404f1d3fa788f1d0655038d5e..c885300579eca17059688b47a115af937ad721ae 100644 (file)
@@ -424,6 +424,7 @@ acpi_pci_irq_enable (
        int                     edge_level = ACPI_LEVEL_SENSITIVE;
        int                     active_high_low = ACPI_ACTIVE_LOW;
        char                    *link = NULL;
+       int                     rc;
 
        ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
 
@@ -476,7 +477,13 @@ acpi_pci_irq_enable (
                }
        }
 
-       dev->irq = acpi_register_gsi(irq, edge_level, active_high_low);
+       rc = acpi_register_gsi(irq, edge_level, active_high_low);
+       if (rc < 0) {
+               printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
+                      "to register GSI\n", pci_name(dev), ('A' + pin));
+               return_VALUE(rc);
+       }
+       dev->irq = rc;
 
        printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ",
                pci_name(dev), 'A' + pin);
index 834c2ceff1aa4ba1864e2dfff84667384a33a72a..26aa3829f1def0fe1d6dde66eac3bdd9cc645165 100644 (file)
@@ -804,8 +804,7 @@ acpi_pci_link_resume(
  */
 int acpi_in_resume;
 static int
-irqrouter_resume(
-       struct sys_device *dev)
+irqrouter_resume(struct sys_device *dev)
 {
        struct list_head        *node = NULL;
        struct acpi_pci_link    *link = NULL;
index 2cf264fd52e072e42fcff07b9cc6c948c9cbbede..7b10a7b070c968bb2e754c339e1a81b2336b4a6b 100644 (file)
@@ -1665,6 +1665,7 @@ static int
 acpi_video_bus_put_one_device(
        struct acpi_video_device        *device)
 {
+       acpi_status status;
        struct acpi_video_bus *video;
 
        ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device");
@@ -1679,6 +1680,12 @@ acpi_video_bus_put_one_device(
        up(&video->sem);
        acpi_video_device_remove_fs(device->dev);
 
+       status = acpi_remove_notify_handler(device->handle,
+               ACPI_DEVICE_NOTIFY, acpi_video_device_notify);
+       if (ACPI_FAILURE(status))
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                       "Error removing notify handler\n"));
+
        return_VALUE(0);
 }
 
index 762fa430fb5be3b6a7615eed705e741509475ba7..97feb7f7024d83e4180ba2477f89f7fa59445b5f 100644 (file)
@@ -906,11 +906,15 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
                if (irqp->number_of_interrupts > 0) {
                        hdp->hd_nirqs = irqp->number_of_interrupts;
 
-                       for (i = 0; i < hdp->hd_nirqs; i++)
-                               hdp->hd_irq[i] =
+                       for (i = 0; i < hdp->hd_nirqs; i++) {
+                               int rc =
                                    acpi_register_gsi(irqp->interrupts[i],
                                                      irqp->edge_level,
                                                      irqp->active_high_low);
+                               if (rc < 0)
+                                       return AE_ERROR;
+                               hdp->hd_irq[i] = rc;
+                       }
                }
        }
 
index 75575f6c349c65919871f32afe3dc8e83fbc3219..1e296cbef00497b16816a6f19435666cebc60005 100644 (file)
@@ -81,7 +81,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, int irq)
                i++;
        if (i < PNP_MAX_IRQ) {
                res->irq_resource[i].flags = IORESOURCE_IRQ;  //Also clears _UNSET flag
-               if (irq == -1) {
+               if (irq < 0) {
                        res->irq_resource[i].flags |= IORESOURCE_DISABLED;
                        return;
                }
index 6b9ead288517f70b1b306f7f5f0a14466d92d356..a802bdce6e5dd02a044f343cddc4dd1a71fe5308 100644 (file)
@@ -47,18 +47,30 @@ static acpi_status acpi_serial_port(struct uart_port *port,
 static acpi_status acpi_serial_ext_irq(struct uart_port *port,
                                       struct acpi_resource_ext_irq *ext_irq)
 {
-       if (ext_irq->number_of_interrupts > 0)
-               port->irq = acpi_register_gsi(ext_irq->interrupts[0],
+       int rc;
+
+       if (ext_irq->number_of_interrupts > 0) {
+               rc = acpi_register_gsi(ext_irq->interrupts[0],
                           ext_irq->edge_level, ext_irq->active_high_low);
+               if (rc < 0)
+                       return AE_ERROR;
+               port->irq = rc;
+       }
        return AE_OK;
 }
 
 static acpi_status acpi_serial_irq(struct uart_port *port,
                                   struct acpi_resource_irq *irq)
 {
-       if (irq->number_of_interrupts > 0)
-               port->irq = acpi_register_gsi(irq->interrupts[0],
+       int rc;
+
+       if (irq->number_of_interrupts > 0) {
+               rc = acpi_register_gsi(irq->interrupts[0],
                           irq->edge_level, irq->active_high_low);
+               if (rc < 0)
+                       return AE_ERROR;
+               port->irq = rc;
+       }
        return AE_OK;
 }
 
index 9271d74c64ccffc728bf3b5a2070adc4b2104a3d..56d2ddc97b30cd9c236e8b173edeea52ae2fc0c0 100644 (file)
@@ -11,6 +11,7 @@
 #define _ASM_IA64_ACPI_EXT_H
 
 #include <linux/types.h>
+#include <acpi/actypes.h>
 
 extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
 
index b46a5205ee7b1ce25f327cc07759220142d7f34d..fd48db320f5b590f93f58424547dbb5190603af7 100644 (file)
@@ -433,19 +433,9 @@ extern int sbf_port ;
 
 #define acpi_mp_config 0
 
-static inline int acpi_boot_init(void)
-{
-       return 0;
-}
-
-static inline int acpi_boot_table_init(void)
-{
-       return 0;
-}
-
 #endif         /*!CONFIG_ACPI_BOOT*/
 
-unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
+int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 /*
@@ -549,5 +539,17 @@ static inline int acpi_get_pxm(acpi_handle handle)
 
 extern int pnpacpi_disabled;
 
+#else  /* CONFIG_ACPI */
+
+static inline int acpi_boot_init(void)
+{
+       return 0;
+}
+
+static inline int acpi_boot_table_init(void)
+{
+       return 0;
+}
+
 #endif /* CONFIG_ACPI */
 #endif /*_LINUX_ACPI_H*/