From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8DADC004C9 for ; Tue, 7 May 2019 08:44:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B74120B7C for ; Tue, 7 May 2019 08:44:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727150AbfEGIoq (ORCPT ); Tue, 7 May 2019 04:44:46 -0400 Received: from mo-csw1515.securemx.jp ([210.130.202.154]:52174 "EHLO mo-csw.securemx.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbfEGIop (ORCPT ); Tue, 7 May 2019 04:44:45 -0400 Received: by mo-csw.securemx.jp (mx-mo-csw1515) id x478iZX5032021; Tue, 7 May 2019 17:44:35 +0900 X-Iguazu-Qid: 34trdEsBYeq0nk84MX X-Iguazu-QSIG: v=2; s=0; t=1557218675; q=34trdEsBYeq0nk84MX; m=v4RU/QN3+eLWzfyeYzcWxU1KH8L8IUhV6/7htfKnXoQ= Received: from imx2.toshiba.co.jp (imx2.toshiba.co.jp [106.186.93.51]) by relay.securemx.jp (mx-mr1511) id x478iY1r031159; Tue, 7 May 2019 17:44:35 +0900 Received: from enc01.localdomain ([106.186.93.100]) by imx2.toshiba.co.jp with ESMTP id x478iYUR008098; Tue, 7 May 2019 17:44:34 +0900 (JST) Received: from hop001.toshiba.co.jp ([133.199.164.63]) by enc01.localdomain with ESMTP id x478iYkv030958; Tue, 7 May 2019 17:44:34 +0900 Date: Tue, 7 May 2019 17:44:30 +0900 From: Nobuhiro Iwamatsu To: Greg Kroah-Hartman Cc: , , Charles Keepax , Mark Brown Subject: Re: [PATCH 4.19 79/99] ASoC: wm_adsp: Correct handling of compressed streams that restart X-TSB-HOP: ON Message-ID: <20190507174430.2e981704@fdyp522> In-Reply-To: <20190506143101.240836871@linuxfoundation.org> References: <20190506143053.899356316@linuxfoundation.org> <20190506143101.240836871@linuxfoundation.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, May 06, 2019 at 04:32:52PM +0200, Greg Kroah-Hartman wrote: > 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 This commit has other problems, and it is fixed by commit 43d147be5738a9ed6cfb25c285ac50d6dd5793be. Please apply this commit too. commit 43d147be5738a9ed6cfb25c285ac50d6dd5793be Author: Charles Keepax Date: Tue Apr 2 13:49:14 2019 +0100 ASoC: wm_adsp: Check for buffer in trigger stop Trigger stop can be called in situations where trigger start failed and as such it can't be assumed the buffer is already attached to the compressed stream or a NULL pointer may be dereferenced. Fixes: 639e5eb3c7d6 ("ASoC: wm_adsp: Correct handling of compressed streams that restart") Signed-off-by: Charles Keepax Signed-off-by: Mark Brown Best regards, Nobuhiro