Commit graph

602 commits

Author SHA1 Message Date
Lv Zheng 6273f00e6e ACPICA: Fix buffer allocation issue for generic_serial_bus region accesses.
The size of the buffer allocated for generic_serial_bus region access
is not correct.  This patch introduces acpi_ex_get_serial_access_length()
to be invoked to obtain correct data buffer length.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reported by: Lan Tianyu <tianyu.lan@intel.com>
Acked-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-04-21 23:12:12 +02:00
Rafael J. Wysocki 08476907ab Merge branch 'acpica'
* acpica:
  ACPICA: Enable auto-serialization as a default kernel behavior.
  ACPICA: Ignore sync_level for methods that have been auto-serialized.
  ACPICA: Add additional named objects for the auto-serialize method scan.
  ACPICA: Add auto-serialization support for ill-behaved control methods.
  ACPICA: Remove global option to serialize all control methods.
2014-04-01 22:09:26 +02:00
Lv Zheng 08e1d7c029 ACPICA: Enable auto-serialization as a default kernel behavior.
The previous commit "ACPICA: Add auto-serialization support for ill-behaved
control methods" introduced the auto-serialization facility as a workaround
that can be enabled by "acpi_auto_serialize":

This feature marks control methods that create named objects as "serialized"
to avoid unwanted AE_ALREADY_EXISTS control method evaluation failures.

Enable method auto-serialization as the default kernel behavior.  The new kernel
parameter is also changed from "acpi_auto_serialize" to "acpi_no_auto_serialize"
to reflect the default behavior.

References: https://bugzilla.kernel.org/show_bug.cgi?id=52191
References: http://www.spinics.net/lists/linux-acpi/msg49496.html
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-26 16:26:00 +01:00
Bob Moore d18255795b ACPICA: Ignore sync_level for methods that have been auto-serialized.
Cannot use a sync_level for methods that have been serialized at load-time
or runtime because this may interfere with any existing use of sync_levels
within the ASL code. So, we simply ignore the sync_level for these methods,
thus preserving any existing sync_level priorities. Note, the use of
sync_levels is actually rather rare within BIOS ASL code.

References: http://www.spinics.net/lists/linux-acpi/msg49496.html
Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Reported-by: Sabrina Dubroka <sd@queasysnail.net>
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>
2014-03-26 16:25:59 +01:00
Lv Zheng 21bd7e610e ACPICA: Add additional named objects for the auto-serialize method scan.
This change adds some additional opcodes that are detected and will
cause a method to be auto-serialized. These opcodes are the various
CreateXField and the FieldUnit opcodes. Lv Zheng.

References: https://bugzilla.kernel.org/show_bug.cgi?id=52191
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>
2014-03-26 16:25:59 +01:00
Bob Moore 22b5afce6a ACPICA: Add auto-serialization support for ill-behaved control methods.
This change adds support to automatically mark a control method as
"serialized" if the method creates any named objects. This will
positively prevent the method from being entered by more than one
thread and thus preventing a possible abort when an attempt is
made to create an object twice.

Implemented by parsing all non-serialize control methods at table
load time.

This feature is disabled by default and this patch also adds a new
Linux kernel parameter "acpi_auto_serialize" to allow this feature
to be turned on for a specific boot.

References: https://bugzilla.kernel.org/show_bug.cgi?id=52191
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>
2014-03-26 16:25:59 +01:00
Lv Zheng e2b8ddcc6b ACPICA: Remove global option to serialize all control methods.
According to the reports, the "acpi_serialize" mechanism is broken as:

 A. The parallel method calls can still happen when the interpreter lock is
    released under the following conditions:
    1. External callbacks are invoked, for example, by the region handlers,
       the exception handlers, etc.;
    2. Module level execution is performed when Load/LoadTable opcodes are
       executed, and
    3. The _REG control methods are invoked to complete the region
       registrations.
 B. For the following situations, the interpreter lock need to be released
    even for a serialized method while currently, the lock-releasing
    operation is marked as a no-op by
    acpi_ex_relinquish/reacquire_interpreter() when this mechanism is
    enabled:
    1. Wait opcode is executed,
    2. Acquire opcode is executed, and
    3. Sleep opcode is executed.

This patch removes this mechanism and the internal
acpi_ex_relinquish/reacquire_interpreter() APIs.  Lv Zheng.

