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

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

Merge "audio: qdsp6v2: add retry when EAGAIN for habmm_socket_recv"

parents b98369d6 a5cf01f3
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -529,25 +529,23 @@ static int apr_vm_cb_thread(void *data)
{
	uint32_t apr_rx_buf_len;
	struct aprv2_vm_ack_rx_pkt_available_t apr_ack;
	unsigned long delay = jiffies + (HZ / 2);
	int status = 0;
	int ret = 0;

	while (1) {
		do {
			apr_rx_buf_len = sizeof(apr_rx_buf);
			ret = habmm_socket_recv(hab_handle_rx,
					(void *)&apr_rx_buf,
					&apr_rx_buf_len,
					0xFFFFFFFF,
					0);
		} while (time_before(jiffies, delay) && (ret == -EAGAIN) &&
			(apr_rx_buf_len == 0));
		if (ret) {
			pr_err("%s: habmm_socket_recv failed %d\n",
					__func__, ret);
			/*
			 * TODO: depends on the HAB error code,
			 *       may need to implement
			 *       a retry mechanism.
			 * break if recv failed ?
			 */
			break;
		}

+20 −12
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ static int msm_audio_ion_smmu_map(struct ion_client *client,
	struct msm_audio_smmu_vm_map_cmd_rsp cmd_rsp;
	struct msm_audio_smmu_map_data *map_data = NULL;
	struct msm_audio_smmu_vm_map_cmd smmu_map_cmd;
	unsigned long delay = jiffies + (HZ / 2);

	rc = ion_handle_get_size(client, handle, len);
	if (rc) {
@@ -122,12 +123,15 @@ static int msm_audio_ion_smmu_map(struct ion_client *client,
		goto err;
	}

	do {
		cmd_rsp_size = sizeof(cmd_rsp);
		rc = habmm_socket_recv(msm_audio_ion_hab_handle,
			(void *)&cmd_rsp,
			&cmd_rsp_size,
			0xFFFFFFFF,
			0);
	} while (time_before(jiffies, delay) && (rc == -EAGAIN) &&
			(cmd_rsp_size == 0));
	if (rc) {
		pr_err("%s: habmm_socket_recv failed %d\n",
			__func__, rc);
@@ -181,6 +185,7 @@ static int msm_audio_ion_smmu_unmap(struct ion_client *client,
	struct msm_audio_smmu_vm_unmap_cmd_rsp cmd_rsp;
	struct msm_audio_smmu_map_data *map_data, *next;
	struct msm_audio_smmu_vm_unmap_cmd smmu_unmap_cmd;
	unsigned long delay = jiffies + (HZ / 2);

	/*
	 * Though list_for_each_entry_safe is delete safe, lock
@@ -205,12 +210,15 @@ static int msm_audio_ion_smmu_unmap(struct ion_client *client,
				goto err;
			}

			do {
				cmd_rsp_size = sizeof(cmd_rsp);
				rc = habmm_socket_recv(msm_audio_ion_hab_handle,
					(void *)&cmd_rsp,
					&cmd_rsp_size,
					0xFFFFFFFF,
					0);
			} while (time_before(jiffies, delay) &&
					(rc == -EAGAIN) && (cmd_rsp_size == 0));
			if (rc) {
				pr_err("%s: habmm_socket_recv failed %d\n",
					__func__, rc);