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

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

Merge "icnss: Remove MSA0 permission only when modem is crashed"

parents f307fc8b fec2a06c
Loading
Loading
Loading
Loading
+22 −9
Original line number Diff line number Diff line
@@ -1060,7 +1060,7 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
	icnss_pr_vdbg("Modem-Notify: event %lu\n", code);

	if (code == SUBSYS_AFTER_SHUTDOWN &&
			notif->crashed != CRASH_STATUS_WDOG_BITE) {
	    notif->crashed == CRASH_STATUS_ERR_FATAL) {
		ret = icnss_assign_msa_perm_all(priv,
						ICNSS_MSA_PERM_HLOS_ALL);
		if (!ret) {
@@ -1078,8 +1078,17 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
	if (code != SUBSYS_BEFORE_SHUTDOWN)
		return NOTIFY_OK;

	if (test_bit(ICNSS_PDR_REGISTERED, &priv->state))
	if (test_bit(ICNSS_PDR_REGISTERED, &priv->state)) {
		set_bit(ICNSS_FW_DOWN, &priv->state);
		icnss_ignore_fw_timeout(true);

		fw_down_data.crashed = !!notif->crashed;
		if (test_bit(ICNSS_FW_READY, &priv->state))
			icnss_call_driver_uevent(priv,
						 ICNSS_UEVENT_FW_DOWN,
						 &fw_down_data);
		return NOTIFY_OK;
	}

	icnss_pr_info("Modem went down, state: 0x%lx, crashed: %d\n",
		      priv->state, notif->crashed);
@@ -1212,14 +1221,18 @@ static int icnss_service_notifier_notify(struct notifier_block *nb,
	icnss_pr_info("PD service down, pd_state: %d, state: 0x%lx: cause: %s\n",
		      *state, priv->state, icnss_pdr_cause[cause]);
event_post:
	if (!test_bit(ICNSS_FW_DOWN, &priv->state)) {
		set_bit(ICNSS_FW_DOWN, &priv->state);
		icnss_ignore_fw_timeout(true);
	clear_bit(ICNSS_HOST_TRIGGERED_PDR, &priv->state);

		fw_down_data.crashed = event_data->crashed;
		if (test_bit(ICNSS_FW_READY, &priv->state))
		icnss_call_driver_uevent(priv, ICNSS_UEVENT_FW_DOWN,
			icnss_call_driver_uevent(priv,
						 ICNSS_UEVENT_FW_DOWN,
						 &fw_down_data);
	}

	clear_bit(ICNSS_HOST_TRIGGERED_PDR, &priv->state);
	icnss_driver_event_post(ICNSS_DRIVER_EVENT_PD_SERVICE_DOWN,
				ICNSS_EVENT_SYNC, event_data);
done: