History log of /linux-master/drivers/acpi/acpica/utmutex.c
Revision Date Author Comments
# c57c0ad4 25-Apr-2018 Steven Rostedt <rostedt@goodmis.org>

ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock

We hit the following bug with -RT:

|BUG: scheduling while atomic: swapper/7/0/0x00000002
|Pid: 0, comm: swapper/7 Not tainted 3.6.11-rt28.19.el6rt.x86_64.debug #1
|Call Trace:
| rt_spin_lock+0x16/0x40
| __schedule_bug+0x67/0x90
| __schedule+0x793/0x7a0
| acpi_os_acquire_lock+0x1f/0x23
| acpi_write_bit_register+0x33/0xb0
| rt_spin_lock_slowlock+0xe5/0x2f0
| acpi_idle_enter_bm+0x8a/0x28e

As the acpi code disables interrupts in acpi_idle_enter_bm, and calls
code that grabs the acpi lock, it causes issues as the lock is currently
in RT a sleeping lock.

The lock was converted from a raw to a sleeping lock due to some
previous issues, and tests that showed it didn't seem to matter.
Unfortunately, it did matter for one of our boxes.

This patch converts the lock back to a raw lock. I've run this code on a
few of my own machines, one being my laptop that uses the acpi quite
extensively. I've been able to suspend and resume without issues.

[ tglx: Made the change exclusive for acpi_gbl_hardware_lock ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1360765565.23152.5.camel@gandalf.local.home
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bigeasy: shorten the backtrace, use the type acpi_raw_spinlock incl.
accessor]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 95857638 14-Mar-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: adding SPDX headers

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# da6f8320 04-Jan-2018 Bob Moore <robert.moore@intel.com>

ACPICA: All acpica: Update copyrights to 2018

including tool signons.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 692aa0cf 17-Nov-2017 Bob Moore <robert.moore@intel.com>

ACPICA: Update mutex error messages, no functional change

ACPICA commit 22f2b0beb45d277841ed02bc613df1009e5b20cf

Add mutex name on certain acquire/release errors.

Link: https://github.com/acpica/acpica/commit/22f2b0be
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 7735ca0e 07-Feb-2017 Bob Moore <robert.moore@intel.com>

ACPICA: Source tree: Update copyright notices to 2017

ACPICA commit 16577e5265923f4999b4d2c0addb2343b18135e1

Affects all files.

Link: https://github.com/acpica/acpica/commit/16577e52
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>


# c8100dc4 14-Jan-2016 Bob Moore <robert.moore@intel.com>

ACPICA: Additional 2016 copyright changes

All tool/utility signons.
Dual-license module header.

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>


# 1fad8738 28-Dec-2015 Bob Moore <robert.moore@intel.com>

ACPICA: Core: Major update for code formatting, no functional changes

ACPICA commit dfa394471f6c01b2ee9433dbc143ec70cb9bca72

Mostly indentation inconsistencies across the code. Split
some long lines, etc.

Link: https://github.com/acpica/acpica/commit/dfa39447
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>


# f8d31489 02-Dec-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Debugger: Convert some mechanisms to OSPM specific

The following mechanisms are OSPM specific:
1. Redirect output destination to console: no file redirection will be
needed by an in-kernel debugger, there is even no file can be accessed
when the debugger is running in the kernel mode.
2. Output command prompts: programs other than acpiexec can have different
prompt characters and the prompt characters may be implemented as a
special character sequence to form a char device IO protocol.
3. Command ready/complete handshake: OSPM debugger may wait more conditions
to implement OSPM specific semantics (for example, FIFO full/empty
conditions for O_NONBLOCK or IO open/close conditions).
Leaving such OSPM specific stuffs in the ACPICA debugger core blocks
Linux debugger IO driver implementation.

