Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60ae254b authored by Sandeep Singh's avatar Sandeep Singh
Browse files

icnss: reject idle restart if wlan driver unregistered



This change is to reject idle restart if wlan driver
unregistered or unregistration is in progress. Kernel
holds rtnl lock before calling interface up and wlan driver
needs same rtnl lock to complete driver unregister. In
scenerio's where idle rstart and wlan driver remove gets
called back to back, there is a possibility of deadlock.
So, with this change reject idle restart if wlan driver
is getting unregistered.

Change-Id: If6733a039d896cbd682af6ebbdccacc11107c03d
Signed-off-by: default avatarSandeep Singh <sandsing@codeaurora.org>
parent 32735954
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1536,6 +1536,12 @@ static int icnss_driver_event_idle_restart(void *data)
	if (!penv->ops || !penv->ops->idle_restart)
		return 0;

	if (!test_bit(ICNSS_DRIVER_PROBED, &penv->state) ||
	    test_bit(ICNSS_DRIVER_UNLOADING, &penv->state)) {
		icnss_pr_err("Driver unloaded or unloading is in progress, so reject idle restart");
		return -EINVAL;
	}

	if (penv->is_ssr || test_bit(ICNSS_PDR, &penv->state) ||
	    test_bit(ICNSS_REJUVENATE, &penv->state)) {
		icnss_pr_err("SSR/PDR is already in-progress during idle restart callback\n");
@@ -2621,6 +2627,12 @@ int icnss_idle_restart(struct device *dev)
		return -EINVAL;
	}

	if (!test_bit(ICNSS_DRIVER_PROBED, &penv->state) ||
	    test_bit(ICNSS_DRIVER_UNLOADING, &penv->state)) {
		icnss_pr_err("Driver unloaded or unloading is in progress, so reject idle restart");
		return -EINVAL;
	}

	if (priv->is_ssr || test_bit(ICNSS_PDR, &priv->state) ||
	    test_bit(ICNSS_REJUVENATE, &penv->state)) {
		icnss_pr_err("SSR/PDR is already in-progress during idle restart\n");