Commit Graph

34 Commits

Author SHA1 Message Date
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 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
Lv Zheng cd27d79f56 ACPICA: Fix indentation issues for macro invocations.
During the automatic translation of the upstream ACPICA source code
into Linux kernel source code some extra white spaces are added by
the "indent" program at the beginning of each line which is an
invocation of a macro and there is no ";" at the end of the line.

For this reason, a new mode has been added to the translation scripts
to remove the extra spaces inserted before invoking such macros and add
an empty line between the invocations of such macros (like the other
function declarations).  This new mode is executed after executing
"indent" during the Linux release process.  Consequently, some
existing ACPICA source code in the Linux kernel tree needs to be
adjusted to allow the new scripts to work correctly.

The affected macros and files are:
 1. ACPI_HW_DEPENDENT_RETURN (acpixf.h/acdebug.h/acevents.h):
    This macro is used as a wrapper for hardware dependent APIs to offer
    a stub when the reduced hardware is configured during compilation.
 2. ACPI_EXPORT_SYMBOL (utglobal.c):
    This macro is used by Linux to export symbols to be found by Linux
    modules.  All such invocations are well formatted except those
    exported as global variables.

This can help to reduce the source code differences between Linux
and upstream ACPICA, and also help to automate the release process.
No functional or binary generation changes should result from it.
Lv Zheng.

[rjw: Changelog]
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>
2013-10-31 14:35:46 +01:00
Lv Zheng a2fd4b4b4e ACPICA: Add support for host-installed SCI handlers.
This change adds support to allow hosts to install System Control
Interrupt handlers. Certain ACPI functionality requires the host
to handle raw SCIs. For example, the "SCI Doorbell" that is defined
for memory power state support requires the host device driver to
handle SCIs to examine if the doorbell has been activated. Multiple
SCI handlers can be installed to allow for future expansion.
Debugger support is included.
Lv Zheng, Bob Moore. ACPICA BZ 1032.

Bug summary:
It is reported when the PCC (Platform Communication Channel, via
MPST table, defined in ACPI specification 5.0) subchannel responds
to the host, it issues an SCI and the host must probe the subchannel
for channel status.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1032
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-24 01:46:24 +02:00
Bob Moore 25f044e645 ACPICA: Update ACPICA copyrights to 2013
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>
2013-01-25 13:30:47 +01:00
Bob Moore 42f8fb75c4 ACPICA: Source restructuring: split large files into 8 new files.
Created logical splits for eight new files. Improves modularity
and configurability.

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-01-11 13:08:51 +01:00
Lv Zheng 1f86e8c1c9 ACPICA: Fix indent caused divergences.
New version of "indent" program will generate different outputs that
will lead to the divergences between the Linux and the ACPICA.
This patch fixes such divergences caused by the "indent" program.
The version of the "indent" used for this patch is "GNU indent 2.2.11".

This patch will not affect the generated vmlinux binary.
This will decrease 581 lines of 20120913 divergence.diff.

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>
2012-11-15 00:31:23 +01:00
Bob Moore ba494beeaa ACPICA: AcpiSrc: Fix some translation issues for Linux conversion
Fixes issues like this:

i_aSL -> iASL
00-7_f -> 00-7F
local_fADT -> local_FADT
execute_oSI -> execute_OSI

