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

Commit 5f889843 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "icnss: Check for modem shutdown on server arrive"

parents 659173bb 8e724524
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -960,8 +960,16 @@ static int icnss_driver_event_server_arrive(void *data)
	int ret = 0;
	bool ignore_assert = false;

	if (!penv)
	if (!penv) {
		kfree(data);
		return -ENODEV;
	}

	if (test_bit(ICNSS_MODEM_SHUTDOWN, &penv->state)) {
		icnss_pr_dbg("WLFW server arrive: Modem is down");
		kfree(data);
		return -EINVAL;
	}

	set_bit(ICNSS_WLFW_EXISTS, &penv->state);
	clear_bit(ICNSS_FW_DOWN, &penv->state);
@@ -1579,14 +1587,20 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
			icnss_pr_err("Not able to Collect msa0 segment dump, Apps permissions not assigned %d\n",
				     ret);
		}
		clear_bit(ICNSS_MODEM_SHUTDOWN, &priv->state);
		return NOTIFY_OK;
	}

	if (code == SUBSYS_AFTER_SHUTDOWN)
		clear_bit(ICNSS_MODEM_SHUTDOWN, &priv->state);

	if (code != SUBSYS_BEFORE_SHUTDOWN)
		return NOTIFY_OK;

	priv->is_ssr = true;

	set_bit(ICNSS_MODEM_SHUTDOWN, &priv->state);

	if (notif->crashed)
		set_bit(ICNSS_MODEM_CRASHED, &priv->state);

@@ -3153,6 +3167,9 @@ static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv)
			continue;
		case ICNSS_MODEM_CRASHED:
			seq_puts(s, "MODEM CRASHED");
			continue;
		case ICNSS_MODEM_SHUTDOWN:
			seq_puts(s, "MODEM SHUTDOWN");
		}

		seq_printf(s, "UNKNOWN-%d", i);
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -168,6 +168,7 @@ enum icnss_driver_state {
	ICNSS_CLK_UP,
	ICNSS_ESOC_OFF,
	ICNSS_MODEM_CRASHED,
	ICNSS_MODEM_SHUTDOWN,
};

struct ce_irq_list {
+6 −0
Original line number Diff line number Diff line
@@ -1218,11 +1218,17 @@ int icnss_clear_server(struct icnss_priv *priv)
static int wlfw_new_server(struct qmi_handle *qmi,
			   struct qmi_service *service)
{
	struct icnss_priv *priv = container_of(qmi, struct icnss_priv, qmi);
	struct icnss_event_server_arrive_data *event_data;

	icnss_pr_dbg("WLFW server arrive: node %u port %u\n",
		     service->node, service->port);

	if (test_bit(ICNSS_MODEM_SHUTDOWN, &priv->state)) {
		icnss_pr_dbg("WLFW server arrive: Modem is down");
		return -EINVAL;
	}

	event_data = kzalloc(sizeof(*event_data), GFP_KERNEL);
	if (event_data == NULL)
		return -ENOMEM;