aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-12-31 07:41:08 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-12-31 07:41:08 -0500
commitd1badf8d4323cfc9325b06651bdfcf7df09f1f0e (patch)
tree08a8a8dab1955bb07724028ece639267502a07ba /drivers/pci
parentcaa73ea158de9419f08e456f2716c71d1f06012a (diff)
parentf244d8b623dae7a7bc695b0336f67729b95a9736 (diff)
Merge branch 'acpi-pci-hotplug' into acpi-hotplug
Conflicts: include/acpi/acpi_bus.h
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index ec4ddae1fb54..4f0c40d405fc 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -645,6 +645,24 @@ static void disable_slot(struct acpiphp_slot *slot)
645 slot->flags &= (~SLOT_ENABLED); 645 slot->flags &= (~SLOT_ENABLED);
646} 646}
647 647
648static bool acpiphp_no_hotplug(acpi_handle handle)
649{
650 struct acpi_device *adev = NULL;
651
652 acpi_bus_get_device(handle, &adev);
653 return adev && adev->flags.no_hotplug;
654}
655
656static bool slot_no_hotplug(struct acpiphp_slot *slot)
657{
658 struct acpiphp_func *func;
659
660 list_for_each_entry(func, &slot->funcs, sibling)
661 if (acpiphp_no_hotplug(func_to_handle(func)))
662 return true;
663
664 return false;
665}
648 666
649/** 667/**
650 * get_slot_status - get ACPI slot status 668 * get_slot_status - get ACPI slot status
@@ -703,7 +721,8 @@ static void trim_stale_devices(struct pci_dev *dev)
703 unsigned long long sta; 721 unsigned long long sta;
704 722
705 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 723 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
706 alive = ACPI_SUCCESS(status) && sta == ACPI_STA_ALL; 724 alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL)
725 || acpiphp_no_hotplug(handle);
707 } 726 }
708 if (!alive) { 727 if (!alive) {
709 u32 v; 728 u32 v;
@@ -743,8 +762,9 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
743 struct pci_dev *dev, *tmp; 762 struct pci_dev *dev, *tmp;
744 763
745 mutex_lock(&slot->crit_sect); 764 mutex_lock(&slot->crit_sect);
746 /* wake up all functions */ 765 if (slot_no_hotplug(slot)) {
747 if (get_slot_status(slot) == ACPI_STA_ALL) { 766 ; /* do nothing */
767 } else if (get_slot_status(slot) == ACPI_STA_ALL) {
748 /* remove stale devices if any */ 768 /* remove stale devices if any */
749 list_for_each_entry_safe(dev, tmp, &bus->devices, 769 list_for_each_entry_safe(dev, tmp, &bus->devices,
750 bus_list) 770 bus_list)