summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
Commit message (Collapse)AuthorAgeFilesLines
* Revert "ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic ↵Rafael J. Wysocki2016-07-112-9/+2
| | | | | | | | | | | | table loading" Revert commit 2f38b1b16d92 (ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading) that attempted to fix a deadlock issue introduced by a previous commit, but it led to a lock ordering inconsistency that caused further problems to appear. Fixes: 2f38b1b16d92 (ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Revert "ACPICA: Namespace: Fix namespace/interpreter lock ordering"Rafael J. Wysocki2016-07-112-8/+8
| | | | | | | | | | | Revert commit 45209046c47b (ACPICA: Namespace: Fix namespace/interpreter lock ordering) that renders Dell Precision 5510 with the latest (1.2.10) BIOS applied unable to boot. Fixes: 45209046c47b (ACPICA: Namespace: Fix namespace/interpreter lock ordering) Link: https://bugzilla.kernel.org/show_bug.cgi?id=121701 Reported-by: Greg White <gwhite@kupulau.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPICA: Namespace: Fix namespace/interpreter lock orderingLv Zheng2016-07-052-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a lock order issue in acpi_load_tables(). The namespace lock is held before holding the interpreter lock. With ACPI_MUTEX_DEBUG enabled in the kernel, this is printed to the log during boot: [ 0.885699] ACPI Error: Invalid acquire order: Thread 405884224 owns [ACPI_MTX_Namespace], wants [ACPI_MTX_Interpreter] (20160422/utmutex-263) [ 0.885881] ACPI Error: Could not acquire AML Interpreter mutex (20160422/exutils-95) [ 0.893846] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160422/utmutex-326) [ 0.894019] ACPI Error: Could not release AML Interpreter mutex (20160422/exutils-133) The issue has been introduced by the following commit: Commit: 2f38b1b16d9280689e5cfa47a4c50956bf437f0d ACPICA Commit: bfe03ffcde8ed56a7eae38ea0b188aeb12f9c52e Subject: ACPICA: Namespace: Fix a regression that MLC support triggers dead lock in dynamic table loading Which fixed a deadlock issue for acpi_ns_load_table() in acpi_ex_add_table() but didn't take care of the lock order in acpi_ns_load_table() correctly. Originally (before the above commit), ACPICA used the namespace/interpreter locks in the following 2 key code paths: 1. Table loading: acpi_ns_load_table L(Namespace) acpi_ns_parse_table acpi_ns_one_complete_parse U(Namespace) 2. Object evaluation: acpi_ns_evaluate L(Interpreter) acpi_ps_execute_method U(Interpreter) acpi_ns_load_table L(Namespace) U(Namespace) acpi_ev_initialize_region L(Namespace) U(Namespace) address_space.setup L(Namespace) U(Namespace) address_space.handler L(Namespace) U(Namespace) acpi_os_wait_semaphore acpi_os_acquire_mutex acpi_os_sleep L(Interpreter) U(Interpreter) During runtime, while acpi_ns_evaluate is called, the lock order is always Interpreter -> Namespace. In turn, the problematic commit acquires the locks in the following order: 3. Table loading: acpi_ns_load_table L(Namespace) acpi_ns_parse_table L(Interpreter) acpi_ns_one_complete_parse U(Interpreter) U(Namespace) To fix the lock order issue, move the interpreter lock to acpi_ns_load_table() to ensure the lock order correctness: 4. Table loading: acpi_ns_load_table L(Interpreter) L(Namespace) acpi_ns_parse_table acpi_ns_one_complete_parse U(Namespace) U(Interpreter) However, this doesn't fix the current design issues related to the namespace lock. For example, we can notice that in acpi_ns_evaluate(), outside of acpi_ns_load_table(), the namespace objects may be created by the named object creation control methods. And the creation of the method-owned namespace objects are not locked by the namespace lock. This patch doesn't try to fix such kind of existing issues. Fixes: 2f38b1b16d92 (ACPICA: Namespace: Fix a regression that MLC support triggers dead lock in dynamic table loading) Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table ↵Lv Zheng2016-06-222-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loading The new module-level code (MLC) approach invokes MLC on the per-table basis, but the dynamic loading support of this is incorrect because of the lock order: acpi_ns_evaluate acpi_ex_enter_intperter acpi_ns_load_table (triggered by Load opcode) acpi_ns_exec_module_code_list acpi_ex_enter_intperter The regression is introduced by the following commit: Commit: 2785ce8d0da1cac9d8f78615e116cf929e9a9123 ACPICA Commit: 071eff738c59eda1792ac24b3b688b61691d7e7c Subject: ACPICA: Add per-table execution of module-level code This patch fixes this regression by unlocking the interpreter lock before invoking MLC. However, the unlocking is done to the acpi_ns_load_table(), in which the interpreter lock should be locked by acpi_ns_parse_table() but it wasn't. Fixes: 2785ce8d0da1 (ACPICA: Add per-table execution of module-level code) Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: 4.5+ <stable@vger.kernel.org> # 4.5+ [ rjw : Subject ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Revert "ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for ↵Rafael J. Wysocki2016-06-151-137/+9
| | | | | | | | | | | | | | | | | acpi_hw_write()" Revert commit 66b1ed5aa8dd "ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for acpi_hw_write()" that is reported to break suspend-to-RAM (ACPI S3) on one system. The root cause of the failure is a wrong access width value for one of the involved registers provided by the ACPI tables, but before commit 66b1ed5aa8dd that value was not taken into account at all and things worked. Fixes: 66b1ed5aa8dd "ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for acpi_hw_write()" Reported-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPICA / Hardware: Fix old register check in acpi_hw_get_access_bit_width()Lv Zheng2016-06-011-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The address check in acpi_hw_get_access_bit_width() should be byte width based, not bit width based. This patch fixes this mistake. For those who want to review acpi_hw_access_bit_width(), here is the concerns and the design details of the function: It is supposed that the GAS Address field should be aligned to the byte width indicated by the GAS AccessSize field. Similarly, for the old non GAS register, it is supposed that its Address should be aligned to its Length. For the "AccessSize = 0 (meaning ANY)" case, we try to return the maximum instruction width (64 for MMIO or 32 for PIO) or the user expected access bit width (64 for acpi_read()/acpi_write() or 32 for acpi_hw_read()/ acpi_hw_write()) and it is supposed that the GAS Address field should always be aligned to the maximum expected access bit width (otherwise it can't be accessed using ANY access bit width). The problem is in acpi_tb_init_generic_address(), where the non GAS register's Length is converted into the GAS BitWidth field, its Address is converted into the GAS Address field, and the GAS AccessSize field is left 0 but most of the registers actually cannot be accessed using "ANY" accesses. As a conclusion, when AccessSize = 0 (ANY), the Address should either be aligned to the BitWidth (wrong conversion) or aligned to 32 for PIO or 64 for MMIO (real GAS). Since currently, max_bit_width is 32, then: 1. BitWidth for the wrong conversion is 8,16,32; and 2. The Address of the real GAS should always be aligned to 8,16,32. The address alignment check to exclude false matched real GAS is not necessary. Thus this patch fixes the issue by removing the address alignment check. On the other hand, we in fact could use a simpler check of "reg->bit_width < max_bit_width" to exclude the "BitWidth=64 PIO" case that may be issued from acpi_read()/acpi_write() in the future. Fixes: b314a172ee96 (ACPICA: Hardware: Add optimized access bit width support) Reported-and-tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by: Mike Marshall <hubcap@omnibond.com> Suggested-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Merge back new ACPICA material for v4.7.Rafael J. Wysocki2016-05-06111-1022/+1662
|\
| * ACPICA: Move all ASCII utilities to a common fileBob Moore2016-05-0511-110/+160
| | | | | | | | | | | | | | | | | | | | | | ACPICA commit ba60e4500053010bf775d58f6f61febbdb94d817 New file is utascii.c Link: https://github.com/acpica/acpica/commit/ba60e450 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for ↵Lv Zheng2016-05-051-9/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_hw_write() ACPICA commit 48eea5e7993ccb7189bd63cd726e02adafee6057 This patch adds access_width/bit_offset support in acpi_hw_write(). Lv Zheng. Link: https://github.com/acpica/acpica/commit/48eea5e7 Link: https://bugs.acpica.org/show_bug.cgi?id=1240 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>
| * ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support in ↵Lv Zheng2016-05-051-13/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_hw_read() ACPICA commit 96ece052d4d073aae4f935f0ff0746646aea1174 ACPICA commit 3d8583a054e410f2ea4d73b48986facad9cfc0d4 This patch adds access_width/bit_offset support in acpi_hw_read(). This also enables GAS definition where bit_width is not a power of two. Lv Zheng. Link: https://github.com/acpica/acpica/commit/96ece052 Link: https://github.com/acpica/acpica/commit/3d8583a0 Link: https://bugs.acpica.org/show_bug.cgi?id=1240 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>
| * ACPICA: Executer: Introduce a set of macros to handle bit width mask generationLv Zheng2016-05-052-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit c23034a3a09d5ed79f1827d51f43cfbccf68ab64 A regression was reported to the shift offset >= width of type. This patch fixes this issue. BZ 1270. This is a part of the fix because the order of the patches are modified for Linux upstream, containing the cleanups for the old code. Lv Zheng. Link: https://github.com/acpica/acpica/commit/c23034a3 Link: https://bugs.acpica.org/show_bug.cgi?id=1270 Reported-by: Sascha Wildner <swildner@gmail.com> 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>
| * ACPICA: Hardware: Add optimized access bit width supportLv Zheng2016-05-051-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit c49a751b4dae7baec1790748a2b4b6e8ab599f51 For Access Size = 0, it actually can use user expected access bit width. This patch implements this. Besides of the ACPICA upstream commit, this patch also includes a fix fixing the issue reported by the FreeBSD community. The old register descriptors are translated in acpi_tb_init_generic_address() with access_width being filled with 0. This breaks code in acpi_hw_get_access_bit_width() when the registers are 16-bit IO ports and their bit_width fields are filled with 16. The rapid fix is meant to make code written for acpi_hw_get_access_bit_width() regression safer before the issue is correctly fixed from acpi_tb_init_generic_address(). Reported by John Baldwin <jhb@freebsd.org>, fixed by Lv Zheng <lv.zheng@intel.com>, tested by Jung-uk Kim <jkim@freebsd.org>. Link: https://github.com/acpica/acpica/commit/c49a751b Reported-by: John Baldwin <jhb@freebsd.org> Tested-by Jung-uk Kim <jkim@freebsd.org>. 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>
| * ACPICA: Utilities: Add ACPI_IS_ALIGNED() macroLv Zheng2016-05-051-1/+2
| | | | | | | | | | | | | | This patch introduces ACPI_IS_ALIGNED() macro. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Renamed some #defined flag constants for clarityBob Moore2016-05-052-16/+16
| | | | | | | | | | | | | | | | | | | | | | ACPICA commit 438905b205e64e742f9670a0970419c426264831 Expanded a couple of cryptic names. Link: https://github.com/acpica/acpica/commit/438905b2 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: ACPI 6.0, tools/iasl: Add support for new resource descriptorsBob Moore2016-05-052-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 5a0555ece4ba9917e5842b21d88469ae06b4e815 Adds full support for: i2c_serial_bus_v2 spi_serial_bus_v2 uart_serial_bus_v2 Compiler, Disassembler, Resource Manager, acpi_help. Link: https://github.com/acpica/acpica/commit/5a0555ec Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: ACPI 6.0: Update _BIX support for new package elementBob Moore2016-05-052-2/+89
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 3451e6d49d37919c13ec2c0019a31534b0dfc0c0 One integer was added at the end of the _BIX method, and the version number was incremented. Link: https://github.com/acpica/acpica/commit/3451e6d4 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Refactor evaluate_object to reduce nestingBob Moore2016-05-051-56/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 599e9159f53565e4a3f3e67f6a03f81fcb10a4cf Original patch from hanjun.guo@linaro.org ACPICA BZ 1072. Link: https://github.com/acpica/acpica/commit/599e9159 Link: https://bugs.acpica.org/show_bug.cgi?id=1072 Original-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Divergence: remove unwanted spaces for typedefLv Zheng2016-05-0574-253/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit b2294cae776f5a66a7697414b21949d307e6856f This patch removes unwanted spaces for typedef. This solution doesn't cover function types. Note that the linuxize result of this commit is very giant and should have many conflicts against the current Linux upstream. Thus it is required to modify the linuxize result of this commit and the commits around it manually in order to have them merged to the Linux upstream. Since this is very costy, we should do this only once, and if we can't ensure to do this only once, we need to revert the Linux code to the wrong indentation result before merging the linuxize result of this commit. Lv Zheng. Link: https://github.com/acpica/acpica/commit/b2294cae 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>
| * ACPICA: Namespace: Reorder \_SB._INI to make sure it is evaluated before ↵Lv Zheng2016-04-051-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _REG evaluations ACPICA commit f005ee6b90d152c1f499efcca6b771a93903cb55 This patch splits \_SB._INI evaluation from device initialization code, so that it can be performed before PCI_Config _REG evaluations. This is required for the device enumeration process. Some named objects are initialized in \_SB._INI and PCI_Config _REG evaluations may use uninitialized named objects because of the order issue. This must be fixed before fixing ECDT order issue. There are existing tables allowing ECDT EC to be used for the entire device enumeration process, but the enabling of ECDT EC is done in \_SB._INI. Thus \_SB._INI must be the first control method evaluated in the device enumeration process. Normally, the order should be automatically ensured by the device enumeration process itself (for example, PCI_Config _REGs are evaluated by the PCI bus driver when the driver is probed by the enumeration process), but since the process is split on Linux (partially done in Linux, partially done in ACPICA), we need to ensure this with special logics in order to be regression safe. Lv Zheng. Link: https://github.com/acpica/acpica/commit/f005ee6b 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>
| * ACPICA: Events: Fix an issue that _REG association can happen before ↵Lv Zheng2016-04-053-50/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | namespace is initialized ACPICA commit c508f8592efaa0d8197f26d7fee6382c5ac8e383 Current code flow cannot ensure _REG association can happen after the namespace is initialized, so we move _REG association to where _REG was about to run to fix this issue. This issue is detected when acpi_ev_initialize_region() is invoked during the table loading. And this is one of the most important the root cause why ACPICA table loading is split into 2 load passes. Lv Zheng. Link: https://github.com/acpica/acpica/commit/c508f859 Link: https://bugs.acpica.org/show_bug.cgi?id=1252 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>
| * ACPICA: Tables: Fix wrong MLC condition for dynamic table loadingLv Zheng2016-04-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 5798cd6171ea38bcf4594d0ccc78870784776ba5 The patch corrects wrong condition before group MLC is disabled. Link: https://github.com/acpica/acpica/commit/5798cd61 Link: https://bugs.acpica.org/show_bug.cgi?id=1262 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>
| * ACPICA: Interpreter: Fix wrong conditions for ↵Lv Zheng2016-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_ev_install_region_handlers() invocation ACPICA commit 9a6ecc9ec9ee067cad51eec539230bf494421d76 Since AE_ALREADY_EXISTS has already been converted to AE_OK in acpi_ev_install_region_handlers(), this patch simplies a return value check. Lv Zheng. Link: https://github.com/acpica/acpica/commit/9a6ecc9e Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Hardware: Enhance acpi_hw_validate_register() with ↵Lv Zheng2016-04-051-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | access_width/bit_offset awareness ACPICA commit 997a90f810a4cb78604ef2e187611a181b498286 This patch enhances acpi_hw_validate_register() to sanitize register accesses with awareness of access_width and bit_offset. Lv Zheng. Link: https://github.com/acpica/acpica/commit/997a90f8 Link: https://bugs.acpica.org/show_bug.cgi?id=1240 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>
| * Utilities: Fix missing parentheses in ACPI_GET_BITS()/ACPI_SET_BITS()Lv Zheng2016-04-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Some compilers require parentheses to be enforced in the macro definition, so that the macro caller side can be simpler. This patch fixes this kind of macro issue in ACPI_SET_BITS()/ACPI_GET_BITS(). Lv Zheng. Link: https://bugs.acpica.org/show_bug.cgi?id=1268 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Utilities: Add ACPI_IS_POWER_OF_TWO()Lv Zheng2016-04-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit cbcb77565c5032dd48e19b3a8a8b8704c5f29faf This patch adds a macro ACPI_IS_POWER_OF_TWO, which can be used to detect if a number is a power of two. Lv Zheng. Link: https://github.com/acpica/acpica/commit/cbcb7756 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>
| * ACPICA: iASL/Disassembler: Improve handling of unresolved methodsBob Moore2016-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 16cd0872a070c8d3b16b8b13c1fc90a443a6b6fe If the definition of a control method cannot be found (probably it is in another module/SSDT), the disassembler must try to guess at the number of arguments to that method. This change improves the guessing heuristic. Link: https://github.com/acpica/acpica/commit/16cd0872 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: All: const keyword changes across the ACPICA sourceBob Moore2016-04-0525-111/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit a240cbb93647bddf525b3daf6e9d31b8b9bca34e Integrated most changes proposed by net_BSD. >From joerg@net_BSD.org (Joerg Sonnenberger) ACPICA BZ 732. Link: https://github.com/acpica/acpica/commit/a240cbb9 Link: https://bugs.acpica.org/show_bug.cgi?id=732 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Utilities: Update for strtoul64 mergerBob Moore2016-04-055-34/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 795e136d2ac77c1c8b091fba019b5fe36a44a323 Fixes a problem with the merger of the two internal versions of this function. Make the maximum integer width (32-bit or 64-bit) a parameter to the function so that it no longer exclusively uses the integer width specified in the DSDT/SSDT. ACPICA BZ 1260 Link: https://github.com/acpica/acpica/commit/795e136d Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Cleanup some invocation indentations, no functional changeBob Moore2016-04-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | ACPICA commit 9ed98dc36645aaeba11967722951156650d94f47 For consistency, cleanup function invocations. Link: https://github.com/acpica/acpica/commit/9ed98dc3 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: iASL: Cleanup/optimization for ToPLD macro supportBob Moore2016-04-052-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 0e6125401cf38427d5376f4bafbfb3d5a40f8467 Use local variables for access to string/value Op fields. Move duplicate PLD string tables to a single common table. Link: https://github.com/acpica/acpica/commit/0e612540 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Interpreter: Update some function headers, no functional changeBob Moore2016-04-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | ACPICA commit e068948f49eb61a78c211028976a174604c5644a Fix some issues in the exutils.c file. Link: https://github.com/acpica/acpica/commit/e068948f Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Intepreter: Add object extensions to Concatenate operandBob Moore2016-04-053-290/+440
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 60d9cfd403a9824199b971597c930f6f563e5c71 Allows all object types to be used with Concatenate. Objects other than Int/Str/Buf are convert to a string that contains the type of the object. Improves the utility of the Printf and Fprintf macros. Adds a new file, exconcat.c Link: https://github.com/acpica/acpica/commit/60d9cfd4 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: ACPI 6.1: Add full support for this version of ACPI specBob Moore2016-04-052-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 5f21bddaa2cec035ca80608803ce2f0858d4f387 Small changes: 1) A couple new predefined names 2) New _HID values 3) New subtable for HEST Link: https://github.com/acpica/acpica/commit/5f21bdda Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Tables: Update FADT handlingBob Moore2016-04-051-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit bca0c4cb063ee488c543e6f160fe89679a2338d6 Update a warning message simplify versioning for "table too big" case. Link: https://github.com/acpica/acpica/commit/bca0c4cb Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Linuxize: reduce divergences for 20160212 releaseLv Zheng2016-04-042-2/+1
| | | | | | | | | | | | | | | | | | | | The patch reduces source code differences between the Linux kernel and the ACPICA upstream so that the linuxized ACPICA 20160212 release can be applied with reduced human intervention. Signed-off-by: Lv Zheng <lv.zheng@intel.com> [ rjw: White space damage fixes ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* | ACPICA: Dispatcher: Update thread ID for recursive method callsPrarit Bhargava2016-05-041-0/+3
|/ | | | | | | | | | | | | | | | ACPICA commit 7a3bd2d962f221809f25ddb826c9e551b916eb25 Set the mutex owner thread ID. Original patch from: Prarit Bhargava <prarit@redhat.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=115121 Link: https://github.com/acpica/acpica/commit/7a3bd2d9 Signed-off-by: Prarit Bhargava <prarit@redhat.com> Tested-by: Andy Lutomirski <luto@kernel.org> # On a Dell XPS 13 9350 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Merge branch 'acpica'Rafael J. Wysocki2016-03-1424-185/+371
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * acpica: ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support ACPICA: Utilities: Update trace mechinism for acquire_object ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to acpi_gbl_namespace_initialized ACPICA: Namespace: Ensure \_SB._INI executed before any _REG ACPICA: ACPICA: Tune _REG evaluations order in the initialization steps ACPICA: Tables: make default region accessible during the table load ACPICA: ACPI 6.0/iASL: Add support for the External AML opcode ACPICA: Remove unnecessary arguments to ACPI_INFO ACPICA: debugger: dbconvert: free pld_info on error return path ACPICA: iASL: Update to use internal acpi_ut_strtoul64 function ACPICA: iASL: Fix some typos with the name strtoul64 ACPICA: Remove incorrect "static" from a global structure ACPICA: aclocal: Put parens around some definitions.
| * ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT ↵Lv Zheng2016-03-103-39/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support It is reported that the following commit triggers regressions: Linux commit: efaed9be998b5ae0afb7458e057e5f4402b43fa0 ACPICA commit: 31178590dde82368fdb0f6b0e466b6c0add96c57 Subject: ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen during OS early boot stages This is because that the ECDT support is not corrected in Linux, and Linux requires to execute _REG for ECDT (though this sounds so wrong), we need to ensure acpi_gbl_namespace_initialized is set before ECDT probing in order for _REG to be executed. Since we have to move "acpi_gbl_namespace_initialized = TRUE" to the initialization step happening before ECDT probing, acpi_load_tables() is the best candidate for now. Thus this patch fixes the regression by doing so. But if the ECDT support is fixed, Linux will not execute _REG for ECDT, and ECDT probing will happen before acpi_load_tables(). At that time, we still want to ensure acpi_gbl_namespace_initialized is set after executing acpi_ns_initialize_objects() (under the condition of acpi_gbl_group_module_level_code = FALSE), this patch also moves acpi_ns_initialize_objects() to acpi_load_tables() accordingly. Since acpi_ns_initialize_objects() doesn't seem to be skippable, this patch also removes ACPI_NO_OBJECT_INIT for the one invoked in acpi_load_tables(). And since the default region handlers should always be installed before loading the tables, this patch also removes useless acpi_gbl_group_module_level_code check accordingly. Reported by Chris Bainbridge, Fixed by Lv Zheng. Fixes: efaed9be998b (ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen during OS early boot stages) Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Utilities: Update trace mechinism for acquire_objectBob Moore2016-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 0824ab90e03c2e4239e890615f447e7962b1daa2 Was not using the correct macro. Updated a comment in acoutput.h Link: https://github.com/acpica/acpica/commit/0824ab90 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to ↵Lv Zheng2016-02-244-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_gbl_namespace_initialized ACPICA commit 4be3b82cf45d324366ea8567102d5108c5ef47cb ACPICA commit 19f84c249267fab0bfb138bd14d12510fb4faf24 The global variable actually means the availability of the namespace, and control methods evaluations should happen after namespace readiness. Thus this patch renames the global variable to reflect this logic. Lv Zheng. Link: https://github.com/acpica/acpica/commit/4be3b82c Link: https://github.com/acpica/acpica/commit/19f84c24 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>
| * ACPICA: Namespace: Ensure \_SB._INI executed before any _REGLv Zheng2016-02-243-77/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 8ae25b8d128b6b8509010be321ff6bf2760f3807 There is BIOS code relying on the fact that \_SB._INI should get evaluated before any other control methods. This may implies a gap in ACPICA/Linux initialization/enumeration process. Before revealing Windows true behavior by more validations, this patch only ensures \_SB._INI evaluated before any _REG control methods. This can help to make progress to other initialization order fixes. Lv Zheng. Link: https://github.com/acpica/acpica/commit/8ae25b8d 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>
| * ACPICA: ACPICA: Tune _REG evaluations order in the initialization stepsLv Zheng2016-02-241-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 77e0c7a482ac30ef857cf3c33d075e5fe5b5e449 This patch tunes _REG evaluations to be later than all table loading facilities: 1. acpi_load_tables(): _REG is currently invoked after this function. 2. acpi_ns_exec_module_code_list(): this executes module level code, the execution should be a part of the table loading while we currently support this in a deferred way. 3. acpi_ns_initialize_objects(): this parses Region/Field/Buffer/Package where pkg_length primitive can be seen in the grammar, the parsing should be a part of the table loading while we currently support this in a deferred way. Control method evaluation should happen after loading the tables. So this patch changes the order of _REG evaluation when acpi_gbl_group_module_level_code experiment is enabled. Lv Zheng. Link: https://github.com/acpica/acpica/commit/77e0c7a4 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>
| * ACPICA: Tables: make default region accessible during the table loadLv Zheng2016-02-242-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 016b2a0917cca9cf0d40c38a1541017d9cf569dd It is proven that the default regions should be accessible during the table loading in order to execute module level AML code. This patch moves default region handler installation code earlier in order to make this happen. Note that by putting the code here, we actually allow OSPMs to override default region handlers between acpi_initialize_subsystem() and acpi_load_tables(), without the need to introduce region handler override mechanism in acpi_install_address_space_handler(). OSPMs are also couraged to check acpi_install_address_space_handler() return value to determine if acpi_remove_address_space_handler() should be invoked before installing new address space handler. Lv Zheng. Link: https://github.com/acpica/acpica/commit/016b2a09 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>
| * ACPICA: ACPI 6.0/iASL: Add support for the External AML opcodeDavid E. Box2016-02-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 882892feeafe8b8e5be10463133405cd4f1309d9 Support for both the compiler and disassembler. Also, the interpreter will ignore this opcode if it is ever encountered (should not happen). David Box. Link: https://github.com/acpica/acpica/commit/882892fe Signed-off-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Remove unnecessary arguments to ACPI_INFOBob Moore2016-02-2413-29/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 181f56605a771e0b91e24b0648d2565ca70bea20 This is used as a purely infomation message, without module name and line number information. Therefore, these arguments are not needed and they are unnecessary overhead. Arguments are removed. ACPICA BZ 872. Link: https://github.com/acpica/acpica/commit/181f5660 Link: https://bugs.acpica.org/show_bug.cgi?id=872 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: debugger: dbconvert: free pld_info on error return pathColin Ian King2016-02-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 23e644670539e23818fa81e2af5e89ad6657e75c A failed allocation of new_buffer causes a leak of pld_info because the error return path fails to free pld_info. Ensure it is freed on the error exit path. Link: https://github.com/acpica/acpica/commit/23e64467 Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: iASL: Update to use internal acpi_ut_strtoul64 functionBob Moore2016-02-241-38/+206
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit e959584d23b520c53700e90282312d17b9603ed5 Was using a local Strtoul64, update to use the common acpi_ut_strtoul64 and remove the local Strtoul64. Link: https://github.com/acpica/acpica/commit/e959584d Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: iASL: Fix some typos with the name strtoul64Bob Moore2016-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | ACPICA commit e9622aa824e00997dc92e8638733b7553a4dba26 Was defined as stroul64 in some places. Link: https://github.com/acpica/acpica/commit/e9622aa8 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: Remove incorrect "static" from a global structureBob Moore2016-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 7a9956a2afd3863fa7d9fe4a64a957389d09f3c2 Reported by Colin Ian King. ACPICA BZ 1239. Link: https://github.com/acpica/acpica/commit/7a9956a2 Link: https://bugs.acpica.org/show_bug.cgi?id=1239 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * ACPICA: aclocal: Put parens around some definitions.waddlesplash2016-02-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | ACPICA commit 7100a109f7d6523330d29f4d088cf1ffb756025f Looking at where these are used, this shouldn't result in any behavioral changes, but it's best practices to have them. Link: https://github.com/acpica/acpica/commit/7100a109 Signed-off-by: waddlesplash <waddlesplash@gmail.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
OpenPOWER on IntegriCloud