From b6f62dc497f957bd42dc1d1680c4a3f3d0bce7bf Mon Sep 17 00:00:00 2001 From: Naman Padhiar Date: Wed, 10 Jul 2019 20:04:19 +0530 Subject: [PATCH] icnss: Skip removing WLAN host driver during recovery Add the necessary checks to skip the invalid operation of driver remove during the recovery. Change-Id: I12d755b3b19eb4b8a7cc09e3893d778d88201cae Signed-off-by: Naman Padhiar --- drivers/soc/qcom/icnss.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/icnss.c b/drivers/soc/qcom/icnss.c index 0859fb6687568..ff45a87f37436 100644 --- a/drivers/soc/qcom/icnss.c +++ b/drivers/soc/qcom/icnss.c @@ -1417,7 +1417,10 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb, if (code == SUBSYS_BEFORE_SHUTDOWN && !notif->crashed && atomic_read(&priv->is_shutdown)) { atomic_set(&priv->is_shutdown, false); - icnss_call_driver_remove(priv); + if (!test_bit(ICNSS_PD_RESTART, &priv->state) && + !test_bit(ICNSS_SHUTDOWN_DONE, &priv->state)) { + icnss_call_driver_remove(priv); + } } if (code == SUBSYS_BEFORE_SHUTDOWN && !notif->crashed &&