diff options
author | Shaohua Li <shaohua.li@intel.com> | 2010-02-24 21:59:34 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-03-14 16:40:50 -0400 |
commit | d06070509147c948a06056da619c9dc2ed349805 (patch) | |
tree | c5e5d9a1c39718502ee4765cf850cbddb72f9e66 /drivers | |
parent | 60b341b778cc2929df16c0a504c91621b3c6a4ad (diff) |
acpiphp: Execute ACPI _REG method for hotadded devices
Per ACPI spec, _ERG method should be executed before device driver
gets control for hotpluged device. Firmware might do some configuration
there. See http://bugzilla.kernel.org/show_bug.cgi?id=10805. In this
machine, _REG method of docked device will configure cardbus bridge.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Tested-by: Paul Martin <pm@debian.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index cb2fd01eddae..b5dad9f37453 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -749,6 +749,24 @@ static int acpiphp_bus_trim(acpi_handle handle) | |||
749 | return retval; | 749 | return retval; |
750 | } | 750 | } |
751 | 751 | ||
752 | static void acpiphp_set_acpi_region(struct acpiphp_slot *slot) | ||
753 | { | ||
754 | struct acpiphp_func *func; | ||
755 | union acpi_object params[2]; | ||
756 | struct acpi_object_list arg_list; | ||
757 | |||
758 | list_for_each_entry(func, &slot->funcs, sibling) { | ||
759 | arg_list.count = 2; | ||
760 | arg_list.pointer = params; | ||
761 | params[0].type = ACPI_TYPE_INTEGER; | ||
762 | params[0].integer.value = ACPI_ADR_SPACE_PCI_CONFIG; | ||
763 | params[1].type = ACPI_TYPE_INTEGER; | ||
764 | params[1].integer.value = 1; | ||
765 | /* _REG is optional, we don't care about if there is failure */ | ||
766 | acpi_evaluate_object(func->handle, "_REG", &arg_list, NULL); | ||
767 | } | ||
768 | } | ||
769 | |||
752 | /** | 770 | /** |
753 | * enable_device - enable, configure a slot | 771 | * enable_device - enable, configure a slot |
754 | * @slot: slot to be enabled | 772 | * @slot: slot to be enabled |
@@ -805,6 +823,7 @@ static int __ref enable_device(struct acpiphp_slot *slot) | |||
805 | pci_bus_assign_resources(bus); | 823 | pci_bus_assign_resources(bus); |
806 | acpiphp_sanitize_bus(bus); | 824 | acpiphp_sanitize_bus(bus); |
807 | acpiphp_set_hpp_values(bus); | 825 | acpiphp_set_hpp_values(bus); |
826 | acpiphp_set_acpi_region(slot); | ||
808 | pci_enable_bridges(bus); | 827 | pci_enable_bridges(bus); |
809 | pci_bus_add_devices(bus); | 828 | pci_bus_add_devices(bus); |
810 | 829 | ||