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=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 5CF2DC433B4 for ; Tue, 27 Apr 2021 06:39:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29B3F610A5 for ; Tue, 27 Apr 2021 06:39:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234556AbhD0Gjr (ORCPT ); Tue, 27 Apr 2021 02:39:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhD0Gjo (ORCPT ); Tue, 27 Apr 2021 02:39:44 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85E31C061574 for ; Mon, 26 Apr 2021 23:39:00 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id b23so9454138lfv.8 for ; Mon, 26 Apr 2021 23:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=I0nfqSqzuzoOBPv7mcSdmp3bMcP96BtuMMzceqfKSHY=; b=UzGdvQoQPnzaqSYnWcX+X0MPOC6GeNU8dTbot/n97HOMCsdPm0TvNoL8/hxZ6bhBYO mMOHy10IgtT5Oo75J275fTxnQ0rO4vF6UjmHuEWcz7cN+A8SIXItnLYaOM/eCrOq0PBS Hk8oL/+YUpb5Dgy1JXkOyQcq6NZLP7lPz6NimY04Ad0kSWvcZ1nvCGUQvdxjniX92BT4 HdnyKEvpgss1Xats7Byg2sgL6j3LduTuEA8DbR0yPVjl+a5HZBZvFAfBcnOUysiXQMLd SP3rrCjD2FPBy8NLSzwCW3Z2W3PH7tIR1l0l7tJtihR3LHq0pR/BgxeaL+VM75+EkQwn Z1Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I0nfqSqzuzoOBPv7mcSdmp3bMcP96BtuMMzceqfKSHY=; b=b3NoZYdJTr0fkp5E3h3YOCyACJJduNTNICfsdbsKMuSYbftuD2Ma45EdtlVocruQyH HfIp9CQ5O+5LbphXxq6EgarX9CD6VcEhnV+nUzCNvNWTuCVmm7FQy7MHknqXgY+IIVr3 ZwjoX938MCIx+9rfQz0E+twN+xAFJnZJsbSAFd7YDP24hOQL2W94fQ+UmCCXzess8HJZ Iu/Vh1kRSZQAbahjPveI6FZ/yOQDHXXAFmF8ouADO0d7P5xc2/MEKL0Mv2RADg61bHKb hWTpYVY3719eRr7b2xnBGHw3UJxglMJevOBg45kBECxAG5bvYUMabrHYL/Rx7NbEM1PX c2iQ== X-Gm-Message-State: AOAM533ikzJz+ocajfWM8UsVMhJ6wlG4FSh8ZcSDynHaUKv8/ujiDuCI ihDXTXX8Jo9Ov5b18AM4GxkQrY4Y2oWCQvoy X-Google-Smtp-Source: ABdhPJx+KO56jhsdLthXdxaC8oop0qjrOY5t1e/D5vODde0kO5v9CUu/8o/jO+hLXZWTIQjXbKaQTA== X-Received: by 2002:a05:6512:410:: with SMTP id u16mr15664838lfk.641.1619505538497; Mon, 26 Apr 2021 23:38:58 -0700 (PDT) Received: from [10.0.0.42] (91-155-111-71.elisa-laajakaista.fi. [91.155.111.71]) by smtp.gmail.com with ESMTPSA id w23sm1621933lfu.132.2021.04.26.23.38.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Apr 2021 23:38:57 -0700 (PDT) To: "Mukunda,Vijendar" , Mark Brown Cc: alsa-devel@alsa-project.org, amistry@google.com, nartemiev@google.com, Alexander.Deucher@amd.com, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Ranjani Sridharan , Kuninori Morimoto , open list References: <1619195089-29710-1-git-send-email-Vijendar.Mukunda@amd.com> <20210423164617.GG5507@sirena.org.uk> From: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= Subject: Re: [PATCH 1/2] ASoC: dwc: add a quirk DW_I2S_QUIRK_STOP_ON_SHUTDOWN to dwc driver Message-ID: Date: Tue, 27 Apr 2021 09:40:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/26/21 3:21 PM, Mukunda,Vijendar wrote: >>> What is the design constraint here - can't we fix the design?  Or is it >>> a hardware design constraint (presumably broken signalling between the >>> I2S and DMA blocks)? > > Its a hardware design constraint. > > > I2S driver is not directly exposing DMA interface to host. > ACP 2.x has unique design where ACP driver controls data flow between > host and I2S as mentioned above. > ACP IP has different IP blocks within it which includes I2S controller > and DMA controller. > > ACP DMA Driver is responsible for DMA transactions between system memory > and I2S controller.It uses two step DMA mechanism to copy data between > system memory <-> ACP SRAM and ACP SRAM <-> I2S FIFO for > playback/capture use cases. > ACP driver program two DMA channels for DMA transfers between System > memory & I2S FIFO. > > ACP DMA driver isn't general purpose DMA controller driver where we can > implement terminate_all() API. > > I2S controller DMA transactions are tightly coupled with ACP DMA > controller. > while DMA transfer ongoing between ACP SRAM and I2S FIFO, Stopping I2S > DMA prior to ACP DMA stop resulting DMA Channel stop failure. > Its not related to I2S FIFO flushing related handling. > Once the DMA channel failure observed during the closure of the stream, > when again new stream opened, DMA won't progress at all. Thanks for the explanation. This is not upstream, right? What is still not clear to me is which channel fails? A) the DMA between ACP FIFO and the I2S B) the DMA between ACP FIFO and system memory in acp-pcm-dma.c on stop you have a busy loop (10000 iterations) to check if the channel is in fact stopped in response to the cleared run, IOCEn bits and the set Rst bit. Channel closer to the destination is stopped first which sounds reasonable, but on playback you ignore timeout from A, on capture you ignore the timeout from B. Still the issue sounds like exactly what I have described. One of the DMA is failing to drain because the IP is stopped? > Need find a right place to implement a work around only for AMD > stoneyridge platform. Is this really only affecting stoneyridge platform? Are there other platforms using drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c ? -- Péter 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=-2.2 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 C293BC433B4 for ; Tue, 27 Apr 2021 06:40:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30888613BE for ; Tue, 27 Apr 2021 06:40:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30888613BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B6C2816EF; Tue, 27 Apr 2021 08:39:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B6C2816EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1619505606; bh=2s8y4bCfjeSiKZ6D8YDox30nVmr4T5FAYDDxpUAEtm8=; h=To:References:From:Subject:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LKQyyhVon4RS5YIS/2DuD4h8XsLoAtTa4dzondzwQ07uB7DjSguORVBtDOk7XzDcE abueRk4GHFPy5fIbEtZ8+1QHqdzbUzM7MLNgGXhIpHIdWhJZx2ftOLATC3L1cPGWxd 3Wl65Oi5gQptMZ9UJmqjj3sdaKo//yU0HZNbeekw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0355CF801D8; Tue, 27 Apr 2021 08:39:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8B331F801EC; Tue, 27 Apr 2021 08:39:13 +0200 (CEST) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6FFF1F800C0 for ; Tue, 27 Apr 2021 08:39:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6FFF1F800C0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UzGdvQoQ" Received: by mail-lf1-x136.google.com with SMTP id x20so61732950lfu.6 for ; Mon, 26 Apr 2021 23:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=I0nfqSqzuzoOBPv7mcSdmp3bMcP96BtuMMzceqfKSHY=; b=UzGdvQoQPnzaqSYnWcX+X0MPOC6GeNU8dTbot/n97HOMCsdPm0TvNoL8/hxZ6bhBYO mMOHy10IgtT5Oo75J275fTxnQ0rO4vF6UjmHuEWcz7cN+A8SIXItnLYaOM/eCrOq0PBS Hk8oL/+YUpb5Dgy1JXkOyQcq6NZLP7lPz6NimY04Ad0kSWvcZ1nvCGUQvdxjniX92BT4 HdnyKEvpgss1Xats7Byg2sgL6j3LduTuEA8DbR0yPVjl+a5HZBZvFAfBcnOUysiXQMLd SP3rrCjD2FPBy8NLSzwCW3Z2W3PH7tIR1l0l7tJtihR3LHq0pR/BgxeaL+VM75+EkQwn Z1Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I0nfqSqzuzoOBPv7mcSdmp3bMcP96BtuMMzceqfKSHY=; b=WoVDcrxsUwk0UCIe5d4JRV8smYr5Ev4EGWcPtMd3T576cXdb2fUc696ubCk1YgHftR aRpbvwKsf83eBt2TuPFtG3qPsWj5lI8ICCVkPxryqfU7u9UJvFy10f9WmlejMxOfHRRx 7ZqNafwmPZbSunBEeeyTbu8Q+Ol2F5RgDws5fH2Vw4R728vHY2Xj9gqiHA713f7Y2GHu fX+oz70U2GA4pH/EQPIHubL05KQH0dwnn6rxanYUoHKNplR8O2kpRGnQczVnSYLuFUh3 GDqykJ0G6saDq2Vf/h6+VvvIpBRhGKntSsauQTSQ2HhNrFsp2r/Yi8hpoCJiMh64LIty QX9g== X-Gm-Message-State: AOAM531LKXrEjkI2BakYze5Yok0HA5J3OFl8mQ1VgJOEwQwWWMdK0ThO d/rBb9IzBLTEFF+PiKo65eU= X-Google-Smtp-Source: ABdhPJx+KO56jhsdLthXdxaC8oop0qjrOY5t1e/D5vODde0kO5v9CUu/8o/jO+hLXZWTIQjXbKaQTA== X-Received: by 2002:a05:6512:410:: with SMTP id u16mr15664838lfk.641.1619505538497; Mon, 26 Apr 2021 23:38:58 -0700 (PDT) Received: from [10.0.0.42] (91-155-111-71.elisa-laajakaista.fi. [91.155.111.71]) by smtp.gmail.com with ESMTPSA id w23sm1621933lfu.132.2021.04.26.23.38.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Apr 2021 23:38:57 -0700 (PDT) To: "Mukunda,Vijendar" , Mark Brown References: <1619195089-29710-1-git-send-email-Vijendar.Mukunda@amd.com> <20210423164617.GG5507@sirena.org.uk> From: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= Subject: Re: [PATCH 1/2] ASoC: dwc: add a quirk DW_I2S_QUIRK_STOP_ON_SHUTDOWN to dwc driver Message-ID: Date: Tue, 27 Apr 2021 09:40:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, Sunil-kumar.Dommati@amd.com, amistry@google.com, Kuninori Morimoto , Liam Girdwood , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Ranjani Sridharan , Alexander.Deucher@amd.com, nartemiev@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 4/26/21 3:21 PM, Mukunda,Vijendar wrote: >>> What is the design constraint here - can't we fix the design?  Or is it >>> a hardware design constraint (presumably broken signalling between the >>> I2S and DMA blocks)? > > Its a hardware design constraint. > > > I2S driver is not directly exposing DMA interface to host. > ACP 2.x has unique design where ACP driver controls data flow between > host and I2S as mentioned above. > ACP IP has different IP blocks within it which includes I2S controller > and DMA controller. > > ACP DMA Driver is responsible for DMA transactions between system memory > and I2S controller.It uses two step DMA mechanism to copy data between > system memory <-> ACP SRAM and ACP SRAM <-> I2S FIFO for > playback/capture use cases. > ACP driver program two DMA channels for DMA transfers between System > memory & I2S FIFO. > > ACP DMA driver isn't general purpose DMA controller driver where we can > implement terminate_all() API. > > I2S controller DMA transactions are tightly coupled with ACP DMA > controller. > while DMA transfer ongoing between ACP SRAM and I2S FIFO, Stopping I2S > DMA prior to ACP DMA stop resulting DMA Channel stop failure. > Its not related to I2S FIFO flushing related handling. > Once the DMA channel failure observed during the closure of the stream, > when again new stream opened, DMA won't progress at all. Thanks for the explanation. This is not upstream, right? What is still not clear to me is which channel fails? A) the DMA between ACP FIFO and the I2S B) the DMA between ACP FIFO and system memory in acp-pcm-dma.c on stop you have a busy loop (10000 iterations) to check if the channel is in fact stopped in response to the cleared run, IOCEn bits and the set Rst bit. Channel closer to the destination is stopped first which sounds reasonable, but on playback you ignore timeout from A, on capture you ignore the timeout from B. Still the issue sounds like exactly what I have described. One of the DMA is failing to drain because the IP is stopped? > Need find a right place to implement a work around only for AMD > stoneyridge platform. Is this really only affecting stoneyridge platform? Are there other platforms using drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c ? -- Péter