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

Commit c803632b authored by Rishabh Bhatnagar's avatar Rishabh Bhatnagar
Browse files

esoc: Add mdm error-fatal notifier hook



Add an error-fatal notifier hook to the list of other client hooks,
which would notify the clients about modem's unexpected reset or
error-fatal.

Change-Id: I185c4b05795b7ffb0768c240f25cc487f3d67b63
Signed-off-by: default avatarRishabh Bhatnagar <rishabhb@codeaurora.org>
parent 71e8e641
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ struct mdm_drv {

static void esoc_client_link_power_off(struct esoc_clink *esoc_clink,
							unsigned int flags);
static void esoc_client_link_mdm_crash(struct esoc_clink *esoc_clink);

static int esoc_msm_restart_handler(struct notifier_block *nb,
		unsigned long action, void *data)
@@ -161,10 +162,11 @@ static void mdm_ssr_fn(struct work_struct *work)
	struct mdm_drv *mdm_drv = container_of(work, struct mdm_drv, ssr_work);
	struct mdm_ctrl *mdm = get_esoc_clink_data(mdm_drv->esoc_clink);

	esoc_client_link_mdm_crash(mdm_drv->esoc_clink);

	mdm_wait_for_status_low(mdm, false);

	esoc_mdm_log("Starting SSR work\n");

	/*
	 * If restarting esoc fails, the SSR framework triggers a kernel panic
	 */
@@ -208,6 +210,21 @@ static void esoc_client_link_power_off(struct esoc_clink *esoc_clink,
	}
}

static void esoc_client_link_mdm_crash(struct esoc_clink *esoc_clink)
{
	int i;
	struct esoc_client_hook *client_hook;

	dev_dbg(&esoc_clink->dev, "Calling mdm_crash hooks\n");
	esoc_mdm_log("Calling mdm_crash hooks\n");

	for (i = 0; i < ESOC_MAX_HOOKS; i++) {
		client_hook = esoc_clink->client_hook[i];
		if (client_hook && client_hook->esoc_link_mdm_crash)
			client_hook->esoc_link_mdm_crash(client_hook->priv);
	}
}

static void mdm_crash_shutdown(const struct subsys_desc *mdm_subsys)
{
	struct esoc_clink *esoc_clink =
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ struct esoc_client_hook {
	int (*esoc_link_power_on)(void *priv, unsigned int flags);
	void (*esoc_link_power_off)(void *priv, unsigned int flags);
	u64 (*esoc_link_get_id)(void *priv);
	void (*esoc_link_mdm_crash)(void *priv);
};

/*