From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759934AbcAKMUA (ORCPT ); Mon, 11 Jan 2016 07:20:00 -0500 Received: from unicorn.mansr.com ([81.2.72.234]:55356 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759624AbcAKMT6 convert rfc822-to-8bit (ORCPT ); Mon, 11 Jan 2016 07:19:58 -0500 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Viresh Kumar Cc: Viresh Kumar , Andy Shevchenko , Dan Williams , Vinod Koul , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: dw: fix cyclic transfers References: <1452459243-23739-1-git-send-email-mans@mansr.com> <20160111061051.GC3448@ubuntu> Date: Mon, 11 Jan 2016 12:19:50 +0000 In-Reply-To: <20160111061051.GC3448@ubuntu> (Viresh Kumar's message of "Mon, 11 Jan 2016 11:40:51 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Viresh Kumar writes: > On 10-01-16, 20:54, Mans Rullgard wrote: >> Commit 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and >> chan_cfg register on resume") moved some channel initialisation to >> a new function which must be called before starting a transfer. >> >> This adds the necessary dwc_initialize() call to dw_dma_cyclic_start() >> which was missed in the original commit. >> >> Fixes: 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume") >> Signed-off-by: Mans Rullgard >> --- >> Andy, do you want to collect this with your other patches? It's trivial >> enough that it can go in separately without conflicts too. >> --- >> drivers/dma/dw/core.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c >> index 7067b6ddc1db..2917f75b67b4 100644 >> --- a/drivers/dma/dw/core.c >> +++ b/drivers/dma/dw/core.c >> @@ -1265,6 +1265,8 @@ int dw_dma_cyclic_start(struct dma_chan *chan) >> return -EBUSY; >> } >> >> + dwc_initialize(dwc); >> + >> dma_writel(dw, CLEAR.ERROR, dwc->mask); >> dma_writel(dw, CLEAR.XFER, dwc->mask); > > Ahh, that's a very very old bug :( It's not the only one, I'm afraid. > Okay, things got cleaned up by putting the dwc_initialize() call > within dwc_dostart() and so it worked for all other DMA APIs. > > What about calling dwc_dostart() from within dw_dma_cyclic_start()? > That will simplify it and remove code duplication issue as well. Good idea. New patch coming up. -- Måns Rullgård