aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-06 09:41:41 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-06 21:43:58 -0400
commite532e84ea11399a6066f31641425a76dd012ce77 (patch)
tree30671f68aca46516e42a5ffacea0a29f43a3ba06 /drivers/pci
parent2dc41281b1d1178befe4b76adf817570a7f45ec1 (diff)
ACPI / hotplug / PCI: Use _OST to notify firmware about notify status
The spec suggests that we should use _OST to notify the platform about the status of notifications it sends us, for example so that it doesn't repeate a notification that has been handled already. This turns out to help reduce the amount of diagnostic output from the ACPIPHP subsystem and speed up boot on at least one system that generates multiple device check notifies for PCIe devices on the root bus during boot. Reported-and-tested-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 65290226e5dd..1971d2943de4 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -870,6 +870,8 @@ static void hotplug_event_work(struct work_struct *work)
870 hotplug_event(hp_work->handle, hp_work->type, context); 870 hotplug_event(hp_work->handle, hp_work->type, context);
871 871
872 acpi_scan_lock_release(); 872 acpi_scan_lock_release();
873 acpi_evaluate_hotplug_ost(hp_work->handle, hp_work->type,
874 ACPI_OST_SC_SUCCESS, NULL);
873 kfree(hp_work); /* allocated in handle_hotplug_event() */ 875 kfree(hp_work); /* allocated in handle_hotplug_event() */
874 put_bridge(context->func.parent); 876 put_bridge(context->func.parent);
875} 877}
@@ -885,11 +887,15 @@ static void hotplug_event_work(struct work_struct *work)
885static void handle_hotplug_event(acpi_handle handle, u32 type, void *data) 887static void handle_hotplug_event(acpi_handle handle, u32 type, void *data)
886{ 888{
887 struct acpiphp_context *context; 889 struct acpiphp_context *context;
890 u32 ost_code = ACPI_OST_SC_SUCCESS;
888 891
889 switch (type) { 892 switch (type) {
890 case ACPI_NOTIFY_BUS_CHECK: 893 case ACPI_NOTIFY_BUS_CHECK:
891 case ACPI_NOTIFY_DEVICE_CHECK: 894 case ACPI_NOTIFY_DEVICE_CHECK:
895 break;
892 case ACPI_NOTIFY_EJECT_REQUEST: 896 case ACPI_NOTIFY_EJECT_REQUEST:
897 ost_code = ACPI_OST_SC_EJECT_IN_PROGRESS;
898 acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL);
893 break; 899 break;
894 900
895 case ACPI_NOTIFY_DEVICE_WAKE: 901 case ACPI_NOTIFY_DEVICE_WAKE:
@@ -898,20 +904,21 @@ static void handle_hotplug_event(acpi_handle handle, u32 type, void *data)
898 case ACPI_NOTIFY_FREQUENCY_MISMATCH: 904 case ACPI_NOTIFY_FREQUENCY_MISMATCH:
899 acpi_handle_err(handle, "Device cannot be configured due " 905 acpi_handle_err(handle, "Device cannot be configured due "
900 "to a frequency mismatch\n"); 906 "to a frequency mismatch\n");
901 return; 907 goto out;
902 908
903 case ACPI_NOTIFY_BUS_MODE_MISMATCH: 909 case ACPI_NOTIFY_BUS_MODE_MISMATCH:
904 acpi_handle_err(handle, "Device cannot be configured due " 910 acpi_handle_err(handle, "Device cannot be configured due "
905 "to a bus mode mismatch\n"); 911 "to a bus mode mismatch\n");
906 return; 912 goto out;
907 913
908 case ACPI_NOTIFY_POWER_FAULT: 914 case ACPI_NOTIFY_POWER_FAULT:
909 acpi_handle_err(handle, "Device has suffered a power fault\n"); 915 acpi_handle_err(handle, "Device has suffered a power fault\n");
910 return; 916 goto out;
911 917
912 default: 918 default:
913 acpi_handle_warn(handle, "Unsupported event type 0x%x\n", type); 919 acpi_handle_warn(handle, "Unsupported event type 0x%x\n", type);
914 return; 920 ost_code = ACPI_OST_SC_UNRECOGNIZED_NOTIFY;
921 goto out;
915 } 922 }
916 923
917 mutex_lock(&acpiphp_context_lock); 924 mutex_lock(&acpiphp_context_lock);
@@ -920,8 +927,14 @@ static void handle_hotplug_event(acpi_handle handle, u32 type, void *data)
920 get_bridge(context->func.parent); 927 get_bridge(context->func.parent);
921 acpiphp_put_context(context); 928 acpiphp_put_context(context);
922 alloc_acpi_hp_work(handle, type, context, hotplug_event_work); 929 alloc_acpi_hp_work(handle, type, context, hotplug_event_work);
930 mutex_unlock(&acpiphp_context_lock);
931 return;
923 } 932 }
924 mutex_unlock(&acpiphp_context_lock); 933 mutex_unlock(&acpiphp_context_lock);
934 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
935
936 out:
937 acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL);
925} 938}
926 939
927/* 940/*