diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-12 14:22:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-12 14:22:45 -0400 |
| commit | 02b9735c12892e04d3e101b06e4c6d64a814f566 (patch) | |
| tree | 7907deb1cbfd1599d4f34d414873170d3266f164 | |
| parent | 75acebf2423ab13ff6198daa6e17ef7a2543bfe4 (diff) | |
| parent | f1728fd1599112239ed5cebc7be9810264db6792 (diff) | |
Merge tag 'pm+acpi-fixes-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management fixes from Rafael Wysocki:
"All of these commits are fixes that have emerged recently and some of
them fix bugs introduced during this merge window.
Specifics:
1) ACPI-based PCI hotplug (ACPIPHP) fixes related to spurious events
After the recent ACPIPHP changes we've seen some interesting
breakage on a system that triggers device check notifications
during boot for non-existing devices. Although those
notifications are really spurious, we should be able to deal with
them nevertheless and that shouldn't introduce too much overhead.
Four commits to make that work properly.
2) Memory hotplug and hibernation mutual exclusion rework
This was maent to be a cleanup, but it happens to fix a classical
ABBA deadlock between system suspend/hibernation and ACPI memory
hotplug which is possible if they are started roughly at the same
time. Three commits rework memory hotplug so that it doesn't
acquire pm_mutex and make hibernation use device_hotplug_lock
which prevents it from racing with memory hotplug.
3) ACPI Intel LPSS (Low-Power Subsystem) driver crash fix
The ACPI LPSS driver crashes during boot on Apple Macbook Air with
Haswell that has slightly unusual BIOS configuration in which one
of the LPSS device's _CRS method doesn't return all of the
information expected by the driver. Fix from Mika Westerberg, for
stable.
4) ACPICA fix related to Store->ArgX operation
AML interpreter fix for obscure breakage that causes AML to be
executed incorrectly on some machines (observed in practice).
From Bob Moore.
5) ACPI core fix for PCI ACPI device objects lookup
There still are cases in which there is more than one ACPI device
object matching a given PCI device and we don't choose the one
that the BIOS expects us to choose, so this makes the lookup take
more criteria into account in those cases.
6) Fix to prevent cpuidle from crashing in some rare cases
If the result of cpuidle_get_driver() is NULL, which can happen on
some systems, cpuidle_driver_ref() will crash trying to use that
pointer and the Daniel Fu's fix prevents that from happening.
7) cpufreq fixes related to CPU hotplug
Stephen Boyd reported a number of concurrency problems with
cpufreq related to CPU hotplug which are addressed by a series of
fixes from Srivatsa S Bhat and Viresh Kumar.
8) cpufreq fix for time conversion in time_in_state attribute
Time conversion carried out by cpufreq when user space attempts to
read /sys/devices/system/cpu/cpu*/cpufreq/stats/time_in_state
won't work correcty if cputime_t doesn't map directly to jiffies.
Fix from Andreas Schwab.
9) Revert of a troublesome cpufreq commit
Commit 7c30ed5 (cpufreq: make sure frequency transitions are
serialized) was intended to address some known concurrency
problems in cpufreq related to the ordering of transitions, but
unfortunately it introduced several problems of its own, so I
decided to revert it now and address the original problems later
in a more robust way.
10) Intel Haswell CPU models for intel_pstate from Nell Hardcastle.
11) cpufreq fixes related to system suspend/resume
The recent cpufreq changes that made it preserve CPU sysfs
attributes over suspend/resume cycles introduced a possible NULL
pointer dereference that caused it to crash during the second
attempt to suspend. Three commits from Srivatsa S Bhat fix that
problem and a couple of related issues.
12) cpufreq locking fix
cpufreq_policy_restore() should acquire the lock for reading, but
it acquires it for writing. Fix from Lan Tianyu"
* tag 'pm+acpi-fixes-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (25 commits)
cpufreq: Acquire the lock in cpufreq_policy_restore() for reading
cpufreq: Prevent problems in update_policy_cpu() if last_cpu == new_cpu
cpufreq: Restructure if/else block to avoid unintended behavior
cpufreq: Fix crash in cpufreq-stats during suspend/resume
intel_pstate: Add Haswell CPU models
Revert "cpufreq: make sure frequency transitions are serialized"
cpufreq: Use signed type for 'ret' variable, to store negative error values
cpufreq: Remove temporary fix for race between CPU hotplug and sysfs-writes
cpufreq: Synchronize the cpufreq store_*() routines with CPU hotplug
cpufreq: Invoke __cpufreq_remove_dev_finish() after releasing cpu_hotplug.lock
cpufreq: Split __cpufreq_remove_dev() into two parts
cpufreq: Fix wrong time unit conversion
cpufreq: serialize calls to __cpufreq_governor()
cpufreq: don't allow governor limits to be changed when it is disabled
ACPI / bind: Prefer device objects with _STA to those without it
ACPI / hotplug / PCI: Avoid parent bus rescans on spurious device checks
ACPI / hotplug / PCI: Use _OST to notify firmware about notify status
ACPI / hotplug / PCI: Avoid doing too much for spurious notifies
ACPICA: Fix for a Store->ArgX when ArgX contains a reference to a field.
ACPI / hotplug / PCI: Don't trim devices before scanning the namespace
...
| -rw-r--r-- | drivers/acpi/acpi_lpss.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/acpica/exstore.c | 166 | ||||
| -rw-r--r-- | drivers/acpi/glue.c | 35 | ||||
| -rw-r--r-- | drivers/acpi/scan.c | 15 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq.c | 152 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 2 | ||||
| -rw-r--r-- | drivers/cpufreq/intel_pstate.c | 5 | ||||
| -rw-r--r-- | drivers/cpuidle/driver.c | 3 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 61 | ||||
| -rw-r--r-- | include/linux/cpufreq.h | 1 | ||||
| -rw-r--r-- | kernel/power/hibernate.c | 45 | ||||
| -rw-r--r-- | kernel/power/user.c | 24 | ||||
| -rw-r--r-- | mm/memory_hotplug.c | 4 |
13 files changed, 328 insertions, 188 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 6a382188fa20..fb78bb9ad8f6 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
| @@ -257,12 +257,13 @@ static int acpi_lpss_create_device(struct acpi_device *adev, | |||
| 257 | pdata->mmio_size = resource_size(&rentry->res); | 257 | pdata->mmio_size = resource_size(&rentry->res); |
| 258 | pdata->mmio_base = ioremap(rentry->res.start, | 258 | pdata->mmio_base = ioremap(rentry->res.start, |
| 259 | pdata->mmio_size); | 259 | pdata->mmio_size); |
| 260 | pdata->dev_desc = dev_desc; | ||
| 261 | break; | 260 | break; |
| 262 | } | 261 | } |
| 263 | 262 | ||
| 264 | acpi_dev_free_resource_list(&resource_list); | 263 | acpi_dev_free_resource_list(&resource_list); |
| 265 | 264 | ||
| 265 | pdata->dev_desc = dev_desc; | ||
| 266 | |||
| 266 | if (dev_desc->clk_required) { | 267 | if (dev_desc->clk_required) { |
| 267 | ret = register_device_clock(adev, pdata); | 268 | ret = register_device_clock(adev, pdata); |
| 268 | if (ret) { | 269 | if (ret) { |
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c index 2bdba6f7d762..f0b09bf9887d 100644 --- a/drivers/acpi/acpica/exstore.c +++ b/drivers/acpi/acpica/exstore.c | |||
| @@ -57,6 +57,11 @@ acpi_ex_store_object_to_index(union acpi_operand_object *val_desc, | |||
| 57 | union acpi_operand_object *dest_desc, | 57 | union acpi_operand_object *dest_desc, |
| 58 | struct acpi_walk_state *walk_state); | 58 | struct acpi_walk_state *walk_state); |
| 59 | 59 | ||
| 60 | static acpi_status | ||
| 61 | acpi_ex_store_direct_to_node(union acpi_operand_object *source_desc, | ||
| 62 | struct acpi_namespace_node *node, | ||
| 63 | struct acpi_walk_state *walk_state); | ||
| 64 | |||
| 60 | /******************************************************************************* | 65 | /******************************************************************************* |
| 61 | * | 66 | * |
| 62 | * FUNCTION: acpi_ex_store | 67 | * FUNCTION: acpi_ex_store |
| @@ -375,7 +380,11 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, | |||
| 375 | * When storing into an object the data is converted to the | 380 | * When storing into an object the data is converted to the |
| 376 | * target object type then stored in the object. This means | 381 | * target object type then stored in the object. This means |
| 377 | * that the target object type (for an initialized target) will | 382 | * that the target object type (for an initialized target) will |
| 378 | * not be changed by a store operation. | 383 | * not be changed by a store operation. A copy_object can change |
| 384 | * the target type, however. | ||
| 385 | * | ||
| 386 | * The implicit_conversion flag is set to NO/FALSE only when | ||
| 387 | * storing to an arg_x -- as per the rules of the ACPI spec. | ||
| 379 | * | 388 | * |
| 380 | * Assumes parameters are already validated. | 389 | * Assumes parameters are already validated. |
| 381 | * | 390 | * |
| @@ -399,7 +408,7 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, | |||
| 399 | target_type = acpi_ns_get_type(node); | 408 | target_type = acpi_ns_get_type(node); |
| 400 | target_desc = acpi_ns_get_attached_object(node); | 409 | target_desc = acpi_ns_get_attached_object(node); |
| 401 | 410 | ||
| 402 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n", | 411 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n", |
| 403 | source_desc, | 412 | source_desc, |
| 404 | acpi_ut_get_object_type_name(source_desc), node, | 413 | acpi_ut_get_object_type_name(source_desc), node, |
| 405 | acpi_ut_get_type_name(target_type))); | 414 | acpi_ut_get_type_name(target_type))); |
| @@ -413,45 +422,30 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, | |||
| 413 | return_ACPI_STATUS(status); | 422 | return_ACPI_STATUS(status); |
| 414 | } | 423 | } |
| 415 | 424 | ||
| 416 | /* If no implicit conversion, drop into the default case below */ | ||
| 417 | |||
| 418 | if ((!implicit_conversion) || | ||
| 419 | ((walk_state->opcode == AML_COPY_OP) && | ||
| 420 | (target_type != ACPI_TYPE_LOCAL_REGION_FIELD) && | ||
| 421 | (target_type != ACPI_TYPE_LOCAL_BANK_FIELD) && | ||
| 422 | (target_type != ACPI_TYPE_LOCAL_INDEX_FIELD))) { | ||
| 423 | /* | ||
| 424 | * Force execution of default (no implicit conversion). Note: | ||
| 425 | * copy_object does not perform an implicit conversion, as per the ACPI | ||
| 426 | * spec -- except in case of region/bank/index fields -- because these | ||
| 427 | * objects must retain their original type permanently. | ||
| 428 | */ | ||
| 429 | target_type = ACPI_TYPE_ANY; | ||
| 430 | } | ||
| 431 | |||
| 432 | /* Do the actual store operation */ | 425 | /* Do the actual store operation */ |
| 433 | 426 | ||
| 434 | switch (target_type) { | 427 | switch (target_type) { |
| 435 | case ACPI_TYPE_BUFFER_FIELD: | ||
| 436 | case ACPI_TYPE_LOCAL_REGION_FIELD: | ||
| 437 | case ACPI_TYPE_LOCAL_BANK_FIELD: | ||
| 438 | case ACPI_TYPE_LOCAL_INDEX_FIELD: | ||
| 439 | |||
| 440 | /* For fields, copy the source data to the target field. */ | ||
| 441 | |||
| 442 | status = acpi_ex_write_data_to_field(source_desc, target_desc, | ||
| 443 | &walk_state->result_obj); | ||
| 444 | break; | ||
| 445 | |||
| 446 | case ACPI_TYPE_INTEGER: | 428 | case ACPI_TYPE_INTEGER: |
| 447 | case ACPI_TYPE_STRING: | 429 | case ACPI_TYPE_STRING: |
| 448 | case ACPI_TYPE_BUFFER: | 430 | case ACPI_TYPE_BUFFER: |
| 449 | /* | 431 | /* |
| 450 | * These target types are all of type Integer/String/Buffer, and | 432 | * The simple data types all support implicit source operand |
| 451 | * therefore support implicit conversion before the store. | 433 | * conversion before the store. |
| 452 | * | ||
| 453 | * Copy and/or convert the source object to a new target object | ||
| 454 | */ | 434 | */ |
| 435 | |||
| 436 | if ((walk_state->opcode == AML_COPY_OP) || !implicit_conversion) { | ||
| 437 | /* | ||
| 438 | * However, copy_object and Stores to arg_x do not perform | ||
| 439 | * an implicit conversion, as per the ACPI specification. | ||
| 440 | * A direct store is performed instead. | ||
| 441 | */ | ||
| 442 | status = acpi_ex_store_direct_to_node(source_desc, node, | ||
| 443 | walk_state); | ||
| 444 | break; | ||
| 445 | } | ||
| 446 | |||
| 447 | /* Store with implicit source operand conversion support */ | ||
| 448 | |||
| 455 | status = | 449 | status = |
| 456 | acpi_ex_store_object_to_object(source_desc, target_desc, | 450 | acpi_ex_store_object_to_object(source_desc, target_desc, |
| 457 | &new_desc, walk_state); | 451 | &new_desc, walk_state); |
| @@ -465,13 +459,12 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, | |||
| 465 | * the Name's type to that of the value being stored in it. | 459 | * the Name's type to that of the value being stored in it. |
| 466 | * source_desc reference count is incremented by attach_object. | 460 | * source_desc reference count is incremented by attach_object. |
| 467 | * | 461 | * |
| 468 | * Note: This may change the type of the node if an explicit store | 462 | * Note: This may change the type of the node if an explicit |
| 469 | * has been performed such that the node/object type has been | 463 | * store has been performed such that the node/object type |
| 470 | * changed. | 464 | * has been changed. |
| 471 | */ | 465 | */ |
| 472 | status = | 466 | status = acpi_ns_attach_object(node, new_desc, |
| 473 | acpi_ns_attach_object(nod | ||
