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

Commit 44442fe3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss: Prevent suspend during silent recovery"

parents f9b51e25 7cbec470
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -113,6 +113,8 @@ static struct cnss_data {
	struct cnss_platform_cap cap;
	struct msm_pcie_register_event event_reg;
	bool recovery_in_progress;
	struct wakeup_source ws;
	uint32_t recovery_count;
} *penv;


@@ -1070,15 +1072,21 @@ static void cnss_crash_shutdown(const struct subsys_desc *subsys)

void cnss_device_self_recovery(void)
{
	if (!penv)
		return;

	if (penv->recovery_in_progress) {
		pr_err("cnss: Recovery already in progress\n");
		return;
	}

	penv->recovery_count++;
	penv->recovery_in_progress = true;
	cnss_pm_wake_lock(&penv->ws);
	cnss_shutdown(NULL, false);
	usleep(WLAN_RECOVERY_DELAY);
	cnss_powerup(NULL);
	cnss_pm_wake_lock_release(&penv->ws);
	penv->recovery_in_progress = false;
}
EXPORT_SYMBOL(cnss_device_self_recovery);
@@ -1222,6 +1230,7 @@ static int cnss_probe(struct platform_device *pdev)
			goto err_bus_reg;
		}
	}
	cnss_pm_wake_lock_init(&penv->ws, "cnss_wlock");

#ifdef CONFIG_CNSS_MAC_BUG
	/* 0-4K memory is reserved for QCA6174 to address a MAC HW bug.
@@ -1270,6 +1279,8 @@ static int cnss_remove(struct platform_device *pdev)
	struct cnss_wlan_vreg_info *vreg_info = &penv->vreg_info;
	struct cnss_wlan_gpio_info *gpio_info = &penv->gpio_info;

	cnss_pm_wake_lock_destroy(&penv->ws);

	if (penv->bus_client)
		msm_bus_scale_unregister_client(penv->bus_client);