Also, in function headers, the parameters are now translated to
lower case (with underscores if necessary.)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-07-17 00:05:51 -04:00
Bob Moore 33620c5419 ACPICA: Support for custom ACPICA build for ACPI 5 reduced hardware
Add ACPI_REDUCED_HARDWARE flag that removes all hardware-related
code (about 10% code, 5% static data).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-22 01:44:49 -04:00
Bob Moore 77848130e5 ACPICA: Update all copyrights to 2012
Update all copyrights to 2012.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-01-17 03:38:51 -05:00
Bob Moore 9ce81784c9 ACPI 5.0: Implement Connection() and AccessAs() changes
Support within the interpreter and operation region dispatch.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-01-17 03:36:29 -05:00
Bob Moore 0f6896f195 ACPICA: Split all internal Global Lock functions to new file - evglock
These functions were moved from evmisc.c

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-05-09 22:16:11 -04:00
Bob Moore b4e104eaeb ACPICA: Update all ACPICA copyrights and signons to 2011
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-18 23:48:03 -05:00
Lin Ming bba63a296f ACPICA: Implicit notify support
This feature provides an automatic device notification for wake devices
when a wakeup GPE occurs and there is no corresponding GPE method or
handler. Rather than ignoring such a GPE, an implicit AML Notify
operation is performed on the parent device object.
This feature is not part of the ACPI specification and is provided for
Windows compatibility only.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-12 04:27:00 -05:00
Lin Ming 84f6b2a681 ACPICA: Remove unused function declarations
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-12 04:24:41 -05:00
Lin Ming 8b6cd8ad18 ACPICA: New GPE handler callback definition
The new GPE handler callback has 2 additional parameters, gpe_device and
gpe_number.

typedef
u32 (*acpi_gpe_handler) (acpi_handle gpe_device, u32 gpe_number, void *context);

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-12 04:24:41 -05:00
Lin Ming 3a37898d50 ACPICA: Rename some function and variable names
Some function and variable names are renamed to be consistent with
ACPICA code base.

acpi_raw_enable_gpe -> acpi_ev_add_gpe_reference
acpi_raw_disable_gpe -> acpi_ev_remove_gpe_reference
acpi_gpe_can_wake -> acpi_setup_gpe_for_wake
acpi_gpe_wakeup -> acpi_set_gpe_wake_mask
acpi_update_gpes -> acpi_update_all_gpes
acpi_all_gpes_initialized -> acpi_gbl_all_gpes_initialized
acpi_handler_info -> acpi_gpe_handler_info
...

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-12 04:24:40 -05:00
Lin Ming 3cfd53d53f ACPICA: Move GPE functions to new file evxfgpe.c
Create a new file evxfgpe.c and move GPE specific functions to it.

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-12 04:20:41 -05:00
Rafael J. Wysocki a210080195 ACPI / ACPICA: Defer enabling of runtime GPEs (v3)
The current ACPI GPEs initialization code has a problem that it
enables some GPEs pointed to by device _PRW methods, generally
intended for signaling wakeup events (system or device wakeup).
These GPEs are then almost immediately disabled by the ACPI namespace
scanning code with the help of acpi_gpe_can_wake(), but it would be
better not to enable them at all until really necessary.

Modify the initialization of GPEs so that the ones that have
associated _Lxx or _Exx methods and are not pointed to by any _PRW
methods will be enabled after the namespace scan is complete.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-09-24 16:55:47 -04:00
Rafael J. Wysocki 28f4f8a9de ACPI / ACPICA: Fix reference counting problems with GPE handlers
If a handler is installed for a GPE associated with an AML method and
such that it cannot wake up the system from sleep states, the GPE
remains enabled after the handler has been installed, although it
should be disabled in that case to avoid spurious execution of the
handler.

Fix this issue by making acpi_install_gpe_handler() disable GPEs
that were previously associated with AML methods and cannot wake up
the system from sleep states.

Analogously, make acpi_remove_gpe_handler() enable the GPEs that
are associated with AML methods after their handlers have been
removed and cannot wake up the system from sleep states.  In addition
to that, fix a code ordering issue in acpi_remove_gpe_handler() that
renders the locking ineffective (ACPI_MTX_EVENTS is released
temporarily in the middle of the routine to wait for the completion
of events already in progress).

