Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2624838pxm; Mon, 28 Feb 2022 02:58:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaSJOj3wK29/r1hfOoqrzFqdmAJqJKb18xNKdCU8gro0CJErExv3SxRm/rbPY4SVDeye8m X-Received: by 2002:a63:8c52:0:b0:378:907d:1c6d with SMTP id q18-20020a638c52000000b00378907d1c6dmr4405592pgn.477.1646045939643; Mon, 28 Feb 2022 02:58:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646045939; cv=none; d=google.com; s=arc-20160816; b=OA75VBKk7u7w7EegBYvydJV/lCY9v5TjCpxP4MfkIL5HewTrHbt1ViIQE01OjxozPE Pdc9jYyJVHs3RfSJMZoU4xF0t7HZYZPoZbBPyFxZQXUhJidoYx6FAE+SGZj/o2Oc5Q9w Vilm1jPWiMNkI6X9DVAo/54wRyGdArvEII7CyVrcxRlcvlb/cF7hXgUJC+G7bPVBhkcL Fb7sd/FGBS/uBdibOCE5YlLrSrjwL1l7ruQ75XtTScZLdsrgOhJqVfwZqO2nmxtXI8lt 0nDy5kw1r8TOYmCqrivpiw8rtTmICYlw/T3xUh08TuvAZQO6M7Ug58XJNPfcq2/ElZ3I 701w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0Gh/zCLG/Enf8WpLjPEkq5pcQ399FuHU48P/zaDMkGQ=; b=JvAJ0SFs/a6jlT1xg6M5LfQ6rxRScdjv3wTVHQBFj+olM06I1PKVBXrWIFK0rH+ANQ XbKyeHuFeFDg3k0NzcEtDiFQSdfelWVcgwaSZYigupno01kQJp83APoLtV+a9dKYPnT1 XvEtJyfjtdWJGox0Dzd3lTI4z4QbOweZiAnDiJZKbQdMYKKPcq4Sf7AMcN/gtBTtuXza PPS774rk8W1jd2Umbv0DSHXyG6zYQUK2HW88WTonLZA51Gvpcbyf28M3QVtyz6ymgbeX ppzl6r79rAOXBs4w/q/EupYo7U/v2oAFAnh2oj8ol8jV0N9ctgS5fI0nWrPNt78a+82c sMjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fIgy1xiE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a631f0c000000b003706482437dsi9063843pgf.441.2022.02.28.02.58.45; Mon, 28 Feb 2022 02:58:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fIgy1xiE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234276AbiB1JXo (ORCPT + 99 others); Mon, 28 Feb 2022 04:23:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232390AbiB1JXn (ORCPT ); Mon, 28 Feb 2022 04:23:43 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B1AC33A03; Mon, 28 Feb 2022 01:23:04 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 21S9MuX9024394; Mon, 28 Feb 2022 03:22:56 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1646040176; bh=0Gh/zCLG/Enf8WpLjPEkq5pcQ399FuHU48P/zaDMkGQ=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=fIgy1xiEajmIWwKA/BXfmPuPawtQNUL7u77MSKTED/+Q4LZia1V5/BGmMztqAU/Cc HG3e/4x7N1J8mUQalcbthGHjdCp1YrLGNg9kCSxEmTnAaZjNiaQ5JcE6l0zpYa77zn Hb3wvQaeWwM+c4SEbKWIG5/Q9eykgX28ISdtGyz8= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 21S9MuYB045213 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Feb 2022 03:22:56 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 28 Feb 2022 03:22:56 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Mon, 28 Feb 2022 03:22:56 -0600 Received: from [10.250.233.1] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 21S9MrIV120544; Mon, 28 Feb 2022 03:22:54 -0600 Message-ID: <35276e1e-e37c-f8e7-c452-799f8e778465@ti.com> Date: Mon, 28 Feb 2022 14:52:23 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] dmaengine: ti: k3-udma: Avoid false error msg on chan teardown Content-Language: en-US To: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= , Vinod Koul CC: , , Linux ARM Mailing List , Jayesh Choudhary References: <20220215044112.161634-1-vigneshr@ti.com> <58fe0934-4853-714c-600d-9a2d86df5bc8@gmail.com> From: Vignesh Raghavendra In-Reply-To: <58fe0934-4853-714c-600d-9a2d86df5bc8@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 21/02/22 1:42 am, Péter Ujfalusi wrote: > Hi Vignesh, > > On 15/02/2022 06:41, Vignesh Raghavendra wrote: >> In cyclic mode, there is no additional descriptor pushed to collect >> outstanding data on channel teardown. Therefore no need to wait for this >> descriptor to come back. >> >> Without this terminating aplay cmd outputs false error msg like: >> [ 116.402800] ti-bcdma 485c0100.dma-controller: chan1 teardown timeout! > > are you sure it is aplay? It is MEM_TO_DEV, we only use the flush > descriptor for DEV_TO_MEM. MEM_TO_DEV can 'disconnect' from the > peripheral to flush out the FIFO. > Yes, this is with aplay. You are right that MEM_TO_DEV should have worked w/o this patch. > I have not seen this on am654, j721e. I can not recall seeing this on > the capture side either. > I dont see it either > The cyclic TR should be able to drain the DEV_TO_MEM by itself and the > TR should terminate. > You are right. There seems to be a trobule with McASP + BCDMA on AM62 which needs more investigation. I see RT c0000000 peer RT 90000000 BCNT 5dc00, peer BCNT 46400 So there is some data stuck in pipe which prevents channel from disabling and TDCM being signaled. My guess is McASP is no longer requesting more data from PDMA. Any way to look at McASP FIFO state/ DMA req enable state? Wondering what else can prevent draining of data. One difference is that AM62 has ti,tlv320aic3106 codec (codec is the master) where J7 uses PCM. Regards Vignesh > >> Signed-off-by: Vignesh Raghavendra >> --- >> drivers/dma/ti/k3-udma.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c >> index 9abb08d353ca0..c9a1b2f312603 100644 >> --- a/drivers/dma/ti/k3-udma.c >> +++ b/drivers/dma/ti/k3-udma.c >> @@ -3924,7 +3924,7 @@ static void udma_synchronize(struct dma_chan *chan) >> >> vchan_synchronize(&uc->vc); >> >> - if (uc->state == UDMA_CHAN_IS_TERMINATING) { >> + if (uc->state == UDMA_CHAN_IS_TERMINATING && !uc->cyclic) { >> timeout = wait_for_completion_timeout(&uc->teardown_completed, >> timeout); >> if (!timeout) { >