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=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 8C54DC43603 for ; Tue, 10 Dec 2019 06:01:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52B2020663 for ; Tue, 10 Dec 2019 06:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575957680; bh=WNIfmB88s9UZ8M12PiZh81hOpj6ylIlhnBkBtWuyi9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=mtWHhrrE3R1CaZQB7Vj2na2TNh+42O3mBkRp05jbGZK5uCUJa+oUD85aXKP8kK8TE bjaSEyp54QmGz38U2XguIk1BPtVw2CSyRWC4XCX+ZaIonc38kyYDrC3QAG4qLRoSF/ dXA6LYJ3FneqaYJil0Qr3sPKfpE930P8nbjnNU1I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbfLJGBU (ORCPT ); Tue, 10 Dec 2019 01:01:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:50004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbfLJGBT (ORCPT ); Tue, 10 Dec 2019 01:01:19 -0500 Received: from localhost (unknown [106.201.45.82]) (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 0D69620652; Tue, 10 Dec 2019 06:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575957679; bh=WNIfmB88s9UZ8M12PiZh81hOpj6ylIlhnBkBtWuyi9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ppYs4e1842YT8R2SlHONcx+MnJXqwZKo+ByMr6Elz0Atvfi4zJp/+ru+zwQF0zzEf evrGaBdkM7oVk+1hoR2SA+4WisSSIH9h0F70+r+kgYIrwt/GIKmAIWj4wAc3P+Ksfm njmlq5yWHvcppV1AJAYUP664gom6eX4KnReyn7D4= Date: Tue, 10 Dec 2019 11:31:13 +0530 From: Vinod Koul To: Radhey Shyam Pandey Cc: dan.j.williams@intel.com, michal.simek@xilinx.com, nick.graumann@gmail.com, andrea.merello@gmail.com, appana.durga.rao@xilinx.com, mcgrof@kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, git@xilinx.com Subject: Re: [PATCH] dmaengine: xilinx_dma: Reset DMA channel in dma_terminate_all Message-ID: <20191210060113.GP82508@vkoul-mobl> References: <1574664121-13451-1-git-send-email-radhey.shyam.pandey@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1574664121-13451-1-git-send-email-radhey.shyam.pandey@xilinx.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On 25-11-19, 12:12, Radhey Shyam Pandey wrote: > Reset DMA channel after stop to ensure that pending transfers and FIFOs > in the datapath are flushed or completed. It fixes intermittent data > verification failure reported by xilinx dma test client. > > Signed-off-by: Radhey Shyam Pandey > --- > drivers/dma/xilinx/xilinx_dma.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c > index a9c5d5c..6f1539c 100644 > --- a/drivers/dma/xilinx/xilinx_dma.c > +++ b/drivers/dma/xilinx/xilinx_dma.c > @@ -2404,16 +2404,17 @@ static int xilinx_dma_terminate_all(struct dma_chan *dchan) > u32 reg; > int err; > > - if (chan->cyclic) > - xilinx_dma_chan_reset(chan); So reset is required for non cyclic cases as well now? > - > - err = chan->stop_transfer(chan); > - if (err) { > - dev_err(chan->dev, "Cannot stop channel %p: %x\n", > - chan, dma_ctrl_read(chan, XILINX_DMA_REG_DMASR)); > - chan->err = true; > + if (!chan->cyclic) { > + err = chan->stop_transfer(chan); no stop for cyclic now..? > + if (err) { > + dev_err(chan->dev, "Cannot stop channel %p: %x\n", > + chan, dma_ctrl_read(chan, > + XILINX_DMA_REG_DMASR)); > + chan->err = true; > + } > } > > + xilinx_dma_chan_reset(chan); > /* Remove and free all of the descriptors in the lists */ > xilinx_dma_free_descriptors(chan); > chan->idle = true; > -- > 2.7.4 -- ~Vinod