References: https://bugzilla.kernel.org/show_bug.cgi?id=52191
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>
2014-03-26 16:25:59 +01:00
Rafael J. Wysocki 6ac4a2ab16 Merge branch 'acpica'
* acpica: (29 commits)
  ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)."
  ACPICA: Update version to 20140214.
  ACPICA: Prevent infinite loops when traversing corrupted lists.
  ACPICA: Debugger: Add missing objects; Traverse linked lists
  ACPICA: Add text: ACPICA policy for new _OSI strings. No functional change.
  ACPICA: Update for _PRP predefined name.
  ACPICA: Cleanup/improve global variable declarations.
  ACPICA: Comment update - no functional change.
  ACPICA: Do not abort _PRT repair on a single subpackage failure.
  ACPICA: Harden _PRT repair code; check for minimum package length.
  ACPICA: Restore code that repairs NULL package elements in return values.
  ACPICA: Properly handle NULL entries in _PRT return packages.
  ACPICA: Update conditional compilation flags for resource dump functions.
  ACPICA: Predefined names: Add support for the _PRP method.
  ACPICA: Headers: Deploy #pragma pack (push) and (pop).
  ACPICA: Add boot option to disable auto return object repair
  ACPICA: acpidump: Remove integer types translation protection.
  ACPICA: acpidump: Add sparse declarators support.
  ACPICA: Add "Windows 2013" string to _OSI support.
  ACPICA: Update version to 20140114.
  ...
2014-03-20 13:25:02 +01:00
Robert Moore 6e59608483 ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)."
This reverts commit aae576e5faefa8ba70647efa320d4747b6375f1e.
Push and Pop are not portable "enough", and caused problems for
some ACPICA customers.

Signed-off-by: Robert 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>
2014-03-18 01:53:45 +01:00
Bob Moore f953529f3b ACPICA: Prevent infinite loops when traversing corrupted lists.
This change hardens the ACPICA code to detect circular linked object
lists and prevent an infinite loop if such corruption exists.

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>
2014-03-18 01:52:18 +01:00
Bob Moore a487af33a4 ACPICA: Debugger: Add missing objects; Traverse linked lists
This change adds support for two missing objects, the "extra" and
"data" secondary objects, as well as adding support to traverse and
display linked lists related to ACPICA objects.

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>
2014-03-18 01:52:17 +01:00
Bob Moore 73581c022d ACPICA: Add text: ACPICA policy for new _OSI strings. No functional change.
Adds further information about why new _OSI strings should be
adopted by all hosts as soon as possible.

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>
2014-03-18 01:52:17 +01:00
Bob Moore 3ef27bd002 ACPICA: Update for _PRP predefined name.
Allow objects of type "reference" in the second subpackage element.

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>
2014-03-18 01:52:17 +01:00
Lv Zheng 3aa0b085f6 ACPICA: Cleanup/improve global variable declarations.
This change cleans up the entire global variable mechaninism including
the related macros. Also reduces warnings from the "sparse" utility
in the Linux environment. Lv Zheng.

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>
2014-03-18 01:50:57 +01:00
Bob Moore 0a16d12a8e ACPICA: Comment update - no functional change.
Change all instances of "sub-package" to "subpackage" for consistency.

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>
2014-03-18 01:47:30 +01:00
Bob Moore 69e6bb6898 ACPICA: Do not abort _PRT repair on a single subpackage failure.
Always examine all subpackages for reversed entries.

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>
2014-02-27 00:46:00 +01:00
Bob Moore 1c3c2a545d ACPICA: Harden _PRT repair code; check for minimum package length.
This change prevents a fault during the repair by checking up
front if the _PRT subpackage contains the minimum number of
elements (4).

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>
2014-02-27 00:46:00 +01:00
Lv Zheng 61db45ca21 ACPICA: Restore code that repairs NULL package elements in return values.
The original code was lost accidently, it was not generated along with the
following commit of mechanism improvements and thus not get merged:

  Commit: d5a36100f6
  Subject: ACPICA: Add mechanism for early object repairs on a per-name basis

  Adds the framework to allow object repairs very early in the
  return object analysis. Enables repairs like string->unicode,
  etc.

This patch restores the implementation of the NULL element repair code for
ACPI_RTYPE_NONE.  In the original design, ACPI_RTYPE_NONE is defined to
collect simple NULL object repairs.
Lv Zheng.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=67901
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-27 00:46:00 +01:00
Lv Zheng 8313064930 ACPICA: Properly handle NULL entries in _PRT return packages.
This change enables proper handling of NULL package entries in a _PRT
return value, during construction of the PCI routing table.
Lv Zheng.

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>
2014-02-27 00:45:59 +01:00
Lv Zheng 9ad4caf3f8 ACPICA: Update conditional compilation flags for resource dump functions.
Corrects ACPI_DISASSEMBLER to the compile conditions.  The wrong
condition was introduced by this commit:
  Commit: 3334861b1e
  Subject: ACPICA: Update the conditions to enable the utility resource dump strings.