For this purpose introduce acpi_raw_disable_gpe() and
acpi_raw_enable_gpe() to be called with acpi_gbl_gpe_lock held
and rework acpi_disable_gpe() and acpi_enable_gpe(), respectively, to
use them.  Also rework acpi_gpe_can_wake() to use
acpi_raw_disable_gpe() instead of calling acpi_disable_gpe() after
releasing the lock to avoid the possible theoretical race with
acpi_install_gpe_handler().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: "Moore, Robert" <robert.moore@intel.com>
Cc: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-07 10:30:12 -04:00
Rafael J. Wysocki 3bd741bd0d ACPICA: Use low-level GPE enable during GPE block initialization
The GPE block initialization code in acpi_ev_initialize_gpe_block()
uses acpi_set_gpe() to make sure that the GPEs with nonzero
runtime counter will remain enabled, but since it already has
a struct acpi_gpe_event_info object for each GPE, it might use
the low-level GPE enabling function, acpi_clear_and_enable_gpe(),
for this purpose.

To make that happen, move acpi_clear_and_enable_gpe() to
drivers/acpi/acpica/evgpe.c and rename it to acpi_ev_enable_gpe(),
modify the two existing users of it accordingly and modify
acpi_ev_initialize_gpe_block() to use it instead of acpi_set_gpe()
and to check its return value.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-07-06 22:34:27 -04:00
Rafael J. Wysocki a44061aa8b ACPICA: Remove wakeup GPE reference counting which is not used
After the previous patch that introduced acpi_gpe_wakeup() and
modified the ACPI suspend and wakeup code to use it, the third
argument of acpi_{enable|disable}_gpe() and the GPE wakeup
reference counter are not necessary any more.  Remove them and
modify all of the users of acpi_{enable|disable}_gpe()
accordingly.  Also drop GPE type constants that aren't used
any more.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-07-06 22:34:26 -04:00
Len Brown 9263482557 Merge branch 'gpe-regression-fixes' into release 2010-06-12 00:51:49 -04:00
Rafael J. Wysocki fd247447c1 ACPI / ACPICA: Fix low-level GPE manipulation code
ACPICA uses acpi_ev_enable_gpe() for enabling GPEs at the low level,
which is incorrect, because this function only enables the GPE if the
corresponding bit in its enable register's enable_for_run mask is set.
This causes acpi_set_gpe() to work incorrectly if used for enabling
GPEs that were not previously enabled with acpi_enable_gpe().  As a
result, among other things, wakeup-only GPEs are never enabled by
acpi_enable_wakeup_device(), so the devices that use them are unable
to wake up the system.

To fix this issue remove acpi_ev_enable_gpe() and its counterpart
acpi_ev_disable_gpe() and replace acpi_hw_low_disable_gpe() with
acpi_hw_low_set_gpe() that will be used instead to manipulate GPE
enable bits at the low level.  Make the users of acpi_ev_enable_gpe()
and acpi_ev_disable_gpe() call acpi_hw_low_set_gpe() instead and
make sure that GPE enable masks are only updated by acpi_enable_gpe()
and acpi_disable_gpe() when GPE reference counters change from 0
to 1 and from 1 to 0, respectively.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-06-12 00:44:37 -04:00
Bob Moore 3fe50208b2 ACPICA: Split large file, evgpeblk
Create two new files, evgpeinit.c and evgpeutil.c. Updated
unix and linux makefiles.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-05-06 03:05:54 -04:00
Bob Moore 186c307f00 ACPICA: Add GPE support for dynamically loaded ACPI tables
For all GPEs, including FADT-based and GPE Block Devices, execute
any _PRW methods in the new table, and process any _Lxx/_Exx GPE
methods in the new table. Any runtime GPE that is referred to
by an _Lxx/_Exx method in the new table is immediately enabled.
ACPICA BZ 833.

http://www.acpica.org/bugzilla/show_bug.cgi?id=833

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-05-06 03:05:54 -04:00
Lin Ming 0f849d2cc6 ACPICA: Minimize the differences between linux GPE code and ACPICA code base
We have ported Rafael's major GPE changes
(ACPI: Use GPE reference counting to support shared GPEs) into ACPICA code base.
But the port and Rafael's original patch have some differences, so we made
below patch to make linux GPE code consistent with ACPICA code base.

