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

Commit 95f99098 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: msm: q6dspv2: add check for APR handle before using APR



APR registration must be suceessful and a non-NULL handle must be
returned from APR driver before the servicec can be used for
communicating. Add a check in q6core driver to see if the APR
registration is done successfully before sending any APR packet.

CRs-fixed: 2022490
Change-Id: I88b09f3e1f58b0147b81ee734f87906c7ef09167
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent d744e18a
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, 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
@@ -511,6 +511,7 @@ bool q6core_is_adsp_ready(void)

	mutex_lock(&(q6core_lcl.cmd_lock));
	ocm_core_open();
	if (q6core_lcl.core_handle_q) {
		q6core_lcl.bus_bw_resp_received = 0;
		rc = apr_send_pkt(q6core_lcl.core_handle_q, (uint32_t *)&hdr);
		if (rc < 0) {
@@ -527,6 +528,7 @@ bool q6core_is_adsp_ready(void)
			rmb();
			ret = !!q6core_lcl.param;
		}
	}
bail:
	pr_debug("%s: leave, rc %d, adsp ready %d\n", __func__, rc, ret);
	mutex_unlock(&(q6core_lcl.cmd_lock));