Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398AbbFCI1w (ORCPT ); Wed, 3 Jun 2015 04:27:52 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:34128 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753014AbbFCI1r (ORCPT ); Wed, 3 Jun 2015 04:27:47 -0400 Date: Wed, 3 Jun 2015 10:28:10 +0200 From: Ludovic Desroches To: Vinod Koul CC: Ludovic Desroches , , , , , Subject: Re: [PATCH v2] dmaengine: at_xdmac: rework slave configuration part Message-ID: <20150603082810.GA11060@odux.rfo.atmel.com> Mail-Followup-To: Vinod Koul , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, nicolas.ferre@atmel.com, maxime.ripard@free-electrons.com References: <1433173324-13182-1-git-send-email-ludovic.desroches@atmel.com> <20150602132208.GX3140@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150602132208.GX3140@localhost> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1893 Lines: 52 On Tue, Jun 02, 2015 at 06:52:08PM +0530, Vinod Koul wrote: > On Mon, Jun 01, 2015 at 05:40:48PM +0200, Ludovic Desroches wrote: > > @@ -604,16 +636,18 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, > > return NULL; > > } > > > > + if (at_xdmac_compute_chan_conf(chan, direction)) > > + return NULL; > > + > You forgot to release the lock. Also in prev call, you are getting the desc, > that needs to be put back or moved before getting descriptor > Right, thanks. > > /* Linked list descriptor setup. */ > > if (direction == DMA_DEV_TO_MEM) { > > - desc->lld.mbr_sa = atchan->per_src_addr; > > + desc->lld.mbr_sa = atchan->sconfig.src_addr; > > desc->lld.mbr_da = mem; > > - desc->lld.mbr_cfg = atchan->cfg[AT_XDMAC_DEV_TO_MEM_CFG]; > > } else { > > desc->lld.mbr_sa = mem; > > - desc->lld.mbr_da = atchan->per_dst_addr; > > - desc->lld.mbr_cfg = atchan->cfg[AT_XDMAC_MEM_TO_DEV_CFG]; > > + desc->lld.mbr_da = atchan->sconfig.dst_addr; > > } > > + desc->lld.mbr_cfg = atchan->cfg; > > dwidth = at_xdmac_get_dwidth(desc->lld.mbr_cfg); > > fixed_dwidth = IS_ALIGNED(len, 1 << dwidth) > > ? at_xdmac_get_dwidth(desc->lld.mbr_cfg) > > @@ -696,15 +730,17 @@ at_xdmac_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, > > "%s: desc=0x%p, tx_dma_desc.phys=%pad\n", > > __func__, desc, &desc->tx_dma_desc.phys); > > > > + if (at_xdmac_compute_chan_conf(chan, direction)) > > + return NULL; > same here as well > In this case, lock is already released when doing this call but I have to put back the descriptor. Will send a v3. Ludovic -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/