From patchwork Mon Jul 2 21:19:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 10502541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 794366028F for ; Mon, 2 Jul 2018 22:18:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6880428C52 for ; Mon, 2 Jul 2018 22:18:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A50728C56; Mon, 2 Jul 2018 22:18:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96CC928C52 for ; Mon, 2 Jul 2018 22:17:59 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5BA40267735; Tue, 3 Jul 2018 00:17:58 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0BDAA267735; Tue, 3 Jul 2018 00:17:56 +0200 (CEST) Received: from mail-io0-f193.google.com (mail-io0-f193.google.com [209.85.223.193]) by alsa0.perex.cz (Postfix) with ESMTP id 475A0267734 for ; Tue, 3 Jul 2018 00:17:54 +0200 (CEST) Received: by mail-io0-f193.google.com with SMTP id z20-v6so1805149iol.0 for ; Mon, 02 Jul 2018 15:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=IWWtBjDKuFz5K+q4kYQrEThAzIr/apsuB4OV6JwZFqU=; b=N+7yRg4hMB8Vbj3gpblCrMXCqUNR/5MJ3G0b2Vd6vUMyiONBdrFdP0QRg6TpLp4+C5 LFYNJlDYFFWv5qc5LJDq3O1HKdpOus9usHKi8EHeVwsIj3JMktUVxxrvt0AR4kneuWu7 QgzKorhx1/xRqx0l/RRbE4aoHnWzdzGIHQyxs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IWWtBjDKuFz5K+q4kYQrEThAzIr/apsuB4OV6JwZFqU=; b=arKvw9hAaZVOiw1BxVvZgHa0FrYs3ZwDj196JpklqxI2ApQAzmmoQCuM31y8Zc0ROJ Me5HsdIWo9covWq1Yo2Ah8rR/3uTuJwhbv2QSLZDgaE/0suETWNCfVi9u3N47qMauedX usJaxcnkOD+wdh7DS6F/TNMgwvlY8WXn2B7JqCqnirx9MrRuDZdOWPuUXzi8e6aBxaAd Sy7FlBFVRHbDGuHOVQVy/at223dteODqbRLnBtp8Z8TL93L6hAgu0dt239o8RY4XwZWa N4Lze830Ck4ZKECOln8psnnrnUghvP2EegthstcAotsWFM3+ya40uCf2QJw2s7Gf5fEW 9sYg== X-Gm-Message-State: APt69E3Loo9tDx02aSnCEahZwHhmCpqgzdKxXxF/b18DcyOuZDJjD2Lo socbtG4cHIu+qUkBFbyDH0Oj/JJoyAQ= X-Google-Smtp-Source: AAOMgpeEfBoFZes3Oi1hioEwV4qAbrFP+eoO2x7b1bK/dwgNs/Xg7KwXnszDa/XFRtD8Dhrm2hWBPg== X-Received: by 2002:a6b:520d:: with SMTP id g13-v6mr23374431iob.60.1530566401960; Mon, 02 Jul 2018 14:20:01 -0700 (PDT) Received: from djkurtz2.bld.corp.google.com ([2620:15c:183:0:1cfd:61a5:7215:5f9c]) by smtp.gmail.com with ESMTPSA id h75-v6sm776729ioh.50.2018.07.02.14.20.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 14:20:01 -0700 (PDT) From: Daniel Kurtz To: Date: Mon, 2 Jul 2018 15:19:50 -0600 Message-Id: <20180702211956.149355-1-djkurtz@chromium.org> X-Mailer: git-send-email 2.18.0.399.gad0ab374a1-goog Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Takashi Iwai , Daniel Kurtz , Liam Girdwood , Mark Brown , "Mukunda, Vijendar" , Alex Deucher , Guenter Roeck , Akshu Agrawal Subject: [alsa-devel] [PATCH 1/6] ASoC: AMD: Always stop ch2 first X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 6b116dfb4633a ("ASoC: AMD: make channel 1 dma as circular") made both channels circular, so this comment and logic no longer applies. Always stop ch2 (the channel closest to the output) before ch1. This ensures that the downstream circular DMA channel does not continue to play/capture repeated samples after the upstream circular DMA channel has already stopped. Signed-off-by: Daniel Kurtz --- sound/soc/amd/acp-pcm-dma.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 3c3d398d0d0b1..4665ae12e74e4 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -1067,21 +1067,8 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - /* For playback, non circular dma should be stopped first - * i.e Sysram to acp dma transfer channel(rtd->ch1) should be - * stopped before stopping cirular dma which is acp sram to i2s - * fifo dma transfer channel(rtd->ch2). Where as in Capture - * scenario, i2s fifo to acp sram dma channel(rtd->ch2) stopped - * first before stopping acp sram to sysram which is circular - * dma(rtd->ch1). - */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - acp_dma_stop(rtd->acp_mmio, rtd->ch1); - ret = acp_dma_stop(rtd->acp_mmio, rtd->ch2); - } else { - acp_dma_stop(rtd->acp_mmio, rtd->ch2); - ret = acp_dma_stop(rtd->acp_mmio, rtd->ch1); - } + acp_dma_stop(rtd->acp_mmio, rtd->ch2); + ret = acp_dma_stop(rtd->acp_mmio, rtd->ch1); rtd->bytescount = 0; break; default: