Commit 427bf532 authored by rajesh.shah@intel.com's avatar rajesh.shah@intel.com Committed by Greg Kroah-Hartman

[PATCH] pciehp: request control of each hotplug controller individually

This patch tweaks the way pciehp requests control of the hotplug
hardware from BIOS. It now tries to invoke the ACPI _OSC method
for a specific hotplug controller only, rather than walking the
entire acpi namespace invoking all possible _OSC methods under
all host bridges. This allows us to gain control of each hotplug
controller individually, even if BIOS fails to give us control of
some other hotplug controller in the system.
Signed-off-by: default avatarRajesh Shah <rajesh.shah@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1a9ed1bf
...@@ -143,12 +143,13 @@ static acpi_status acpi_run_oshp(acpi_handle handle) ...@@ -143,12 +143,13 @@ static acpi_status acpi_run_oshp(acpi_handle handle)
int get_hp_hw_control_from_firmware(struct pci_dev *dev) int get_hp_hw_control_from_firmware(struct pci_dev *dev)
{ {
acpi_status status; acpi_status status;
acpi_handle handle = DEVICE_ACPI_HANDLE(&(dev->dev));
/* /*
* Per PCI firmware specification, we should run the ACPI _OSC * Per PCI firmware specification, we should run the ACPI _OSC
* method to get control of hotplug hardware before using it * method to get control of hotplug hardware before using it
*/ */
/* Fixme: run _OSC for a specific host bridge, not all of them */ status = pci_osc_control_set(handle,
status = pci_osc_control_set(OSC_PCI_EXPRESS_NATIVE_HP_CONTROL); OSC_PCI_EXPRESS_NATIVE_HP_CONTROL);
/* Fixme: fail native hotplug if _OSC does not exist for root ports */ /* Fixme: fail native hotplug if _OSC does not exist for root ports */
if (status == AE_NOT_FOUND) { if (status == AE_NOT_FOUND) {
...@@ -156,8 +157,6 @@ int get_hp_hw_control_from_firmware(struct pci_dev *dev) ...@@ -156,8 +157,6 @@ int get_hp_hw_control_from_firmware(struct pci_dev *dev)
* Some older BIOS's don't support _OSC but support * Some older BIOS's don't support _OSC but support
* OSHP to do the same thing * OSHP to do the same thing
*/ */
acpi_handle handle = DEVICE_ACPI_HANDLE(&(dev->dev));
if (handle)
status = acpi_run_oshp(handle); status = acpi_run_oshp(handle);
} }
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
......
...@@ -91,9 +91,7 @@ acpi_query_osc ( ...@@ -91,9 +91,7 @@ acpi_query_osc (
static acpi_status static acpi_status
acpi_run_osc ( acpi_run_osc (
acpi_handle handle, acpi_handle handle,
u32 level, void *context)
void *context,
void **retval )
{ {
acpi_status status; acpi_status status;
struct acpi_object_list input; struct acpi_object_list input;
...@@ -184,7 +182,7 @@ EXPORT_SYMBOL(pci_osc_support_set); ...@@ -184,7 +182,7 @@ EXPORT_SYMBOL(pci_osc_support_set);
* *
* Attempt to take control from Firmware on requested control bits. * Attempt to take control from Firmware on requested control bits.
**/ **/
acpi_status pci_osc_control_set(u32 flags) acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
{ {
acpi_status status; acpi_status status;
u32 ctrlset; u32 ctrlset;
...@@ -198,10 +196,7 @@ acpi_status pci_osc_control_set(u32 flags) ...@@ -198,10 +196,7 @@ acpi_status pci_osc_control_set(u32 flags)
return AE_SUPPORT; return AE_SUPPORT;
} }
ctrlset_buf[OSC_CONTROL_TYPE] |= ctrlset; ctrlset_buf[OSC_CONTROL_TYPE] |= ctrlset;
status = acpi_get_devices ( PCI_ROOT_HID_STRING, status = acpi_run_osc(handle, ctrlset_buf);
acpi_run_osc,
ctrlset_buf,
NULL );
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ctrlset_buf[OSC_CONTROL_TYPE] &= ~ctrlset; ctrlset_buf[OSC_CONTROL_TYPE] &= ~ctrlset;
} }
......
...@@ -47,14 +47,15 @@ ...@@ -47,14 +47,15 @@
OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL)
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
extern acpi_status pci_osc_control_set(u32 flags); extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
extern acpi_status pci_osc_support_set(u32 flags); extern acpi_status pci_osc_support_set(u32 flags);
#else #else
#if !defined(acpi_status) #if !defined(acpi_status)
typedef u32 acpi_status; typedef u32 acpi_status;
#define AE_ERROR (acpi_status) (0x0001) #define AE_ERROR (acpi_status) (0x0001)
#endif #endif
static inline acpi_status pci_osc_control_set(u32 flags) {return AE_ERROR;} static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
{return AE_ERROR;}
static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;}
#endif #endif
......
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