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)
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;
......
......@@ -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)
......
......@@ -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 @@ iosapic_register_intr (unsigned int gsi,
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__);
Return -ENOSPC;
}
spin_lock_irqsave(&irq_descp(vector)->lock, flags);
......@@ -753,8 +754,13 @@ iosapic_register_intr (unsigned int gsi,
}
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
......
......@@ -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"
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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;
}
}
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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*/
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