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

Commit 6ec83f80 authored by Anurag Chouhan's avatar Anurag Chouhan Committed by Sameer Thalappil
Browse files

icnss: Delay Shutdown/reinit sequence for all cases



PD down notifications reaches APPS only after WLAN HW is
reset. Because of this, there is a small window of time
in which APPS may try to access WLAN HW Copy Engine
registers and get into exception. To avoid this, FW has
implemented 2 stage reset sequence in which first HW is
halted rather than reset and then when FW PD is started
again, reset sequence is executed. Because of the 2
stage reset sequence, WLAN shutdown call back also needs
to be delayed as there may be some buffers submitted to
hardware and if they are freed then again HW exception
may be seen. Delay the shutdown call back till FW ready
happens at this time HW should be reset and clean state.

CRs-fixed: 2056443
Change-Id: Ie587f98d574f7c0a49a8480449fed44c1f4ab816
Signed-off-by: default avatarAnurag Chouhan <achouhan@codeaurora.org>
parent 407110cf
Loading
Loading
Loading
Loading
+2 −21
Original line number Diff line number Diff line
@@ -767,10 +767,7 @@ static int icnss_pd_restart_complete(struct icnss_priv *priv)

	icnss_pm_relax(priv);

	if (test_bit(ICNSS_WDOG_BITE, &priv->state)) {
	icnss_call_driver_shutdown(priv);
		clear_bit(ICNSS_WDOG_BITE, &priv->state);
	}

	clear_bit(ICNSS_PD_RESTART, &priv->state);

@@ -920,8 +917,7 @@ static int icnss_call_driver_remove(struct icnss_priv *priv)
static int icnss_fw_crashed(struct icnss_priv *priv,
			    struct icnss_event_pd_service_down_data *event_data)
{
	icnss_pr_dbg("FW crashed, state: 0x%lx, wdog_bite: %d\n",
		priv->state, event_data->wdog_bite);
	icnss_pr_dbg("FW crashed, state: 0x%lx\n", priv->state);

	set_bit(ICNSS_PD_RESTART, &priv->state);
	clear_bit(ICNSS_FW_READY, &priv->state);
@@ -931,17 +927,9 @@ static int icnss_fw_crashed(struct icnss_priv *priv,
	if (test_bit(ICNSS_DRIVER_PROBED, &priv->state))
		icnss_call_driver_uevent(priv, ICNSS_UEVENT_FW_CRASHED, NULL);

	if (event_data->wdog_bite) {
		set_bit(ICNSS_WDOG_BITE, &priv->state);
		goto out;
	}

	icnss_call_driver_shutdown(priv);

	if (event_data->fw_rejuvenate)
		wlfw_rejuvenate_ack_send_sync_msg(priv);

out:
	return 0;
}

@@ -1106,9 +1094,6 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,

	event_data->crashed = notif->crashed;

	if (notif->crashed == CRASH_STATUS_WDOG_BITE)
		event_data->wdog_bite = true;

	fw_down_data.crashed = !!notif->crashed;
	icnss_call_driver_uevent(priv, ICNSS_UEVENT_FW_DOWN, &fw_down_data);

@@ -1198,7 +1183,6 @@ static int icnss_service_notifier_notify(struct notifier_block *nb,

	switch (*state) {
	case ROOT_PD_WDOG_BITE:
		event_data->wdog_bite = true;
		priv->stats.recovery.root_pd_crash++;
		break;
	case ROOT_PD_SHUTDOWN:
@@ -2352,9 +2336,6 @@ static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv)
		case ICNSS_WLFW_EXISTS:
			seq_puts(s, "WLAN FW EXISTS");
			continue;
		case ICNSS_WDOG_BITE:
			seq_puts(s, "MODEM WDOG BITE");
			continue;
		case ICNSS_SHUTDOWN_DONE:
			seq_puts(s, "SHUTDOWN DONE");
			continue;
+0 −2
Original line number Diff line number Diff line
@@ -118,7 +118,6 @@ enum icnss_driver_event_type {
struct icnss_event_pd_service_down_data {
	bool crashed;
	bool fw_rejuvenate;
	bool wdog_bite;
};

struct icnss_driver_event {
@@ -143,7 +142,6 @@ enum icnss_driver_state {
	ICNSS_PD_RESTART,
	ICNSS_MSA0_ASSIGNED,
	ICNSS_WLFW_EXISTS,
	ICNSS_WDOG_BITE,
	ICNSS_SHUTDOWN_DONE,
	ICNSS_HOST_TRIGGERED_PDR,
};