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

Commit 4a06d597 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: return ENETRESET error if apr is down"

parents 56990c4f 2c038c57
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
/* Copyright (c) 2010-2014, 2016 The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2014, 2016, 2018 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
@@ -284,17 +284,17 @@ int apr_send_pkt(void *handle, uint32_t *buf)
		return -EINVAL;
	}
	if (svc->need_reset) {
		pr_err("apr: send_pkt service need reset\n");
		pr_err_ratelimited("apr: send_pkt service need reset\n");
		return -ENETRESET;
	}

	if ((svc->dest_id == APR_DEST_QDSP6) &&
	    (apr_get_q6_state() != APR_SUBSYS_LOADED)) {
		pr_err("%s: Still dsp is not Up\n", __func__);
		pr_err_ratelimited("%s: Still dsp is not Up\n", __func__);
		return -ENETRESET;
	} else if ((svc->dest_id == APR_DEST_MODEM) &&
		   (apr_get_modem_state() == APR_SUBSYS_DOWN)) {
		pr_err("apr: Still Modem is not Up\n");
		pr_err_ratelimited("apr: Still Modem is not Up\n");
		return -ENETRESET;
	}

@@ -304,7 +304,7 @@ int apr_send_pkt(void *handle, uint32_t *buf)
	clnt = &client[dest_id][client_id];

	if (!client[dest_id][client_id].handle) {
		pr_err("APR: Still service is not yet opened\n");
		pr_err_ratelimited("APR: Still service is not yet opened\n");
		spin_unlock_irqrestore(&svc->w_lock, flags);
		return -EINVAL;
	}
@@ -398,14 +398,14 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,

	if (dest_id == APR_DEST_QDSP6) {
		if (apr_get_q6_state() != APR_SUBSYS_LOADED) {
			pr_err("%s: adsp not up\n", __func__);
			pr_err_ratelimited("%s: adsp not up\n", __func__);
			return NULL;
		}
		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",
				pr_err_ratelimited("%s: modem shutdown due to SSR, ret",
					__func__);
				return NULL;
			}
@@ -420,7 +420,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
	}

	if (apr_get_svc(svc_name, domain_id, &client_id, &svc_idx, &svc_id)) {
		pr_err("%s: apr_get_svc failed\n", __func__);
		pr_err_ratelimited("%s: apr_get_svc failed\n", __func__);
		goto done;
	}

@@ -431,7 +431,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
				APR_DL_SMD, apr_cb_func, NULL);
		if (!clnt->handle) {
			svc = NULL;
			pr_err("APR: Unable to open handle\n");
			pr_err_ratelimited("APR: Unable to open handle\n");
			mutex_unlock(&clnt->m_lock);
			goto done;
		}
@@ -442,7 +442,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
	clnt->id = client_id;
	if (svc->need_reset) {
		mutex_unlock(&svc->m_lock);
		pr_err("APR: Service needs reset\n");
		pr_err_ratelimited("APR: Service needs reset\n");
		goto done;
	}
	svc->id = svc_id;
+1 −1
Original line number Diff line number Diff line
@@ -1653,7 +1653,7 @@ static int adm_memory_map_regions(phys_addr_t *buf_add, uint32_t mempool_id,
						0xFFFFFFFF, &this_adm);
		if (this_adm.apr == NULL) {
			pr_err("%s: Unable to register ADM\n", __func__);
			ret = -ENODEV;
			ret = -ENETRESET;
			return ret;
		}
		rtac_set_adm_handle(this_adm.apr);
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 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
@@ -627,7 +627,7 @@ int afe_q6_interface_prepare(void)
			0xFFFFFFFF, &this_afe);
		if (this_afe.apr == NULL) {
			pr_err("%s: Unable to register AFE\n", __func__);
			ret = -ENODEV;
			ret = -ENETRESET;
		}
		rtac_set_afe_handle(this_afe.apr);
	}
+2 −2
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ void ocm_core_open(void)
					aprv2_core_fn_q, 0xFFFFFFFF, NULL);
	pr_debug("%s: Open_q %pK\n", __func__, q6core_lcl.core_handle_q);
	if (q6core_lcl.core_handle_q == NULL)
		pr_err("%s: Unable to register CORE\n", __func__);
		pr_err_ratelimited("%s: Unable to register CORE\n", __func__);
}

struct cal_block_data *cal_utils_get_cal_block_by_key(
@@ -532,7 +532,7 @@ bool q6core_is_adsp_ready(void)
	q6core_lcl.bus_bw_resp_received = 0;
	rc = apr_send_pkt(q6core_lcl.core_handle_q, (uint32_t *)&hdr);
	if (rc < 0) {
		pr_err("%s: Get ADSP state APR packet send event %d\n",
		pr_err_ratelimited("%s: Get ADSP state APR packet send event %d\n",
			__func__, rc);
		goto bail;
	}