Several new OSL APIs are provided by this patch:
1. acpi_os_initialize_command_signals: initialize command handshake mechanism
or any other OSPM specific stuffs.
2. acpi_os_terminate_command_signals: reversal of
acpi_os_initialize_command_signals.
3. acpi_os_wait_command_ready: putting debugger task into wait state when a
command is not ready. OSPMs can terminate command loop by returning
AE_CTRL_TERMINATE from this API. Normally, wait_event() or
wait_for_multiple_object() may be used to implement this API.
4. acpi_os_notify_command_complete: putting user task into running state when a
command has been completed. OSPMs can terminate command loop by
returning AE_CTRL_TERMINATE from this API. Normally, wake_up() or
set_event() may be used to implement this API.
This patch also converts current command signaling implementation into a
generic debugger layer (osgendbg.c) to be used by the existing OSPMs or
acpiexec, in return, Linux can have chance to implement its own command
handshake mechanism. This patch also implements acpiexec batch mode in a
multi-threading mode comaptible style as a demo (this can be confirmed by
configuring acpiexec into DEBUGGER_MULTI_THREADED mode where the batch mode
is still working). Lv Zheng.

Note that the OSPM specific command handshake mechanism is required by
Linux kernel because:
1. Linux kernel trends to use wait queue to synchronize two threads, using
mutexes to achieve that will cause false "dead lock" warnings.
2. The command handshake mechanism implemented by ACPICA is implemented in
this way because of a design issue in debugger IO streaming. Debugger IO
outputs are simply cached using a giant buffer, this should be tuned by
Linux in the future.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# cd64bbf8 18-Oct-2015 Bob Moore <robert.moore@intel.com>

ACPICA: Debugger: Update mutexes used for multithreaded debugger

ACPICA commit 6b2701f619040e803313363f516b200e362a9100

Make these mutex objects independent of the deadlock detection mechanism.
This mechanism caused failures with the multithread debugger.

This patch doesn't affect Linux kernel as debugger is currently not fully
functioning in the Linux kernel. And the further debugger cleanups will
take care of handling debugger command signalling correctly instead of
using such kind of mutexes. So it is safe to leave this patch as it is.

Link: https://github.com/acpica/acpica/commit/6b2701f6
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>


# 82a80941 05-Feb-2015 David E. Box <david.e.box@linux.intel.com>

ACPICA: Update Copyright headers to 2015

ACPICA commit 8990e73ab2aa15d6a0068b860ab54feff25bee36

Link: https://github.com/acpica/acpica/commit/8990e73a
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>


# fbb7a2dc 07-Feb-2014 Bob Moore <robert.moore@intel.com>

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>


# 58892c96 11-Apr-2013 Bob Moore <robert.moore@intel.com>

ACPICA: Add a lock to the internal object reference count mechanism

Certain external interfaces need to update object references
without holding the interpreter or namespace mutex objects. To
prevent race conditions, add a spinlock around the increment
and decrement of the reference counts for internal ACPI
objects. Reported by Andriy Gapon (avg@FreeBSD.org).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Andriy Gapon <avg@FreeBSD.org>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 25f044e6 24-Jan-2013 Bob Moore <robert.moore@intel.com>

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>


# 73a3090a 30-Oct-2012 Bob Moore <robert.moore@intel.com>

ACPICA: Remove extra spaces after periods within comments

This makes all comments consistent.

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>


# 68aafc35 30-Oct-2012 Bob Moore <robert.moore@intel.com>

ACPICA: Audit/update for ACPICA return macros and debug depth counter

1) Ensure that all functions that use the various TRACE macros
also use the appropriate ACPICA return macros.
2) Ensure that all normal return statements surround the return
expression (value) with parens.

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>


# ba494bee 11-Jul-2012 Bob Moore <robert.moore@intel.com>

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>


# 77848130 11-Jan-2012 Bob Moore <robert.moore@intel.com>

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>


# 42f52843 27-Nov-2011 Bob Moore <robert.moore@intel.com>

ACPICA: Update for GCC 4

Fixes several issues with GCC 4.6 related to the new checks for
unused variables.

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

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>


# 749c2763 23-Mar-2011 Lin Ming <ming.m.lin@intel.com>

ACPICA: Fix code divergence of global lock handling

Commit 9cd0314(ACPI / ACPICA: Fix global lock acquisition) was backported
into ACPICA code base, and some divergence was introduced.

This patch fixed it,
- rename acpi_ev_global_lock_pending/acpi_ev_global_lock_pending_lock
to acpi_gbl_global_lock_pending/acpi_gbl_global_lock_pending_lock.

- move the initialization of acpi_gbl_global_lock_pending_lock from
acpi_ut_mutex_initialize to acpi_ev_init_global_lock_handler.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>