This was detected in the ACPICA upstream.  Linux is not affected by the
wrong commit as the disassembler is not shipped in the Linux.

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>
2014-02-27 00:45:59 +01:00
Bob Moore 5e7f18334f ACPICA: Predefined names: Add support for the _PRP method.
This is not an official predefined name yet, but we add it to assist
with development.

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>
2014-02-27 00:45:59 +01:00
Bob Moore 4ac4c5fad8 ACPICA: Headers: Deploy #pragma pack (push) and (pop).
Use push and pop to both guarantee that the correct alignment is used,
and to restore the alignment to whatever it was before the header
was included.

It is reported that the #pragma pack(push/pop) directives are not supported
by the specific GCCs, but this patch still doesn't affect kernel build
as there are already #pragma pack([1]) directives used in the old ACPICA
headers, which means there shouldn't be GCCs that are currently used to
compile the ACPI kernels do not support #pragma pack() directives.

References: https://bugs.acpica.org/show_bug.cgi?id=1058
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>
2014-02-27 00:45:59 +01:00
Bob Moore faae404ebd ACPICA: Add "Windows 2013" string to _OSI support.
This urgent patch is cherry picked from ACPICA upstream.
It is reported that some platforms fail to boot without this new _OSI
string.

This change adds this string for Windows 8.1 and Server 2012 R2.

Reported-by: Zhang Rui <rui.zhang@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>
2014-02-13 15:28:08 +01:00
Lv Zheng 3334861b1e ACPICA: Update the conditions to enable the utility resource dump strings.
This patch enables resource dump functions for debugging purpose where
ACPI_DEBUG_OUTPUT is enabled.  Such functions are useful for developers
to track kernel issues when composing debugging patches.  They will be
optimized out during link stage for normal builds.

This patch updates the compilation condition used for the resource dump
related string tables to match the compilation environment used for
rsdump.c and rsdumpinfo.c.

This patch can help to improve the ACPICA release automation.  Lv Zheng.

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>
2014-02-11 00:30:25 +01:00
Bob Moore eb60c4d3a4 ACPICA: Debugger: Add new command to read/write/compare all namespace objects.
This command "test objects" will exercise the entire namespace by
writing new values to each data object, and ensuring that the write
was successful. The original value is then restored and verified.

This patch doesn't affect kernel behavior as the debugger is
currently not shipped in the Linux source tree.

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>
2014-02-11 00:30:25 +01:00
Bob Moore ab85e9285d ACPICA: Correctly support references in the union acpi_object.
This change fixes the support to allow references (namespace nodes)
to be passed as arguments to control methods via the evaluate object
interface. This is probably most useful for testing purposes, however.

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>
2014-02-11 00:30:25 +01:00
Bob Moore fbb7a2dc2b ACPICA: Update ACPICA copyrights to 2014.
Update ACPICA copyrights to 2014. Includes all source headers and
signons for the various tools.

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>
2014-02-11 00:30:25 +01:00
Bob Moore 9186fb5807 ACPICA: Improve parameter validation for acpi_install_gpe_block.
Add the following checks:
1) The incoming device handle refers to type ACPI_TYPE_DEVICE.
2) There is not already a gpe block attached to the device.

Likewise, with acpi_remove_gpe_block, ensure that the incoming object
is a device.

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>
2014-02-11 00:30:24 +01:00
Bob Moore d72c17a867 ACPICA: Utilities: Load of local test tables is now optional.
The utility has the capability to load some various tables to test
features of ACPICA. However, there are enough of them that the output
of the utility became confusing. With this change, only the required
local tables are displayed (RSDP, XSDT, etc.) along with the actual
tables loaded via the command line specification. This makes the
default output simler and easier to understand. The -el command line
option restores the original behavior for testing purposes.

This patch doesn't affect kernel behavior as Linux doesn't use ACPICA
allocation tracking implementation.

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>
2014-02-11 00:30:24 +01:00
Bob Moore 2e19f8d02e ACPICA: Deploy new 32/64 printf support for table override mechanism.
Similar to the earlier tbprint.c change.

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>
2014-02-11 00:30:24 +01:00
Bob Moore c03775c082 ACPICA: Improve support for 32/64 bit physical addresses in printf().
This change improves the support for physical addresses in printf
debug statements and other output on both 32-bit and 64-bit hosts.
It consistently outputs the appropriate number of bytes for each
host. The %p specifier is unsatisfactory since it does not emit
uniform output on all hosts/clib implementations (on some, leading
zeros are not supported, leading to difficult-to-read output).

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>
2014-02-11 00:30:23 +01:00
Rafael J. Wysocki 7c2e17714e ACPICA: Introduce acpi_get_data_full() and rework acpi_get_data()
Introduce a new function, acpi_get_data_full(), working in analogy
with acpi_get_data() except that it can execute a callback provided
as its 4th argument right after acpi_ns_get_attached_data() has
returned a success.

