diff options
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 9eaf708f5885..6dc4a2b1e956 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -932,7 +932,7 @@ static acpi_status __acpi_os_execute(acpi_execute_type type, | |||
932 | * having a static work_struct. | 932 | * having a static work_struct. |
933 | */ | 933 | */ |
934 | 934 | ||
935 | dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC); | 935 | dpc = kzalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC); |
936 | if (!dpc) | 936 | if (!dpc) |
937 | return AE_NO_MEMORY; | 937 | return AE_NO_MEMORY; |
938 | 938 | ||
@@ -944,17 +944,22 @@ static acpi_status __acpi_os_execute(acpi_execute_type type, | |||
944 | * because the hotplug code may call driver .remove() functions, | 944 | * because the hotplug code may call driver .remove() functions, |
945 | * which invoke flush_scheduled_work/acpi_os_wait_events_complete | 945 | * which invoke flush_scheduled_work/acpi_os_wait_events_complete |
946 | * to flush these workqueues. | 946 | * to flush these workqueues. |
947 | * | ||
948 | * To prevent lockdep from complaining unnecessarily, make sure that | ||
949 | * there is a different static lockdep key for each workqueue by using | ||
950 | * INIT_WORK() for each of them separately. | ||
947 | */ | 951 | */ |
948 | queue = hp ? kacpi_hotplug_wq : | 952 | if (hp) { |
949 | (type == OSL_NOTIFY_HANDLER ? kacpi_notify_wq : kacpid_wq); | 953 | queue = kacpi_hotplug_wq; |
950 | dpc->wait = hp ? 1 : 0; | 954 | dpc->wait = 1; |
951 | |||
952 | if (queue == kacpi_hotplug_wq) | ||
953 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); | 955 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); |
954 | else if (queue == kacpi_notify_wq) | 956 | } else if (type == OSL_NOTIFY_HANDLER) { |
957 | queue = kacpi_notify_wq; | ||
955 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); | 958 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); |
956 | else | 959 | } else { |
960 | queue = kacpid_wq; | ||
957 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); | 961 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); |
962 | } | ||
958 | 963 | ||
959 | /* | 964 | /* |
960 | * On some machines, a software-initiated SMI causes corruption unless | 965 | * On some machines, a software-initiated SMI causes corruption unless |
@@ -986,6 +991,7 @@ acpi_status acpi_os_hotplug_execute(acpi_osd_exec_callback function, | |||
986 | { | 991 | { |
987 | return __acpi_os_execute(0, function, context, 1); | 992 | return __acpi_os_execute(0, function, context, 1); |
988 | } | 993 | } |
994 | EXPORT_SYMBOL(acpi_os_hotplug_execute); | ||
989 | 995 | ||
990 | void acpi_os_wait_events_complete(void) | 996 | void acpi_os_wait_events_complete(void) |
991 | { | 997 | { |