aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/exconfig.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 11:57:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 11:57:16 -0400
commit4dc4226f994db264c844a5fcf556935c66f963a5 (patch)
tree981bf2cb0005c3de8383d749942640d88cb852f2 /drivers/acpi/acpica/exconfig.c
parentd6b92c2c373e0beefa8048c1448992cd5cda6e07 (diff)
parent2e30baad228624e3868714af6ecab967c4445d4a (diff)
Merge tag 'pm+acpi-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm into next
Pull ACPI and power management updates from Rafael Wysocki: "ACPICA is the leader this time (63 commits), followed by cpufreq (28 commits), devfreq (15 commits), system suspend/hibernation (12 commits), ACPI video and ACPI device enumeration (10 commits each). We have no major new features this time, but there are a few significant changes of how things work. The most visible one will probably be that we are now going to create platform devices rather than PNP devices by default for ACPI device objects with _HID. That was long overdue and will be really necessary to be able to use the same drivers for the same hardware blocks on ACPI and DT-based systems going forward. We're not expecting fallout from this one (as usual), but it's something to watch nevertheless. The second change having a chance to be visible is that ACPI video will now default to using native backlight rather than the ACPI backlight interface which should generally help systems with broken Win8 BIOSes. We're hoping that all problems with the native backlight handling that we had previously have been addressed and we are in a good enough shape to flip the default, but this change should be easy enough to revert if need be. In addition to that, the system suspend core has a new mechanism to allow runtime-suspended devices to stay suspended throughout system suspend/resume transitions if some extra conditions are met (generally, they are related to coordination within device hierarchy). However, enabling this feature requires cooperation from the bus type layer and for now it has only been implemented for the ACPI PM domain (used by ACPI-enumerated platform devices mostly today). Also, the acpidump utility that was previously shipped as a separate tool will now be provided by the upstream ACPICA along with the rest of ACPICA code, which will allow it to be more up to date and better supported, and we have one new cpuidle driver (ARM clps711x). The rest is improvements related to certain specific use cases, cleanups and fixes all over the place. Specifics: - ACPICA update to upstream version 20140424. That includes a number of fixes and improvements related to things like GPE handling, table loading, headers, memory mapping and unmapping, DSDT/SSDT overriding, and the Unload() operator. The acpidump utility from upstream ACPICA is included too. From Bob Moore, Lv Zheng, David Box, David Binderman, and Colin Ian King. - Fixes and cleanups related to ACPI video and backlight interfaces from Hans de Goede. That includes blacklist entries for some new machines and using native backlight by default. - ACPI device enumeration changes to create platform devices rather than PNP devices for ACPI device objects with _HID by default. PNP devices will still be created for the ACPI device object with device IDs corresponding to real PNP devices, so that change should not break things left and right, and we're expecting to see more and more ACPI-enumerated platform devices in the future. From Zhang Rui and Rafael J Wysocki. - Updates for the ACPI LPSS (Low-Power Subsystem) driver allowing it to handle system suspend/resume on Asus T100 correctly. From Heikki Krogerus and Rafael J Wysocki. - PM core update introducing a mechanism to allow runtime-suspended devices to stay suspended over system suspend/resume transitions if certain additional conditions related to coordination within device hierarchy are met. Related PM documentation update and ACPI PM domain support for the new feature. From Rafael J Wysocki. - Fixes and improvements related to the "freeze" sleep state. They affect several places including cpuidle, PM core, ACPI core, and the ACPI battery driver. From Rafael J Wysocki and Zhang Rui. - Miscellaneous fixes and updates of the ACPI core from Aaron Lu, Bjørn Mork, Hanjun Guo, Lan Tianyu, and Rafael J Wysocki. - Fixes and cleanups for the ACPI processor and ACPI PAD (Processor Aggregator Device) drivers from Baoquan He, Manuel Schölling, Tony Camuso, and Toshi Kani. - System suspend/resume optimization in the ACPI battery driver from Lan Tianyu. - OPP (Operating Performance Points) subsystem updates from Chander Kashyap, Mark Brown, and Nishanth Menon. - cpufreq core fixes, updates and cleanups from Srivatsa S Bhat, Stratos Karafotis, and Viresh Kumar. - Updates, fixes and cleanups for the Tegra, powernow-k8, imx6q, s5pv210, nforce2, and powernv cpufreq drivers from Brian Norris, Jingoo Han, Paul Bolle, Philipp Zabel, Stratos Karafotis, and Viresh Kumar. - intel_pstate driver fixes and cleanups from Dirk Brandewie, Doug Smythies, and Stratos Karafotis. - Enabling the big.LITTLE cpufreq driver on arm64 from Mark Brown. - Fix for the cpuidle menu governor from Chander Kashyap. - New ARM clps711x cpuidle driver from Alexander Shiyan. - Hibernate core fixes and cleanups from Chen Gang, Dan Carpenter, Fabian Frederick, Pali Rohár, and Sebastian Capella. - Intel RAPL (Running Average Power Limit) driver updates from Jacob Pan. - PNP subsystem updates from Bjorn Helgaas and Fabian Frederick. - devfreq core updates from Chanwoo Choi and Paul Bolle. - devfreq updates for exynos4 and exynos5 from Chanwoo Choi and Bartlomiej Zolnierkiewicz. - turbostat tool fix from Jean Delvare. - cpupower tool updates from Prarit Bhargava, Ramkumar Ramachandra and Thomas Renninger. - New ACPI ec_access.c tool for poking at the EC in a safe way from Thomas Renninger" * tag 'pm+acpi-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (187 commits) ACPICA: Namespace: Remove _PRP method support. intel_pstate: Improve initial busy calculation intel_pstate: add sample time scaling intel_pstate: Correct rounding in busy calculation intel_pstate: Remove C0 tracking PM / hibernate: fixed typo in comment ACPI: Fix x86 regression related to early mapping size limitation ACPICA: Tables: Add mechanism to control early table checksum verification. ACPI / scan: use platform bus type by default for _HID enumeration ACPI / scan: always register ACPI LPSS scan handler ACPI / scan: always register memory hotplug scan handler ACPI / scan: always register container scan handler ACPI / scan: Change the meaning of missing .attach() in scan handlers ACPI / scan: introduce platform_id device PNP type flag ACPI / scan: drop unsupported serial IDs from PNP ACPI scan handler ID list ACPI / scan: drop IDs that do not comply with the ACPI PNP ID rule ACPI / PNP: use device ID list for PNPACPI device enumeration ACPI / scan: .match() callback for ACPI scan handlers ACPI / battery: wakeup the system only when necessary power_supply: allow power supply devices registered w/o wakeup source ...
Diffstat (limited to 'drivers/acpi/acpica/exconfig.c')
-rw-r--r--drivers/acpi/acpica/exconfig.c82
1 files changed, 42 insertions, 40 deletions
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 8ba1464efd11..7d2949420db7 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -343,16 +343,14 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
343 struct acpi_walk_state *walk_state) 343 struct acpi_walk_state *walk_state)
344{ 344{
345 union acpi_operand_object *ddb_handle; 345 union acpi_operand_object *ddb_handle;
346 struct acpi_table_header *table_header;
346 struct acpi_table_header *table; 347 struct acpi_table_header *table;
347 struct acpi_table_desc table_desc;
348 u32 table_index; 348 u32 table_index;
349 acpi_status status; 349 acpi_status status;
350 u32 length; 350 u32 length;
351 351
352 ACPI_FUNCTION_TRACE(ex_load_op); 352 ACPI_FUNCTION_TRACE(ex_load_op);
353 353
354 ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc));
355
356 /* Source Object can be either an op_region or a Buffer/Field */ 354 /* Source Object can be either an op_region or a Buffer/Field */
357 355
358 switch (obj_desc->common.type) { 356 switch (obj_desc->common.type) {
@@ -380,17 +378,17 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
380 378
381 /* Get the table header first so we can get the table length */ 379 /* Get the table header first so we can get the table length */
382 380
383 table = ACPI_ALLOCATE(sizeof(struct acpi_table_header)); 381 table_header = ACPI_ALLOCATE(sizeof(struct acpi_table_header));
384 if (!table) { 382 if (!table_header) {
385 return_ACPI_STATUS(AE_NO_MEMORY); 383 return_ACPI_STATUS(AE_NO_MEMORY);
386 } 384 }
387 385
388 status = 386 status =
389 acpi_ex_region_read(obj_desc, 387 acpi_ex_region_read(obj_desc,
390 sizeof(struct acpi_table_header), 388 sizeof(struct acpi_table_header),
391 ACPI_CAST_PTR(u8, table)); 389 ACPI_CAST_PTR(u8, table_header));
392 length = table->length; 390 length = table_header->length;
393 ACPI_FREE(table); 391 ACPI_FREE(table_header);
394 392
395 if (ACPI_FAILURE(status)) { 393 if (ACPI_FAILURE(status)) {
396 return_ACPI_STATUS(status); 394 return_ACPI_STATUS(status);
@@ -420,22 +418,19 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
420 418
421 /* Allocate a buffer for the table */ 419 /* Allocate a buffer for the table */
422 420
423 table_desc.pointer = ACPI_ALLOCATE(length); 421 table = ACPI_ALLOCATE(length);
424 if (!table_desc.pointer) { 422 if (!table) {
425 return_ACPI_STATUS(AE_NO_MEMORY); 423 return_ACPI_STATUS(AE_NO_MEMORY);
426 } 424 }
427 425
428 /* Read the entire table */ 426 /* Read the entire table */
429 427
430 status = acpi_ex_region_read(obj_desc, length, 428 status = acpi_ex_region_read(obj_desc, length,
431 ACPI_CAST_PTR(u8, 429 ACPI_CAST_PTR(u8, table));
432 table_desc.pointer));
433 if (ACPI_FAILURE(status)) { 430 if (ACPI_FAILURE(status)) {
434 ACPI_FREE(table_desc.pointer); 431 ACPI_FREE(table);
435 return_ACPI_STATUS(status); 432 return_ACPI_STATUS(status);
436 } 433 }
437
438 table_desc.address = obj_desc->region.address;
439 break; 434 break;
440 435
441 case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */ 436 case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */
@@ -452,10 +447,10 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
452 447
453 /* Get the actual table length from the table header */ 448 /* Get the actual table length from the table header */
454 449
455 table = 450 table_header =
456 ACPI_CAST_PTR(struct acpi_table_header, 451 ACPI_CAST_PTR(struct acpi_table_header,
457 obj_desc->buffer.pointer); 452 obj_desc->buffer.pointer);
458 length = table->length; 453 length = table_header->length;
459 454
460 /* Table cannot extend beyond the buffer */ 455 /* Table cannot extend beyond the buffer */
461 456
@@ -470,13 +465,12 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
470 * Copy the table from the buffer because the buffer could be modified 465 * Copy the table from the buffer because the buffer could be modified
471 * or even deleted in the future 466 * or even deleted in the future
472 */ 467 */
473 table_desc.pointer = ACPI_ALLOCATE(length); 468 table = ACPI_ALLOCATE(length);
474 if (!table_desc.pointer) { 469 if (!table) {
475 return_ACPI_STATUS(AE_NO_MEMORY); 470 return_ACPI_STATUS(AE_NO_MEMORY);
476 } 471 }
477 472
478 ACPI_MEMCPY(table_desc.pointer, table, length); 473 ACPI_MEMCPY(table, table_header, length);
479 table_desc.address = ACPI_TO_INTEGER(table_desc.pointer);
480 break; 474 break;
481 475
482 default: 476 default:
@@ -484,27 +478,32 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
484 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 478 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
485 } 479 }
486 480
487 /* Validate table checksum (will not get validated in tb_add_table) */ 481 /* Install the new table into the local data structures */
488
489 status = acpi_tb_verify_checksum(table_desc.pointer, length);
490 if (ACPI_FAILURE(status)) {
491 ACPI_FREE(table_desc.pointer);
492 return_ACPI_STATUS(status);
493 }
494
495 /* Complete the table descriptor */
496 482
497 table_desc.length = length; 483 ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
498 table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED; 484 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
499 485
500 /* Install the new table into the local data structures */ 486 status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table),
487 ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
488 TRUE, TRUE, &table_index);
501 489
502 status = acpi_tb_add_table(&table_desc, &table_index); 490 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
503 if (ACPI_FAILURE(status)) { 491 if (ACPI_FAILURE(status)) {
504 492
505 /* Delete allocated table buffer */ 493 /* Delete allocated table buffer */
506 494
507 acpi_tb_delete_table(&table_desc); 495 ACPI_FREE(table);
496 return_ACPI_STATUS(status);
497 }
498
499 /*
500 * Note: Now table is "INSTALLED", it must be validated before
501 * loading.
502 */
503 status =
504 acpi_tb_validate_table(&acpi_gbl_root_table_list.
505 tables[table_index]);
506 if (ACPI_FAILURE(status)) {
508 return_ACPI_STATUS(status); 507 return_ACPI_STATUS(status);
509 } 508 }
510 509
@@ -536,9 +535,6 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
536 return_ACPI_STATUS(status); 535 return_ACPI_STATUS(status);
537 } 536 }
538 537
539 ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
540 acpi_tb_print_table_header(0, table_desc.pointer);
541
542 /* Remove the reference by added by acpi_ex_store above */ 538 /* Remove the reference by added by acpi_ex_store above */
543 539
544 acpi_ut_remove_reference(ddb_handle); 540 acpi_ut_remove_reference(ddb_handle);
@@ -546,8 +542,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
546 /* Invoke table handler if present */ 542 /* Invoke table handler if present */
547 543
548 if (acpi_gbl_table_handler) { 544 if (acpi_gbl_table_handler) {
549 (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, 545 (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table,
550 table_desc.pointer,
551 acpi_gbl_table_handler_context); 546 acpi_gbl_table_handler_context);
552 } 547 }
553 548
@@ -576,6 +571,13 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
576 ACPI_FUNCTION_TRACE(ex_unload_table); 571 ACPI_FUNCTION_TRACE(ex_unload_table);
577 572
578 /* 573 /*
574 * Temporarily emit a warning so that the ASL for the machine can be
575 * hopefully obtained. This is to say that the Unload() operator is
576 * extremely rare if not completely unused.
577 */
578 ACPI_WARNING((AE_INFO, "Received request to unload an ACPI table"));
579
580 /*
579 * Validate the handle 581 * Validate the handle
580 * Although the handle is partially validated in acpi_ex_reconfiguration() 582 * Although the handle is partially validated in acpi_ex_reconfiguration()
581 * when it calls acpi_ex_resolve_operands(), the handle is more completely 583 * when it calls acpi_ex_resolve_operands(), the handle is more completely