# 3854c8e3 23-Mar-2011 Lin Ming <ming.m.lin@intel.com>

ACPICA: Use acpi_os_create_lock interface

Replace spin_lock_init with acpi_os_create_lock.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# b4e104ea 16-Jan-2011 Bob Moore <robert.moore@intel.com>

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>


# 9a1fe2f2 14-Jan-2011 Rafael J. Wysocki <rjw@rjwysocki.net>

ACPI / ACPICA: Initialize the global lock spinlock as appropriate

Commit 9cd0314 (ACPI / ACPICA: Fix global lock acquisition) forgot to
initialize the spinlock it added. Fix that.

Reported-and-tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 28eb3fcf 14-Sep-2010 Lin Ming <ming.m.lin@intel.com>

ACPICA: Make acpi_thread_id no longer configurable, always u64

Change definition of acpi_thread_id to always be a u64. This
simplifies the code, especially any printf output. u64 is
the only common data type for all thread_id types across all
operating systems. We now force the OSL to cast the native
thread_id type to u64 before returning the value to ACPICA
(via acpi_os_get_thread_id).

Signed-off-by: Lin Ming <ming.m.lin@intel.com
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# b0ed7a91 05-Aug-2010 Lin Ming <ming.m.lin@intel.com>

ACPICA/ACPI: Add new host interfaces for _OSI support

Adds install/remove interfaces so that the host can dynamically
alter the global _OSI table. Also adds support for _OSI handlers.
Additional support: new debugger command (osi), and test support in
the acpiexec utility. Adds new file, utilities/utosi.c.
ACPICA bugzilla 836.

The Linux OSL _OSI code is also changed.
acpi_osi_setup can't call acpi_install/remove_interface because ACPICA
is not initialized yet at this early time.
So we just save the osi string in acpi_osi_setup and will handle it
later in a new function acpi_osi_setup_late.

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

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com
Signed-off-by: Len Brown <len.brown@intel.com>


# cfa806f0 20-Jul-2010 Andi Kleen <andi@firstfloor.org>

gcc-4.6: ACPI: fix unused but set variables in ACPI

Some minor improvements in error handling, but overall it was mostly dead
code.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>


# f6a22b0b 05-Mar-2010 Bob Moore <robert.moore@intel.com>

ACPICA: Standardize integer output for ACPICA warnings/errors

Always use 0x prefix for hex output, use %u for integer output
(all integers are unsigned.)

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>


# a8357b0c 22-Jan-2010 Bob Moore <robert.moore@intel.com>

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>


# 2147d3f0 20-Jan-2010 Bob Moore <robert.moore@intel.com>

ACPICA: Update for new gcc-4 warning options

Added several new options for the gcc-4 generation, and updated
the source accordingly. This includes some code restructuring to
eliminate unreachable code, elimination of some gotos, elimination
of unused return values, and some additional casting.

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>


# 10b6575b 21-Apr-2009 Bob Moore <robert.moore@intel.com>

ACPICA: Fix possible warnings for ACPI_THREAD_ID on 64-bit build

Warnings can be generated for printf-like statements that output
the ACPI_THREAD_ID on 64-bit builds, since this type can expand
to 64-bits depending on how it is defined. Use the %p format
specifier to allow the output to automatically expand to 64 bits.

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>


# 8a335a23 09-Mar-2009 Bob Moore <robert.moore@intel.com>

ACPICA: Fix AcpiWalkNamespace race condition with table unload

Added a reader/writer locking mechanism to allow multiple
concurrent namespace walks (readers), but a dynamic table unload
will have exclusive access to the namespace. This fixes a problem
where a table unload could delete the portion of the namespace that
is currently being examined by a walk. Adds a new file, utlock.c
that implements the reader/writer lock mechanism. ACPICA BZ 749.

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

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>


# e2f7a777 08-Jan-2009 Len Brown <len.brown@intel.com>

ACPICA: hide private headers

Signed-off-by: Len Brown <len.brown@intel.com>


# 95b482a8 08-Jan-2009 Len Brown <len.brown@intel.com>

ACPICA: create acpica/ directory

also, delete sleep/ and delete ACPI_CFLAGS from Makefile

Signed-off-by: Len Brown <len.brown@intel.com>