Commit 4575a346 authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.6

into intel.com:/home/lenb/src/linux-acpi-test-2.6.7
parents e1c68713 395280b0
...@@ -1002,6 +1002,7 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -1002,6 +1002,7 @@ void __init mp_config_acpi_legacy_irqs (void)
for (idx = 0; idx < mp_irq_entries; idx++) for (idx = 0; idx < mp_irq_entries; idx++)
if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS && if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS &&
(mp_irqs[idx].mpc_dstapic == ioapic) &&
(mp_irqs[idx].mpc_srcbusirq == i || (mp_irqs[idx].mpc_srcbusirq == i ||
mp_irqs[idx].mpc_dstirq == i)) mp_irqs[idx].mpc_dstirq == i))
break; break;
......
...@@ -861,6 +861,7 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -861,6 +861,7 @@ void __init mp_config_acpi_legacy_irqs (void)
for (idx = 0; idx < mp_irq_entries; idx++) for (idx = 0; idx < mp_irq_entries; idx++)
if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS && if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS &&
(mp_irqs[idx].mpc_dstapic == ioapic) &&
(mp_irqs[idx].mpc_srcbusirq == i || (mp_irqs[idx].mpc_srcbusirq == i ||
mp_irqs[idx].mpc_dstirq == i)) mp_irqs[idx].mpc_dstirq == i))
break; break;
......
...@@ -308,31 +308,12 @@ acpi_pci_link_set ( ...@@ -308,31 +308,12 @@ acpi_pci_link_set (
struct acpi_resource end; struct acpi_resource end;
} resource; } resource;
struct acpi_buffer buffer = {sizeof(resource)+1, &resource}; struct acpi_buffer buffer = {sizeof(resource)+1, &resource};
int i = 0;
int valid = 0;
ACPI_FUNCTION_TRACE("acpi_pci_link_set"); ACPI_FUNCTION_TRACE("acpi_pci_link_set");
if (!link || !irq) if (!link || !irq)
return_VALUE(-EINVAL); return_VALUE(-EINVAL);
/* We don't check irqs the first time around */
if (link->irq.setonboot) {
/* See if we're already at the target IRQ. */
if (irq == link->irq.active)
return_VALUE(0);
/* Make sure the target IRQ in the list of possible IRQs. */
for (i=0; i<link->irq.possible_count; i++) {
if (irq == link->irq.possible[i])
valid = 1;
}
if (!valid) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Target IRQ %d invalid\n", irq));
return_VALUE(-EINVAL);
}
}
memset(&resource, 0, sizeof(resource)); memset(&resource, 0, sizeof(resource));
switch(link->irq.resource_type) { switch(link->irq.resource_type) {
...@@ -703,6 +684,9 @@ acpi_pci_link_add ( ...@@ -703,6 +684,9 @@ acpi_pci_link_add (
acpi_link.count++; acpi_link.count++;
end: end:
/* disable all links -- to be activated on use */
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
if (result) if (result)
kfree(link); kfree(link);
......
...@@ -113,6 +113,40 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) ...@@ -113,6 +113,40 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
} }
} }
static acpi_status
get_root_bridge_busnr_callback (struct acpi_resource *resource, void *data)
{
int *busnr = (int *)data;
struct acpi_resource_address64 address;
if (resource->id != ACPI_RSTYPE_ADDRESS16 &&
resource->id != ACPI_RSTYPE_ADDRESS32 &&
resource->id != ACPI_RSTYPE_ADDRESS64)
return AE_OK;
acpi_resource_to_address64(resource, &address);
if ((address.address_length > 0) &&
(address.resource_type == ACPI_BUS_NUMBER_RANGE))
*busnr = address.min_address_range;
return AE_OK;
}
static acpi_status
try_get_root_bridge_busnr(acpi_handle handle, int *busnum)
{
acpi_status status;
*busnum = -1;
status = acpi_walk_resources(handle, METHOD_NAME__CRS, get_root_bridge_busnr_callback, busnum);
if (ACPI_FAILURE(status))
return status;
/* Check if we really get a bus number from _CRS */
if (*busnum == -1)
return AE_ERROR;
return AE_OK;
}
static int static int
acpi_pci_root_add ( acpi_pci_root_add (
struct acpi_device *device) struct acpi_device *device)
...@@ -190,9 +224,22 @@ acpi_pci_root_add ( ...@@ -190,9 +224,22 @@ acpi_pci_root_add (
/* Some systems have wrong _BBN */ /* Some systems have wrong _BBN */
list_for_each_entry(tmp, &acpi_pci_roots, node) { list_for_each_entry(tmp, &acpi_pci_roots, node) {
if ((tmp->id.segment == root->id.segment) if ((tmp->id.segment == root->id.segment)
&& (tmp->id.bus == root->id.bus)) && (tmp->id.bus == root->id.bus)) {
int bus = 0;
acpi_status status;
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Wrong _BBN value, please reboot and using option 'pci=noacpi'\n")); "Wrong _BBN value, please reboot and using option 'pci=noacpi'\n"));
status = try_get_root_bridge_busnr(root->handle, &bus);
if (ACPI_FAILURE(status))
break;
if (bus != root->id.bus) {
printk(KERN_INFO PREFIX "PCI _CRS %d overrides _BBN 0\n", bus);
root->id.bus = bus;
}
break;
}
} }
/* /*
* Device & Function * Device & Function
......
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