qcacmn: Create a list for events and force complete them during SSR

During an SSR/PDR any threads waiting on an event won't be purged
unless they are timed out. This increases the recovery time taken
by the host after an SSR/PDR. Before waiting on an event, put the
event in a list. During an SSR set all the events in the list and
return error to the threads.

Change-Id: Iac4790a88cde1665fba4c23924566b4b309a2b03
CRs-Fixed: 2045141
This commit is contained in:
Nachiket Kukade
2017-10-05 21:09:04 +05:30
committed by snandini
parent 0f6d121446
commit 110e03024d
3 changed files with 233 additions and 1 deletions

View File

@@ -38,6 +38,7 @@
#include <qdf_types.h>
#include <i_qdf_event.h>
#include <qdf_trace.h>
#include <qdf_list.h>
/* Preprocessor definitions and constants */
#ifdef __cplusplus
@@ -61,6 +62,55 @@ QDF_STATUS qdf_event_destroy(qdf_event_t *event);
QDF_STATUS qdf_wait_single_event(qdf_event_t *event,
uint32_t timeout);
/**
* qdf_complete_wait_events() - Sets all the events which are in the list.
*
* This function traverses the list of events and sets all of them. It
* sets the flag force_set as TRUE to indicate that these events have
* been forcefully set.
*
* Return: None
*/
void qdf_complete_wait_events(void);
/**
* qdf_wait_for_event_completion() - Waits for an event to be set.
* @event: Pointer to an event to wait on.
* @timeout: Timeout value (in milliseconds).
*
* This function adds the event in a list and waits on it until it
* is set or the timeout duration elapses. The purpose of waiting
* is considered complete only if the event is set and the flag
* force_set is FALSE, it returns success in this case. In other
* cases it returns appropriate error status.
*
* Return: QDF status
*/
QDF_STATUS qdf_wait_for_event_completion(qdf_event_t *event,
uint32_t timeout);
/**
* qdf_event_list_init() - Creates a list and spinlock for events.
*
* This function creates a list for maintaining events on which threads
* wait for completion. A spinlock is also created to protect related
* operations.
*
* Return: None
*/
void qdf_event_list_init(void);
/**
* qdf_event_list_destroy() - Destroys list and spinlock created for events.
*
* This function destroys the list and spinlock created for events on which
* threads wait for completion.
*
* Return: None
*/
void qdf_event_list_destroy(void);
/**
* qdf_exit_thread() - exit thread execution
* @status: QDF status