That will allow Linux to reference count the object pointed to by
*data before the namespace mutex is released so as to ensure that it
will not be freed going forward until the reference to it acquired
by acpi_get_data_full() is dropped.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2014-02-05 17:41:16 +01:00
Lv Zheng 481c13814a ACPICA: Remove bool usage from ACPICA.
The use of "bool" is not safe for ACPICA code where it is originally using
a "BOOLEAN" defined as "unsigned char".

This patch removes the only "bool" usage from kernel source tree to reduce
the source code differences between Linux and ACPICA upstream.

This patch is required by future acpidump release automation.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-27 23:59:08 +01:00
Lv Zheng 71487f3ffd ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global.
This global is acting as an OSL global variable, implemented in the
oswinxf.c and osunixxf.c.

This patch cleans up the definition of this variable so that new utilities
do not need to define it in order to link.

Linux kernel behaviour is not affected as the changes only applies to the
ACPICA userspace utilities which are not shipped in the kernel currently.

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>
2014-01-08 15:31:39 +01:00
Lv Zheng ed6069445d ACPICA: Linuxize: Cleanup spaces after special macro invocations.
This patch reflects the improvment of a cleanup step which is performed in
the release process.

There are still spaces in the "linuxized" ACPICA files after special macro
invocations.  This is because indent treats comments and pre-processor
directives as spaces, thus we need to skip them.

Before applying this patch, cleanup code will search from keyword back to
end of line and wipe spaces between them.

After applying this patch, cleanup code will search to the end of the macro
invocations, skip "empty lines", "comments" and "pre-processor directives",
then wipe the spaces between the new line and the first non-spaces
characters.

Following improvements are thus achieved in the release automation by this
commit which are originally maintained manually:
 - acpi_status acpi_ev_remove_global_lock_handler(void);
 +acpi_status acpi_ev_remove_global_lock_handler(void);
 - acpi_status
 +acpi_status
  acpi_ev_match_gpe_method(acpi_handle obj_handle,
 - acpi_status acpi_subsystem_status(void);
 +acpi_status acpi_subsystem_status(void);
 - acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
 +acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
 - acpi_status
 +acpi_status
  acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout);
 - acpi_status
 +acpi_status
  acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b);
 - acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
 +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
Some empty lines are restored by this commit due to the change of the
removal implementation.

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>
2014-01-08 15:31:39 +01:00
Bob Moore 06d186010c ACPICA: Interpreter: Add additional debug info for an error case.
Emit the name of the namespace node for the error case when
there is no subobject attached to the node.

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>
2014-01-08 15:31:39 +01:00
Bob Moore 1a2c478371 ACPICA: Add an error message if the Debugger fails initialization.
Previously, only status was returned.

Linux kernel behaviour is not affected as the changes only apply to the
debugger which is currently not shipped in the kernel.

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>
2014-01-08 15:31:38 +01:00
Bob Moore 5d4de9af84 ACPICA: Conditionally define a local variable that is used for debug only.
This patch improves the relationship between the opcode debugging
information and CONFIG_ACPI_DEBUG enablement.

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>
2014-01-08 15:31:38 +01:00
Bob Moore 20c40de059 ACPICA: Parser: Updates/fixes for debug output.
Major changes in this patch are made to improve the debug output mode of
the compiler.

Linux kernel behaviour is not affected as the change only applies to
the compiler which is not shipped in the Linux kernel.

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>
2014-01-08 15:31:37 +01:00
Bob Moore 0f607cb59e ACPICA: Enhance ACPI warning for memory/IO address conflicts.
This change improves the warning message when a system address
conflicts with an existing operation region. It now emits the region
address range in addition to the input (system) address range.

Reported-by: Prarit Bhargava <prarit@redhat.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>
2014-01-08 15:31:37 +01:00
Bob Moore 87beb7e828 ACPICA: Update several debug statements - no functional change.
Update the format and information emitted from several
debug output statements.

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>
2014-01-08 15:31:37 +01:00
Bob Moore 4bec3d80a0 ACPICA: Improve exception handling for GPE block installation.
1) Return an actual status value from acpi_ev_get_gpe_xrupt_block.
2) Don't clobber the status when exiting acpi_ev_install_gpe_block.

