From a69ab56aa6b7cf153fa40cfb7de9e896a2b1a776 Mon Sep 17 00:00:00 2001 From: Sachin Ahuja Date: Tue, 14 Jul 2020 17:21:39 +0530 Subject: [PATCH] qcacld-3.0: Check for fw down before reinit complete Currently reinit resets the recovery in progress flag when reinit is successul. It may happen that after initial handshake with FW during reinit, FW crashes and send the FW down indication to the driver. Driver sets the recovery flag in FW down but it gets reset on the successul reinit. Now on subsequent shutdown, driver crashes as recovery flag is reset by last reinit. Check for fw down to reset the recovery flag on reinit completion CRs-Fixed: 2727205 Change-Id: I88effc1211de138351ef9b232645d0c616a9d5dc --- core/hdd/src/wlan_hdd_driver_ops.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 8229a4505d29..ab0a2e41e644 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -580,7 +580,17 @@ static int __hdd_soc_recovery_reinit(struct device *dev, } re_init_fail_cnt = 0; - cds_set_recovery_in_progress(false); + + /* + * In case of SSR within SSR we have seen the race + * where the reinit is successful and fw down is received + * which sets the recovery in progress. Now as reinit is + * successful we reset the recovery in progress here. + * So check if FW is down then don't reset the recovery + * in progress + */ + if (!qdf_is_fw_down()) + cds_set_recovery_in_progress(false); hdd_soc_load_unlock(dev); hdd_start_complete(0);