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: Rishabh Bhatnagar <rishabhb@codeaurora.org>
This commit is contained in:
Rishabh Bhatnagar 2019-05-29 16:36:55 -07:00
parent 71e8e64193
commit c803632b84
2 changed files with 19 additions and 1 deletions

View file

@ -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 =

View file

@ -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);
};
/*