References: https://bugs.acpica.org/show_bug.cgi?id=1019
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>
2014-01-08 15:31:37 +01:00
Bob Moore 0249ed2444 ACPICA: Add option to favor 32-bit FADT addresses.
This change adds an option to favor 32-bit FADT addresses when there
is a conflict between the 32-bit and 64-bit versions of the same
address. The default behavior is to use the 64-bit version in accordance
with the ACPI specification. This can now be overridden via the
AcpiGbl_Use32BitFadtAddresses flag. Lv Zheng.

Also, the "Convert FADT" and "Verify FADT" functions have been merged to
simplify the code, make it easier to understand, and make it easier to
maintain. Bob Moore.

References: https://bugs.acpica.org/show_bug.cgi?id=885
References: https://bugs.acpica.org/show_bug.cgi?id=993
Original-by: Lv Zheng <lv.zheng@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>
2014-01-08 15:31:36 +01:00
Lv Zheng fab4610583 ACPICA: Cleanup the option of forcing the use of the RSDT.
This change adds a runtime option that will force ACPICA to use the
RSDT instead of the XSDT. Although the ACPI spec requires that an XSDT
be used instead of the RSDT, the XSDT has been found to be corrupt or
ill-formed on some machines.

This option is already in the Linux kernel.  When it is back ported to
ACPICA, code is re-written to follow ACPICA coding style.  This patch
is the generation of the integration.

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>
2014-01-08 15:31:36 +01:00
Lv Zheng 671cc68dc6 ACPICA: Back port and refine validation of the XSDT root table.
Some platforms contain an XSDT that is ill-formed or otherwise invalid
(such as containing some or all entries that are NULL pointers).
This change adds a new function to validate the XSDT before actually
using it. If the XSDT is found to be invalid, ACPICA will now fall
back to using the RSDT instead.

This feature is already in the Linux kernel.  When it is back ported to
ACPICA, code is refined to follow ACPICA coding style and this patch
is the generation of the integration.

Original-by: Zhao Yakui <yakui.zhao@intel.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>
2014-01-08 15:31:36 +01:00
Lv Zheng bb3fec146c ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.
This macro is no longer used by ACPICA and it is not public.
Also update comments related to the use of ACPI_ALLOCATE_BUFFER and
the use of acpi_os_free (kfree is equivalent and prefered in the
kernel) to free the buffer.

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>
2014-01-08 15:31:36 +01:00
Bob Moore 5af2b6351b ACPICA: Disassembler: Improve pathname support for emitted External() statements.
This change adds full pathname support for external names that have been
resolved internally by the inclusion of additional ACPI tables (via the
iASL -e option). Without this change, the disassembler can emit multiple
externals for the same object, or it become confused when the Scope()
operator is used on an external object.

Linux kernel behaviour is not affected as the structure changes and the
new invocations are only used by compiler and disassembler which are
not shipped in the kernel currently.

Reported-by: Michael Tsirkin <mst@redhat.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>
2014-01-08 15:31:36 +01:00
Bob Moore 5076f00504 ACPICA: Debug output: Fix a couple of small output issues.
1) Fix utcache to use the proper return macros in order to maintain
the function nesting level.

2) Enable the function nesting level for all ACPI applications instead
of just acpiexec.

Linux kernel behaviour is not affected by this patch as Linux doesn't
use ACPICA object cache mechanism currently.

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>
2014-01-08 15:31:36 +01:00
Rafael J. Wysocki 2d304ba757 Merge branch 'acpica'
* acpica:
  ACPI: Clean up incorrect inclusions of ACPICA headers
  ACPICA: Update version to 20131115.
  ACPICA: Add support to delete all objects attached to the root namespace node.
  ACPICA: Delete all attached data objects during namespace node deletion.
  ACPICA: Resources: Fix loop termination for the get AML length function.
  ACPICA: Tests: Add CHECKSUM_ABORT protection for test utilities.
  ACPICA: Debug output: Do not emit function nesting level for kernel build.
2013-11-27 01:03:27 +01:00
Bob Moore 3f69fe1531 ACPICA: Add support to delete all objects attached to the root namespace node.
This fix deletes any and all objects that have been attached to the
root node (via acpi_attach_data). Reported by Tomasz Nowicki.
ACPICA BZ 1026.

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>
2013-11-21 13:47:04 +01:00