cnss2: Assert for recovery if there is already a recovery going on

Assert right away if driver has detected one recovery is already in
progress when tries to schedule another recovery. Also when schedule
recovery, there is no need to update status to WLAN driver if it is
already done when RDDM notification event arrives.

Change-Id: I067e51d8d4a8d7ffd600ab0ec41f54785f001f9a
Signed-off-by: Yue Ma <yuem@codeaurora.org>
This commit is contained in:
Yue Ma 2020-05-14 14:31:02 -07:00 • committed by Gerrit - the friendly Code Review server
commit 7f0d8b7957

View file

@ -1062,6 +1062,7 @@ static int cnss_driver_recovery_hdlr(struct cnss_plat_data *plat_priv,
if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) {
cnss_pr_err("Recovery is already in progress\n");
CNSS_ASSERT(0);
ret = -EINVAL;
goto out;
}
@ -1114,7 +1115,8 @@ void cnss_schedule_recovery(struct device *dev,
struct cnss_recovery_data *data;
int gfp = GFP_KERNEL;
cnss_bus_update_status(plat_priv, CNSS_FW_DOWN);
if (!test_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state))
cnss_bus_update_status(plat_priv, CNSS_FW_DOWN);
if (test_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state) ||
test_bit(CNSS_DRIVER_IDLE_SHUTDOWN, &plat_priv->driver_state)) {