Commit 1d492eb4 authored by Len Brown's avatar Len Brown

[ACPI] Merge acpi-2.6.12 branch into 2.6.13-rc3

Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parents 5d2a2207 cbfc1bae
...@@ -484,7 +484,11 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) ...@@ -484,7 +484,11 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
return 0; 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 irq;
unsigned int plat_gsi = gsi; unsigned int plat_gsi = gsi;
......
...@@ -563,7 +563,11 @@ acpi_numa_arch_fixup (void) ...@@ -563,7 +563,11 @@ acpi_numa_arch_fixup (void)
} }
#endif /* CONFIG_ACPI_NUMA */ #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) acpi_register_gsi (u32 gsi, int edge_level, int active_high_low)
{ {
if (has_8259 && gsi < 16) if (has_8259 && gsi < 16)
......
...@@ -561,7 +561,7 @@ static inline int vector_is_shared (int vector) ...@@ -561,7 +561,7 @@ static inline int vector_is_shared (int vector)
return (iosapic_intr_info[vector].count > 1); return (iosapic_intr_info[vector].count > 1);
} }
static void static int
register_intr (unsigned int gsi, int vector, unsigned char delivery, register_intr (unsigned int gsi, int vector, unsigned char delivery,
unsigned long polarity, unsigned long trigger) unsigned long polarity, unsigned long trigger)
{ {
...@@ -576,7 +576,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, ...@@ -576,7 +576,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
index = find_iosapic(gsi); index = find_iosapic(gsi);
if (index < 0) { if (index < 0) {
printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi); printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi);
return; return -ENODEV;
} }
iosapic_address = iosapic_lists[index].addr; iosapic_address = iosapic_lists[index].addr;
...@@ -587,7 +587,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, ...@@ -587,7 +587,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
rte = iosapic_alloc_rte(); rte = iosapic_alloc_rte();
if (!rte) { if (!rte) {
printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__); printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__);
return; return -ENOMEM;
} }
rte_index = gsi - gsi_base; rte_index = gsi - gsi_base;
...@@ -603,7 +603,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, ...@@ -603,7 +603,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
struct iosapic_intr_info *info = &iosapic_intr_info[vector]; struct iosapic_intr_info *info = &iosapic_intr_info[vector];
if (info->trigger != trigger || info->polarity != polarity) { if (info->trigger != trigger || info->polarity != polarity) {
printk (KERN_WARNING "%s: cannot override the interrupt\n", __FUNCTION__); 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, ...@@ -623,6 +623,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
__FUNCTION__, vector, idesc->handler->typename, irq_type->typename); __FUNCTION__, vector, idesc->handler->typename, irq_type->typename);
idesc->handler = irq_type; idesc->handler = irq_type;
} }
return 0;
} }
static unsigned int static unsigned int
...@@ -710,7 +711,7 @@ int ...@@ -710,7 +711,7 @@ int
iosapic_register_intr (unsigned int gsi, iosapic_register_intr (unsigned int gsi,
unsigned long polarity, unsigned long trigger) unsigned long polarity, unsigned long trigger)
{ {
int vector, mask = 1; int vector, mask = 1, err;
unsigned int dest; unsigned int dest;
unsigned long flags; unsigned long flags;
struct iosapic_rte_info *rte; struct iosapic_rte_info *rte;
...@@ -734,11 +735,11 @@ iosapic_register_intr (unsigned int gsi, ...@@ -734,11 +735,11 @@ iosapic_register_intr (unsigned int gsi,
spin_unlock_irqrestore(&iosapic_lock, flags); spin_unlock_irqrestore(&iosapic_lock, flags);
/* If vector is running out, we try to find a sharable vector */ /* 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) { if (vector < 0) {
vector = iosapic_find_sharable_vector(trigger, polarity); vector = iosapic_find_sharable_vector(trigger, polarity);
if (vector < 0) if (vector < 0)
panic("%s: out of interrupt vectors!\n", __FUNCTION__); Return -ENOSPC;
} }
spin_lock_irqsave(&irq_descp(vector)->lock, flags); spin_lock_irqsave(&irq_descp(vector)->lock, flags);
...@@ -753,8 +754,13 @@ iosapic_register_intr (unsigned int gsi, ...@@ -753,8 +754,13 @@ iosapic_register_intr (unsigned int gsi,
} }
dest = get_target_cpu(gsi, vector); dest = get_target_cpu(gsi, vector);
register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, err = register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
polarity, trigger); 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 * If the vector is shared and already unmasked for
......
...@@ -154,12 +154,10 @@ config ACPI_PROCESSOR ...@@ -154,12 +154,10 @@ config ACPI_PROCESSOR
support it. support it.
config ACPI_HOTPLUG_CPU config ACPI_HOTPLUG_CPU
bool "Processor Hotplug (EXPERIMENTAL)" bool
depends on ACPI_PROCESSOR && HOTPLUG_CPU && EXPERIMENTAL depends on ACPI_PROCESSOR && HOTPLUG_CPU
select ACPI_CONTAINER select ACPI_CONTAINER
default n default y
---help---
Select this option if your platform support physical CPU hotplug.
config ACPI_THERMAL config ACPI_THERMAL
tristate "Thermal Zone" tristate "Thermal Zone"
......
...@@ -424,6 +424,7 @@ acpi_pci_irq_enable ( ...@@ -424,6 +424,7 @@ acpi_pci_irq_enable (
int edge_level = ACPI_LEVEL_SENSITIVE; int edge_level = ACPI_LEVEL_SENSITIVE;
int active_high_low = ACPI_ACTIVE_LOW; int active_high_low = ACPI_ACTIVE_LOW;
char *link = NULL; char *link = NULL;
int rc;
ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
...@@ -476,7 +477,13 @@ 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] -> ", printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ",
pci_name(dev), 'A' + pin); pci_name(dev), 'A' + pin);
......
...@@ -804,8 +804,7 @@ acpi_pci_link_resume( ...@@ -804,8 +804,7 @@ acpi_pci_link_resume(
*/ */
int acpi_in_resume; int acpi_in_resume;
static int static int
irqrouter_resume( irqrouter_resume(struct sys_device *dev)
struct sys_device *dev)
{ {
struct list_head *node = NULL; struct list_head *node = NULL;
struct acpi_pci_link *link = NULL; struct acpi_pci_link *link = NULL;
......
...@@ -1665,6 +1665,7 @@ static int ...@@ -1665,6 +1665,7 @@ static int
acpi_video_bus_put_one_device( acpi_video_bus_put_one_device(
struct acpi_video_device *device) struct acpi_video_device *device)
{ {
acpi_status status;
struct acpi_video_bus *video; struct acpi_video_bus *video;
ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device"); ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device");
...@@ -1679,6 +1680,12 @@ acpi_video_bus_put_one_device( ...@@ -1679,6 +1680,12 @@ acpi_video_bus_put_one_device(
up(&video->sem); up(&video->sem);
acpi_video_device_remove_fs(device->dev); 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); return_VALUE(0);
} }
......
...@@ -906,11 +906,15 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) ...@@ -906,11 +906,15 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
if (irqp->number_of_interrupts > 0) { if (irqp->number_of_interrupts > 0) {
hdp->hd_nirqs = irqp->number_of_interrupts; hdp->hd_nirqs = irqp->number_of_interrupts;
for (i = 0; i < hdp->hd_nirqs; i++) for (i = 0; i < hdp->hd_nirqs; i++) {
hdp->hd_irq[i] = int rc =
acpi_register_gsi(irqp->interrupts[i], acpi_register_gsi(irqp->interrupts[i],
irqp->edge_level, irqp->edge_level,
irqp->active_high_low); irqp->active_high_low);
if (rc < 0)
return AE_ERROR;
hdp->hd_irq[i] = rc;
}
} }
} }
......
...@@ -81,7 +81,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, int irq) ...@@ -81,7 +81,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, int irq)
i++; i++;
if (i < PNP_MAX_IRQ) { if (i < PNP_MAX_IRQ) {
res->irq_resource[i].flags = IORESOURCE_IRQ; //Also clears _UNSET flag res->irq_resource[i].flags = IORESOURCE_IRQ; //Also clears _UNSET flag
if (irq == -1) { if (irq < 0) {
res->irq_resource[i].flags |= IORESOURCE_DISABLED; res->irq_resource[i].flags |= IORESOURCE_DISABLED;
return; return;
} }
......
...@@ -47,18 +47,30 @@ static acpi_status acpi_serial_port(struct uart_port *port, ...@@ -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, static acpi_status acpi_serial_ext_irq(struct uart_port *port,
struct acpi_resource_ext_irq *ext_irq) struct acpi_resource_ext_irq *ext_irq)
{ {
if (ext_irq->number_of_interrupts > 0) int rc;
port->irq = acpi_register_gsi(ext_irq->interrupts[0],
if (ext_irq->number_of_interrupts > 0) {
rc = acpi_register_gsi(ext_irq->interrupts[0],
ext_irq->edge_level, ext_irq->active_high_low); ext_irq->edge_level, ext_irq->active_high_low);
if (rc < 0)
return AE_ERROR;
port->irq = rc;
}
return AE_OK; return AE_OK;
} }
static acpi_status acpi_serial_irq(struct uart_port *port, static acpi_status acpi_serial_irq(struct uart_port *port,
struct acpi_resource_irq *irq) struct acpi_resource_irq *irq)
{ {
if (irq->number_of_interrupts > 0) int rc;
port->irq = acpi_register_gsi(irq->interrupts[0],
if (irq->number_of_interrupts > 0) {
rc = acpi_register_gsi(irq->interrupts[0],
irq->edge_level, irq->active_high_low); irq->edge_level, irq->active_high_low);
if (rc < 0)
return AE_ERROR;
port->irq = rc;
}
return AE_OK; return AE_OK;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#define _ASM_IA64_ACPI_EXT_H #define _ASM_IA64_ACPI_EXT_H
#include <linux/types.h> #include <linux/types.h>
#include <acpi/actypes.h>
extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length); extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
......
...@@ -433,19 +433,9 @@ extern int sbf_port ; ...@@ -433,19 +433,9 @@ extern int sbf_port ;
#define acpi_mp_config 0 #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*/ #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); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
/* /*
...@@ -549,5 +539,17 @@ static inline int acpi_get_pxm(acpi_handle handle) ...@@ -549,5 +539,17 @@ static inline int acpi_get_pxm(acpi_handle handle)
extern int pnpacpi_disabled; 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 /* CONFIG_ACPI */
#endif /*_LINUX_ACPI_H*/ #endif /*_LINUX_ACPI_H*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment