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

Commit de56d394 authored by Aviral Gupta's avatar Aviral Gupta Committed by Fred Oh
Browse files

msm: apr: unblock the apr calls post SSR if the modem is not loaded



After the SSR is triggered, following apr commands waits for
the modem to be loaded back and hence adds to the latency.
Fix by unblocking the apr call if the modem is not yet loaded.

CRs-Fixed: 663477
Change-Id: Id4228e5b24f80813b38ef7d0634eb05c016b856b
Signed-off-by: default avatarAviral Gupta <aviralg@codeaurora.org>
Signed-off-by: default avatarFred Oh <fred@codeaurora.org>
parent d2508db8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2015, 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
@@ -42,6 +42,7 @@ static struct apr_client client[APR_DEST_MAX][APR_CLIENT_MAX];

static wait_queue_head_t dsp_wait;
static wait_queue_head_t modem_wait;
static bool is_modem_up;
/* Subsystem restart: QDSP6 data, functions */
static struct workqueue_struct *apr_reset_workqueue;
static void apr_reset_deregister(struct work_struct *work);
@@ -350,6 +351,11 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
		pr_debug("%s: adsp Up\n", __func__);
	} else if (dest_id == APR_DEST_MODEM) {
		if (apr_get_modem_state() == APR_SUBSYS_DOWN) {
			if (is_modem_up) {
				pr_err("%s: modem shutdown due to SSR, ret",
					__func__);
				return NULL;
			}
			pr_debug("%s: Wait for modem to bootup\n", __func__);
			rc = apr_wait_for_device_up(APR_DEST_MODEM);
			if (rc == 0) {
@@ -756,6 +762,7 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
		if (apr_cmpxchg_modem_state(APR_SUBSYS_DOWN, APR_SUBSYS_UP) ==
						APR_SUBSYS_DOWN)
			wake_up(&modem_wait);
		is_modem_up = 1;
		pr_debug("M-Notify: Bootup Completed\n");
		break;
	default: