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

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

Merge "ASoC: msm: qdsp6v2: Fix compress offload playback failures during SSR"

parents a13cbeba 34503ab2
Loading
Loading
Loading
Loading
+11 −3
Original line number Original line Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -588,8 +588,12 @@ static void compr_event_handler(uint32_t opcode,
		pr_err("%s: Received reset events CB, move to error state",
		pr_err("%s: Received reset events CB, move to error state",
			__func__);
			__func__);
		spin_lock_irqsave(&prtd->lock, flags);
		spin_lock_irqsave(&prtd->lock, flags);
		snd_compr_fragment_elapsed(cstream);
		/*
		 * Since ADSP is down, let this driver pretend that it copied
		 * all the bytes received, so that next write will be triggered
		 */
		prtd->copied_total = prtd->bytes_received;
		prtd->copied_total = prtd->bytes_received;
		snd_compr_fragment_elapsed(cstream);
		atomic_set(&prtd->error, 1);
		atomic_set(&prtd->error, 1);
		wake_up(&prtd->drain_wait);
		wake_up(&prtd->drain_wait);
		if (atomic_cmpxchg(&prtd->eos, 1, 0)) {
		if (atomic_cmpxchg(&prtd->eos, 1, 0)) {
@@ -1891,8 +1895,12 @@ static int msm_compr_pointer(struct snd_compr_stream *cstream,
	tstamp.copied_total = prtd->copied_total;
	tstamp.copied_total = prtd->copied_total;
	first_buffer = prtd->first_buffer;
	first_buffer = prtd->first_buffer;
	if (atomic_read(&prtd->error)) {
	if (atomic_read(&prtd->error)) {
		pr_err("%s Got RESET EVENTS notification, return error",
		pr_err("%s Got RESET EVENTS notification, return error\n",
			__func__);
			__func__);
		if (cstream->direction == SND_COMPRESS_PLAYBACK)
			runtime->total_bytes_transferred = tstamp.copied_total;
		else
			runtime->total_bytes_available = tstamp.copied_total;
		tstamp.pcm_io_frames = 0;
		tstamp.pcm_io_frames = 0;
		memcpy(arg, &tstamp, sizeof(struct snd_compr_tstamp));
		memcpy(arg, &tstamp, sizeof(struct snd_compr_tstamp));
		spin_unlock_irqrestore(&prtd->lock, flags);
		spin_unlock_irqrestore(&prtd->lock, flags);