diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-20 19:09:33 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-20 19:09:33 -0500 |
commit | 96075315c5e7077fc5a3ac54c9b9e97e376e66ed (patch) | |
tree | a75bfd74f4ff52997dfb3dda4f0da95be613296f | |
parent | 59b42fa01fe2d84f3c3f28ee6f25510820ace35b (diff) | |
parent | cc6254e00eb676dda6501655f8185aef7b761b4f (diff) |
Merge branch 'acpi-pci-hotplug' into acpi-dock
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 4228c67ceffe..d3d2cc6bb40a 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -255,9 +255,15 @@ static void acpiphp_dock_release(void *data) | |||
255 | put_bridge(context->func.parent); | 255 | put_bridge(context->func.parent); |
256 | } | 256 | } |
257 | 257 | ||
258 | /* callback routine to register each ACPI PCI slot object */ | 258 | /** |
259 | static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, | 259 | * acpiphp_add_context - Add ACPIPHP context to an ACPI device object. |
260 | void **rv) | 260 | * @handle: ACPI handle of the object to add a context to. |
261 | * @lvl: Not used. | ||
262 | * @data: The object's parent ACPIPHP bridge. | ||
263 | * @rv: Not used. | ||
264 | */ | ||
265 | static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, | ||
266 | void **rv) | ||
261 | { | 267 | { |
262 | struct acpiphp_bridge *bridge = data; | 268 | struct acpiphp_bridge *bridge = data; |
263 | struct acpiphp_context *context; | 269 | struct acpiphp_context *context; |
@@ -271,9 +277,6 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, | |||
271 | struct pci_dev *pdev = bridge->pci_dev; | 277 | struct pci_dev *pdev = bridge->pci_dev; |
272 | u32 val; | 278 | u32 val; |
273 | 279 | ||
274 | if (pdev && device_is_managed_by_native_pciehp(pdev)) | ||
275 | return AE_OK; | ||
276 | |||
277 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); | 280 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); |
278 | if (ACPI_FAILURE(status)) { | 281 | if (ACPI_FAILURE(status)) { |
279 | if (status != AE_NOT_FOUND) | 282 | if (status != AE_NOT_FOUND) |
@@ -325,8 +328,14 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, | |||
325 | 328 | ||
326 | list_add_tail(&slot->node, &bridge->slots); | 329 | list_add_tail(&slot->node, &bridge->slots); |
327 | 330 | ||
328 | /* Register slots for ejectable functions only. */ | 331 | /* |
329 | if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) { | 332 | * Expose slots to user space for functions that have _EJ0 or _RMV or |
333 | * are located in dock stations. Do not expose them for devices handled | ||
334 | * by the native PCIe hotplug (PCIeHP), becuase that code is supposed to | ||
335 | * expose slots to user space in those cases. | ||
336 | */ | ||
337 | if ((acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) | ||
338 | && !(pdev && device_is_managed_by_native_pciehp(pdev))) { | ||
330 | unsigned long long sun; | 339 | unsigned long long sun; |
331 | int retval; | 340 | int retval; |
332 | 341 | ||
@@ -923,14 +932,14 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) | |||
923 | acpi_unlock_hp_context(); | 932 | acpi_unlock_hp_context(); |
924 | } | 933 | } |
925 | 934 | ||
926 | /* must be added to the list prior to calling register_slot */ | 935 | /* Must be added to the list prior to calling acpiphp_add_context(). */ |
927 | mutex_lock(&bridge_mutex); | 936 | mutex_lock(&bridge_mutex); |
928 | list_add(&bridge->list, &bridge_list); | 937 | list_add(&bridge->list, &bridge_list); |
929 | mutex_unlock(&bridge_mutex); | 938 | mutex_unlock(&bridge_mutex); |
930 | 939 | ||
931 | /* register all slot objects under this bridge */ | 940 | /* register all slot objects under this bridge */ |
932 | status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1, | 941 | status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1, |
933 | register_slot, NULL, bridge, NULL); | 942 | acpiphp_add_context, NULL, bridge, NULL); |
934 | if (ACPI_FAILURE(status)) { | 943 | if (ACPI_FAILURE(status)) { |
935 | acpi_handle_err(handle, "failed to register slots\n"); | 944 | acpi_handle_err(handle, "failed to register slots\n"); |
936 | cleanup_bridge(bridge); | 945 | cleanup_bridge(bridge); |