Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2568807yba; Mon, 6 May 2019 08:07:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIRP1uB5Y4ALRkKXegv2WL2k45ZSu7qqY9RFKSeJhsc/zlFPF5VG87gT7JWjYzs+9/u53O X-Received: by 2002:aa7:8b88:: with SMTP id r8mr33521275pfd.174.1557155277120; Mon, 06 May 2019 08:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557155277; cv=none; d=google.com; s=arc-20160816; b=osiei11ctl987cAhovf6vkaAX6kacXgbBEJmF+kCCeuvdfkJhEW1UWv7bl+7qYvsnX qB442ydjBwnU/S4lVifZiNElymO4lS557vvkuORovmfOpBRevLUGf1nm1CWfeDIzSQN1 6EExG+zbfUhJA7nZv+Y5MmSw+tNgbT9WPbvLB9ix+/wNuwAL5+7ks9Vggquz1hHEXTyQ axLv3Q6oxo/NdzAffohuiznXk7FjzC9qYU0YchXI4I3aoe4sW7crj9sg5IfN248w5QE8 06K4fMUkj1+KWd5OjoVPwqIYJkoO0FOceH/fEFJbLZos71mBsz8D6RS/vJE5rWwlXzWP vbCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xm3nhe71TRK4bbLvr/RJYPCWVhC3ec6Lon18NEujmWo=; b=CtJk5WU8a6YC7/DnkYjLHSGVku7Zgl2sqjYe+PQT3tVZni+0F4uU8ZOeY+WAaVln8b 9KMiIFP1Sd/gvnKJapfBzqMi+kPDo83OgidUxZEegVQABQ5S3KvcFb3MKE9GVvKSvVlY 1iYyixSl7Ov5EAf2ucuCBmksfxGT31i7E3kt4NLz5PhzFP+Rt2SDFrYjEdTgBcLU89R3 pYTR/R14tDHgP/zTe6ixnCvCpeVBJ6lAC8Il3HR37f+1CTHIcOR+JqePojdU7CWZnWc1 MZx8hw93xGf9JhIs1O4IqBfiS1+YtW+401M7GZNe1pqiK3Cj7DoYAFXYFDNeFYzPD5xG D56A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HUJfbtgs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22si15347350pfp.17.2019.05.06.08.07.39; Mon, 06 May 2019 08:07:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HUJfbtgs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbfEFOho (ORCPT + 99 others); Mon, 6 May 2019 10:37:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:58508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727435AbfEFOhl (ORCPT ); Mon, 6 May 2019 10:37:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6CC1721479; Mon, 6 May 2019 14:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153460; bh=AAZ0+3CCjkRjj7MejXcIyv6OzHqSdH3G6jmknbtzS7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HUJfbtgsI7W6tPEXvRwhYt7xYroW7afOmlEEWDY6kif9fkicVQ4om79EFG+rZdQGl dB1XkRpBmtGFAVoNl4+UKtLH0UYkiFtNDQhQm8H3a0WzkbvUh5lmHgTGZ3G92y0ISa T2kRYPQNV2Siaip9j1WKzFYxhnGeQzWQlmudKgu0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown Subject: [PATCH 5.0 097/122] ASoC: wm_adsp: Correct handling of compressed streams that restart Date: Mon, 6 May 2019 16:32:35 +0200 Message-Id: <20190506143103.474087266@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Charles Keepax commit 639e5eb3c7d67e407f2a71fccd95323751398f6f upstream. Previously support was added to allow streams to be stopped and started again without the DSP being power cycled and this was done by clearing the buffer state in trigger start. Another supported use-case is using the DSP for a trigger event then opening the compressed stream later to receive the audio, unfortunately clearing the buffer state in trigger start destroys the data received from such a trigger. Correct this issue by moving the call to wm_adsp_buffer_clear to be in trigger stop instead. Fixes: 61fc060c40e6 ("ASoC: wm_adsp: Support streams which can start/stop with DSP active") Signed-off-by: Charles Keepax Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/wm_adsp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -3443,8 +3443,6 @@ int wm_adsp_compr_trigger(struct snd_com } } - wm_adsp_buffer_clear(compr->buf); - /* Trigger the IRQ at one fragment of data */ ret = wm_adsp_buffer_write(compr->buf, HOST_BUFFER_FIELD(high_water_mark), @@ -3456,6 +3454,7 @@ int wm_adsp_compr_trigger(struct snd_com } break; case SNDRV_PCM_TRIGGER_STOP: + wm_adsp_buffer_clear(compr->buf); break; default: ret = -EINVAL;