Most changes are about comments and coding styles.
Other noticeable changes are based on:

Rafael: Reduce code duplication related to GPE lookup
https://patchwork.kernel.org/patch/86237/

Rafael: Always use the same lock for GPE locking
https://patchwork.kernel.org/patch/90471/

A new field gpe_count in struct acpi_gpe_block_info to record the number
of individual GPEs in block.

Rename acpi_ev_save_method_info to acpi_ev_match_gpe_method.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Robert Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-04-20 10:43:16 -04:00
Linus Torvalds bc53515413 Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: replace acpi_integer by u64
  ACPICA: Update version to 20100121.
  ACPICA: Remove unused uint32_struct type
  ACPICA: Disassembler: Remove obsolete "Integer64" field in parse object
  ACPICA: Remove obsolete ACPI_INTEGER (acpi_integer) type
  ACPICA: Predefined name repair: fix NULL package elements
  ACPICA: AcpiGetDevices: Eliminate unnecessary _STA calls
  ACPICA: Update all ACPICA copyrights and signons to 2010
  ACPICA: Update for new gcc-4 warning options
2010-03-01 10:36:22 -08:00
Rafael J. Wysocki cbbc0de700 ACPI: Use GPE reference counting to support shared GPEs
To fix a bug and address the reviewers' comments regarding the ACPI
GPE refcounting patch, do the following additional changes:

o Remove the second argument of acpi_ev_enable_gpe(),
  'write_to_hardware', because it is not necessary any more.

o Add the "bad parameter" test against 'type' in
  acpi_enable_gpe() and acpi_disable_gpe().

o Make acpi_enable_gpe() only check 'status' for runtime GPEs if
  acpi_ev_enable_gpe() was actually called.

o Make acpi_disable_gpe() return 'status' returned by
  acpi_ev_disable_gpe() and fix a bug where ACPI_GPE_TYPE_WAKE
  and ACPI_GPE_TYPE_RUNTIME were exchanged by mistake.

o Add comments explaining why acpi_set_gpe() is used by the ACPI EC
  driver.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-24 14:25:23 -08:00
Rafael J. Wysocki 9630bdd9b1 ACPI: Use GPE reference counting to support shared GPEs
ACPI GPEs may map to multiple devices.  The current GPE interface
only provides a mechanism for enabling and disabling GPEs, making
it difficult to change the state of GPEs at runtime without extensive
cooperation between devices.

Add an API to allow devices to indicate whether or not they want
their device's GPE to be enabled for both runtime and wakeup events.

Remove the old GPE type handling entirely, which gets rid of various
quirks, like the implicit disabling with GPE type setting. This
requires a small amount of rework in order to ensure that non-wake
GPEs are enabled by default to preserve existing behaviour.

Based on patches from Matthew Garrett <mjg@redhat.com>.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:20:45 -08:00
Bob Moore 5df7e6cb42 ACPICA: Remove obsolete ACPI_INTEGER (acpi_integer) type
This type was introduced as the code was migrated from ACPI 1.0
(with 32-bit AML integers) to ACPI 2.0 (with 64-bit integers). It
is now obsolete and this change removes it from the ACPICA code
base, replaced by u64.  The original typedef has been retained
for now for compatibility with existing device driver code.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-01-22 12:30:06 -05:00
Bob Moore a8357b0c95 ACPICA: Update all ACPICA copyrights and signons to 2010
Add 2010 copyright to all module headers and signons, including
the Linux header. This affects virtually every file in the ACPICA
core subsystem, iASL compiler, and all utilities.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-01-22 12:30:05 -05:00
Bob Moore f5407af3f2 ACPICA: Simplify internal operation region interface
Changed address parameter to a simple offset. This removes the
need for the caller to access the region object to obtain the
physical address.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-05-27 00:35:51 -04:00
Len Brown e2f7a77728 ACPICA: hide private headers
Signed-off-by: Len Brown <len.brown@intel.com>
2009-01-09 03:31:01 -05:00