aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2013-06-07 21:01:19 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-19 19:43:15 -0400
commit341e7ba1a9a48c50b46a1ebf305823f883c85d4f (patch)
tree1578eea7d78ac8d2e415900914fc465f0faf9c3d /drivers/acpi
parent5a9792f3be74bfad2985b3f4c7afc9e6f6a3f798 (diff)
ACPICA: _CST repair: Handle null package entries
Sort package only after null/bad elements have been removed. Fixes a problem where the _CST sort was performed too early. This change sorts the package only after null/bad elements have been removed. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/nsrepair2.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 029816edd392..c84603ee83ae 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -452,18 +452,7 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
452 ACPI_FUNCTION_NAME(ns_repair_CST); 452 ACPI_FUNCTION_NAME(ns_repair_CST);
453 453
454 /* 454 /*
455 * Entries (subpackages) in the _CST Package must be sorted by the 455 * Check if the C-state type values are proportional.
456 * C-state type, in ascending order.
457 */
458 status = acpi_ns_check_sorted_list(info, return_object, 1, 4, 1,
459 ACPI_SORT_ASCENDING, "C-State Type");
460 if (ACPI_FAILURE(status)) {
461 return (status);
462 }
463
464 /*
465 * We now know the list is correctly sorted by C-state type. Check if
466 * the C-state type values are proportional.
467 */ 456 */
468 outer_element_count = return_object->package.count - 1; 457 outer_element_count = return_object->package.count - 1;
469 i = 0; 458 i = 0;
@@ -502,6 +491,17 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
502 491
503 obj_desc = return_object->package.elements[0]; 492 obj_desc = return_object->package.elements[0];
504 obj_desc->integer.value = outer_element_count; 493 obj_desc->integer.value = outer_element_count;
494
495 /*
496 * Entries (subpackages) in the _CST Package must be sorted by the
497 * C-state type, in ascending order.
498 */
499 status = acpi_ns_check_sorted_list(info, return_object, 1, 4, 1,
500 ACPI_SORT_ASCENDING, "C-State Type");
501 if (ACPI_FAILURE(status)) {
502 return (status);
503 }
504
505 return (AE_OK); 505 return (AE_OK);
506} 506}
507 507