qcacmn: Honor Umac reset trigger atomically
Make sure the Umac reset state is updated when the trigger is received only after checking Umac reset in progress flag. Change-Id: I2c6ac68bee5b69b1f083a109646cb6bf61d8cdd6 CRs-Fixed: 3487388
This commit is contained in:

committed by
Madan Koyyalamudi

parent
fffa314bff
commit
e8bf99b94f
@@ -1128,19 +1128,27 @@ void dp_umac_reset_complete_umac_recovery(struct dp_soc *soc)
|
|||||||
/**
|
/**
|
||||||
* dp_umac_reset_initiate_umac_recovery() - Initiate Umac reset session
|
* dp_umac_reset_initiate_umac_recovery() - Initiate Umac reset session
|
||||||
* @soc: dp soc handle
|
* @soc: dp soc handle
|
||||||
|
* @umac_reset_ctx: Umac reset context
|
||||||
|
* @rx_event: Rx event received
|
||||||
* @is_target_recovery: Flag to indicate if it is triggered for target recovery
|
* @is_target_recovery: Flag to indicate if it is triggered for target recovery
|
||||||
*
|
*
|
||||||
* Return: status
|
* Return: status
|
||||||
*/
|
*/
|
||||||
QDF_STATUS dp_umac_reset_initiate_umac_recovery(struct dp_soc *soc,
|
QDF_STATUS dp_umac_reset_initiate_umac_recovery(struct dp_soc *soc,
|
||||||
bool is_target_recovery)
|
struct dp_soc_umac_reset_ctx *umac_reset_ctx,
|
||||||
|
enum umac_reset_rx_event rx_event,
|
||||||
|
bool is_target_recovery)
|
||||||
{
|
{
|
||||||
struct dp_soc_be *be_soc = dp_get_be_soc_from_dp_soc(soc);
|
struct dp_soc_be *be_soc = dp_get_be_soc_from_dp_soc(soc);
|
||||||
struct dp_mlo_ctxt *mlo_ctx = be_soc->ml_ctxt;
|
struct dp_mlo_ctxt *mlo_ctx = be_soc->ml_ctxt;
|
||||||
struct dp_soc_mlo_umac_reset_ctx *grp_umac_reset_ctx;
|
struct dp_soc_mlo_umac_reset_ctx *grp_umac_reset_ctx;
|
||||||
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
|
|
||||||
if (!mlo_ctx)
|
if (!mlo_ctx)
|
||||||
return QDF_STATUS_SUCCESS;
|
return dp_umac_reset_validate_n_update_state_machine_on_rx(
|
||||||
|
umac_reset_ctx, rx_event,
|
||||||
|
UMAC_RESET_STATE_WAIT_FOR_TRIGGER,
|
||||||
|
UMAC_RESET_STATE_DO_TRIGGER_RECEIVED);
|
||||||
|
|
||||||
grp_umac_reset_ctx = &mlo_ctx->grp_umac_reset_ctx;
|
grp_umac_reset_ctx = &mlo_ctx->grp_umac_reset_ctx;
|
||||||
qdf_spin_lock_bh(&grp_umac_reset_ctx->grp_ctx_lock);
|
qdf_spin_lock_bh(&grp_umac_reset_ctx->grp_ctx_lock);
|
||||||
@@ -1150,6 +1158,16 @@ QDF_STATUS dp_umac_reset_initiate_umac_recovery(struct dp_soc *soc,
|
|||||||
return QDF_STATUS_E_INVAL;
|
return QDF_STATUS_E_INVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status = dp_umac_reset_validate_n_update_state_machine_on_rx(
|
||||||
|
umac_reset_ctx, rx_event,
|
||||||
|
UMAC_RESET_STATE_WAIT_FOR_TRIGGER,
|
||||||
|
UMAC_RESET_STATE_DO_TRIGGER_RECEIVED);
|
||||||
|
|
||||||
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
|
qdf_spin_unlock_bh(&grp_umac_reset_ctx->grp_ctx_lock);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
grp_umac_reset_ctx->umac_reset_in_progress = true;
|
grp_umac_reset_ctx->umac_reset_in_progress = true;
|
||||||
grp_umac_reset_ctx->is_target_recovery = is_target_recovery;
|
grp_umac_reset_ctx->is_target_recovery = is_target_recovery;
|
||||||
|
|
||||||
|
@@ -2707,12 +2707,16 @@ void dp_umac_reset_complete_umac_recovery(struct dp_soc *soc);
|
|||||||
/**
|
/**
|
||||||
* dp_umac_reset_initiate_umac_recovery() - Initiate Umac reset session
|
* dp_umac_reset_initiate_umac_recovery() - Initiate Umac reset session
|
||||||
* @soc: dp soc handle
|
* @soc: dp soc handle
|
||||||
|
* @umac_reset_ctx: Umac reset context
|
||||||
|
* @rx_event: Rx event received
|
||||||
* @is_target_recovery: Flag to indicate if it is triggered for target recovery
|
* @is_target_recovery: Flag to indicate if it is triggered for target recovery
|
||||||
*
|
*
|
||||||
* Return: status
|
* Return: status
|
||||||
*/
|
*/
|
||||||
QDF_STATUS dp_umac_reset_initiate_umac_recovery(struct dp_soc *soc,
|
QDF_STATUS dp_umac_reset_initiate_umac_recovery(struct dp_soc *soc,
|
||||||
bool is_target_recovery);
|
struct dp_soc_umac_reset_ctx *umac_reset_ctx,
|
||||||
|
enum umac_reset_rx_event rx_event,
|
||||||
|
bool is_target_recovery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_umac_reset_handle_action_cb() - Function to call action callback
|
* dp_umac_reset_handle_action_cb() - Function to call action callback
|
||||||
|
@@ -277,7 +277,7 @@ dp_umac_reset_get_rx_event(struct dp_soc_umac_reset_ctx *umac_reset_ctx)
|
|||||||
*
|
*
|
||||||
* Return: QDF_STATUS of operation
|
* Return: QDF_STATUS of operation
|
||||||
*/
|
*/
|
||||||
static QDF_STATUS
|
QDF_STATUS
|
||||||
dp_umac_reset_validate_n_update_state_machine_on_rx(
|
dp_umac_reset_validate_n_update_state_machine_on_rx(
|
||||||
struct dp_soc_umac_reset_ctx *umac_reset_ctx,
|
struct dp_soc_umac_reset_ctx *umac_reset_ctx,
|
||||||
enum umac_reset_rx_event rx_event,
|
enum umac_reset_rx_event rx_event,
|
||||||
@@ -325,14 +325,21 @@ bool dp_check_umac_reset_in_progress(struct dp_soc *soc)
|
|||||||
/**
|
/**
|
||||||
* dp_umac_reset_initiate_umac_recovery() - Initiate Umac reset session
|
* dp_umac_reset_initiate_umac_recovery() - Initiate Umac reset session
|
||||||
* @soc: dp soc handle
|
* @soc: dp soc handle
|
||||||
|
* @umac_reset_ctx: Umac reset context
|
||||||
|
* @rx_event: Rx event received
|
||||||
* @is_target_recovery: Flag to indicate if it is triggered for target recovery
|
* @is_target_recovery: Flag to indicate if it is triggered for target recovery
|
||||||
*
|
*
|
||||||
* Return: status
|
* Return: status
|
||||||
*/
|
*/
|
||||||
static QDF_STATUS dp_umac_reset_initiate_umac_recovery(struct dp_soc *soc,
|
static QDF_STATUS dp_umac_reset_initiate_umac_recovery(struct dp_soc *soc,
|
||||||
bool is_target_recovery)
|
struct dp_soc_umac_reset_ctx *umac_reset_ctx,
|
||||||
|
enum umac_reset_rx_event rx_event,
|
||||||
|
bool is_target_recovery)
|
||||||
{
|
{
|
||||||
return QDF_STATUS_SUCCESS;
|
return dp_umac_reset_validate_n_update_state_machine_on_rx(
|
||||||
|
umac_reset_ctx, rx_event,
|
||||||
|
UMAC_RESET_STATE_WAIT_FOR_TRIGGER,
|
||||||
|
UMAC_RESET_STATE_DO_TRIGGER_RECEIVED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -472,23 +479,16 @@ static int dp_umac_reset_rx_event_handler(void *dp_ctx)
|
|||||||
target_recovery = true;
|
target_recovery = true;
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case UMAC_RESET_RX_EVENT_DO_TRIGGER_RECOVERY:
|
case UMAC_RESET_RX_EVENT_DO_TRIGGER_RECOVERY:
|
||||||
status = dp_umac_reset_validate_n_update_state_machine_on_rx(
|
|
||||||
umac_reset_ctx, rx_event,
|
|
||||||
UMAC_RESET_STATE_WAIT_FOR_TRIGGER,
|
|
||||||
UMAC_RESET_STATE_DO_TRIGGER_RECEIVED);
|
|
||||||
|
|
||||||
if (status == QDF_STATUS_E_FAILURE)
|
|
||||||
goto exit;
|
|
||||||
|
|
||||||
umac_reset_ctx->ts.trigger_start =
|
|
||||||
qdf_get_log_timestamp_usecs();
|
|
||||||
|
|
||||||
status =
|
status =
|
||||||
dp_umac_reset_initiate_umac_recovery(soc, target_recovery);
|
dp_umac_reset_initiate_umac_recovery(soc, umac_reset_ctx,
|
||||||
|
rx_event, target_recovery);
|
||||||
|
|
||||||
if (status != QDF_STATUS_SUCCESS)
|
if (status != QDF_STATUS_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
umac_reset_ctx->ts.trigger_start =
|
||||||
|
qdf_get_log_timestamp_usecs();
|
||||||
|
|
||||||
action = UMAC_RESET_ACTION_DO_TRIGGER_RECOVERY;
|
action = UMAC_RESET_ACTION_DO_TRIGGER_RECOVERY;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@@ -310,6 +310,23 @@ bool dp_check_umac_reset_in_progress(struct dp_soc *soc);
|
|||||||
* Return: QDF_STATUS
|
* Return: QDF_STATUS
|
||||||
*/
|
*/
|
||||||
QDF_STATUS dp_umac_reset_stats_print(struct dp_soc *soc);
|
QDF_STATUS dp_umac_reset_stats_print(struct dp_soc *soc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_umac_reset_validate_n_update_state_machine_on_rx() - Validate the state
|
||||||
|
* machine for a given rx event and update the state machine
|
||||||
|
* @umac_reset_ctx: UMAC reset context
|
||||||
|
* @rx_event: Rx event
|
||||||
|
* @current_exp_state: Expected state
|
||||||
|
* @next_state: The state to which the state machine needs to be updated
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS of operation
|
||||||
|
*/
|
||||||
|
QDF_STATUS
|
||||||
|
dp_umac_reset_validate_n_update_state_machine_on_rx(
|
||||||
|
struct dp_soc_umac_reset_ctx *umac_reset_ctx,
|
||||||
|
enum umac_reset_rx_event rx_event,
|
||||||
|
enum umac_reset_state current_exp_state,
|
||||||
|
enum umac_reset_state next_state);
|
||||||
#else
|
#else
|
||||||
static inline bool dp_check_umac_reset_in_progress(struct dp_soc *soc)
|
static inline bool dp_check_umac_reset_in_progress(struct dp_soc *soc)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user