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

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

Merge "asoc: dsp: ipc: Reduce wait timeout to 1 second"

parents a5443b30 0fcf2af3
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 */


@@ -40,6 +40,7 @@

#define DRV_NAME "msm-compress-q6-v2"

#define TIMEOUT_MS			1000
#define DSP_PP_BUFFERING_IN_MSEC	25
#define PARTIAL_DRAIN_ACK_EARLY_BY_MSEC	150
#define MP3_OUTPUT_FRAME_SZ		1152
@@ -1829,7 +1830,8 @@ static int msm_compr_playback_free(struct snd_compr_stream *cstream)
	}
	if (atomic_read(&prtd->eos)) {
		ret = wait_event_timeout(prtd->eos_wait,
					 prtd->eos_ack, 5 * HZ);
					prtd->eos_ack,
					msecs_to_jiffies(TIMEOUT_MS));
		if (!ret)
			pr_err("%s: CMD_EOS failed\n", __func__);
	}
@@ -1837,7 +1839,8 @@ static int msm_compr_playback_free(struct snd_compr_stream *cstream)
		prtd->cmd_ack = 0;
		atomic_set(&prtd->wait_on_close, 1);
		ret = wait_event_timeout(prtd->close_wait,
					prtd->cmd_ack, 5 * HZ);
					prtd->cmd_ack,
					msecs_to_jiffies(TIMEOUT_MS));
		if (!ret)
			pr_err("%s: CMD_CLOSE failed\n", __func__);
	}
+4 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 */


@@ -26,6 +26,7 @@

#define DRV_NAME "msm-pcm-afe-v2"

#define TIMEOUT_MS	1000
#define MIN_PLAYBACK_PERIOD_SIZE (128 * 2)
#define MAX_PLAYBACK_PERIOD_SIZE (128 * 2 * 2 * 6)
#define MIN_PLAYBACK_NUM_PERIODS (4)
@@ -571,7 +572,8 @@ static int msm_afe_capture_copy(struct snd_pcm_substream *substream,

		prtd->dsp_cnt++;
		ret = wait_event_timeout(prtd->read_wait,
				atomic_read(&prtd->rec_bytes_avail), 5 * HZ);
				atomic_read(&prtd->rec_bytes_avail),
				msecs_to_jiffies(TIMEOUT_MS));
		if (ret < 0) {
			pr_err("%s: wait_event_timeout failed\n", __func__);

+6 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 */


@@ -35,6 +35,7 @@
#include "msm-qti-pp-config.h"

#define DRV_NAME "msm-pcm-q6-v2"
#define TIMEOUT_MS	1000

enum stream_state {
	IDLE = 0,
@@ -805,7 +806,8 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a,
		}

		ret = wait_event_timeout(the_locks.write_wait,
				(atomic_read(&prtd->out_count)), 5 * HZ);
				(atomic_read(&prtd->out_count)),
				msecs_to_jiffies(TIMEOUT_MS));
		if (!ret) {
			pr_err("%s: wait_event_timeout failed\n", __func__);
			ret = -ETIMEDOUT;
@@ -966,7 +968,8 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream,
		return -ENETRESET;
	}
	ret = wait_event_timeout(the_locks.read_wait,
			(atomic_read(&prtd->in_count)), 5 * HZ);
			(atomic_read(&prtd->in_count)),
			msecs_to_jiffies(TIMEOUT_MS));
	if (!ret) {
		pr_debug("%s: wait_event_timeout failed\n", __func__);
		goto fail;
+2 −3
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
#include <linux/jiffies.h>
#include <linux/uaccess.h>
#include <linux/atomic.h>
#include <linux/wait.h>
#include <sound/asound.h>
#include <dsp/msm-dts-srs-tm-config.h>
#include <dsp/apr_audio-v2.h>
@@ -1852,7 +1851,7 @@ static int adm_memory_map_regions(phys_addr_t *buf_add, uint32_t mempool_id,

	ret = wait_event_timeout(this_adm.adm_wait,
				 atomic_read(&this_adm.adm_stat) >= 0,
				 5 * HZ);
				 msecs_to_jiffies(TIMEOUT_MS));
	if (!ret) {
		pr_err("%s: timeout. waited for memory_map\n", __func__);
		ret = -EINVAL;
@@ -1902,7 +1901,7 @@ static int adm_memory_unmap_regions(void)

	ret = wait_event_timeout(this_adm.adm_wait,
				 atomic_read(&this_adm.adm_stat) >= 0,
				 5 * HZ);
				 msecs_to_jiffies(TIMEOUT_MS));
	if (!ret) {
		pr_err("%s: timeout. waited for memory_unmap\n",
		       __func__);
+130 −66

File changed.

Preview size limit exceeded, changes collapsed.

Loading