mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-22 04:15:02 +00:00
ACPICA: Release global lock from interrupt handler
The ACPI Global Lock interrupt handler no longer queues the execution of a separate thread to signal the global lock semaphore. Instead, the semaphore is signaled directly from the interrupt handler. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
c81da66608
commit
a72d47563b
1 changed files with 15 additions and 35 deletions
|
@ -67,8 +67,6 @@ static const char *acpi_notify_value_names[] = {
|
||||||
|
|
||||||
static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
|
static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
|
||||||
|
|
||||||
static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context);
|
|
||||||
|
|
||||||
static u32 acpi_ev_global_lock_handler(void *context);
|
static u32 acpi_ev_global_lock_handler(void *context);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -280,45 +278,21 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
|
||||||
acpi_ut_delete_generic_state(notify_info);
|
acpi_ut_delete_generic_state(notify_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
*
|
|
||||||
* FUNCTION: acpi_ev_global_lock_thread
|
|
||||||
*
|
|
||||||
* PARAMETERS: Context - From thread interface, not used
|
|
||||||
*
|
|
||||||
* RETURN: None
|
|
||||||
*
|
|
||||||
* DESCRIPTION: Invoked by SCI interrupt handler upon acquisition of the
|
|
||||||
* Global Lock. Simply signal all threads that are waiting
|
|
||||||
* for the lock.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context)
|
|
||||||
{
|
|
||||||
acpi_status status;
|
|
||||||
|
|
||||||
/* Signal the thread that is waiting for the lock */
|
|
||||||
|
|
||||||
/* Send a unit to the semaphore */
|
|
||||||
|
|
||||||
status = acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore, 1);
|
|
||||||
if (ACPI_FAILURE(status)) {
|
|
||||||
ACPI_ERROR((AE_INFO, "Could not signal Global Lock semaphore"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* FUNCTION: acpi_ev_global_lock_handler
|
* FUNCTION: acpi_ev_global_lock_handler
|
||||||
*
|
*
|
||||||
* PARAMETERS: Context - From thread interface, not used
|
* PARAMETERS: Context - From thread interface, not used
|
||||||
*
|
*
|
||||||
* RETURN: ACPI_INTERRUPT_HANDLED or ACPI_INTERRUPT_NOT_HANDLED
|
* RETURN: ACPI_INTERRUPT_HANDLED
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Invoked directly from the SCI handler when a global lock
|
* DESCRIPTION: Invoked directly from the SCI handler when a global lock
|
||||||
* release interrupt occurs. Grab the global lock and queue
|
* release interrupt occurs. Attempt to acquire the global lock,
|
||||||
* the global lock thread for execution
|
* if successful, signal the thread waiting for the lock.
|
||||||
|
*
|
||||||
|
* NOTE: Assumes that the semaphore can be signaled from interrupt level. If
|
||||||
|
* this is not possible for some reason, a separate thread will have to be
|
||||||
|
* scheduled to do this.
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
|
@ -338,7 +312,13 @@ static u32 acpi_ev_global_lock_handler(void *context)
|
||||||
/* Got the lock, now wake all threads waiting for it */
|
/* Got the lock, now wake all threads waiting for it */
|
||||||
|
|
||||||
acpi_gbl_global_lock_acquired = TRUE;
|
acpi_gbl_global_lock_acquired = TRUE;
|
||||||
acpi_ev_global_lock_thread(context);
|
/* Send a unit to the semaphore */
|
||||||
|
|
||||||
|
if (ACPI_FAILURE(acpi_os_signal_semaphore(
|
||||||
|
acpi_gbl_global_lock_semaphore, 1))) {
|
||||||
|
ACPI_ERROR((AE_INFO,
|
||||||
|
"Could not signal Global Lock semaphore"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ACPI_INTERRUPT_HANDLED);
|
return (ACPI_INTERRUPT_HANDLED);
|
||||||
|
@ -480,7 +460,7 @@ acpi_status acpi_ev_release_global_lock(void)
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE(ev_release_global_lock);
|
ACPI_FUNCTION_TRACE(ev_release_global_lock);
|
||||||
|
|
||||||
/* Lock must be acquired */
|
/* Lock must be already acquired */
|
||||||
|
|
||||||
if (!acpi_gbl_global_lock_acquired) {
|
if (!acpi_gbl_global_lock_acquired) {
|
||||||
ACPI_WARNING((AE_INFO,
|
ACPI_WARNING((AE_INFO,
|
||||||
|
|
Loading…
Reference in a new issue