Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp38128imm; Thu, 30 Aug 2018 06:30:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNGNOp9QFoA1R0zF8JiCr/t7A80c6vGvPLr5h+dFHa5t+tKPTYza1+1xQ3y229Z1Vwgg4V X-Received: by 2002:a62:83ca:: with SMTP id h193-v6mr10517309pfe.123.1535635811581; Thu, 30 Aug 2018 06:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535635811; cv=none; d=google.com; s=arc-20160816; b=CXKb9lFPbHa7r9Fy0aULFX5Iv/Ht3mmsdAIOCjMPN7w99dmiVGn+e29FRwyAK06JX+ sIrIdIGAY2+vpGDfkU31z2+byKQa6bx9TPuxiYmsynh22ZdJ2ZAdo/KUv/ixo520rvCt V4SKcsn4TZfnyFzKytythsDBmzZbGwvebPgyBGM9JTlGQGUkkOhBnJ0LGnEc/8Fi6YnW neDRNMLoPUfOsQ2G7oJcCH6HQR+gKg8tcbD0DLO+bvfrOsoPodmjCTaMlJ+4Eadt+s6X SgG9A1OR2PTu/zxrQPsPGne5yLEdfQeLBg50qTixeNf6mm2j1S3rlLiOWVhi9dLnVXRX BBYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=dGHDVlf8BAN0JubbPPWfsGKG94t0rRkt9e/xL+7s06E=; b=bH8DOhXMV4uIB96nr/+GLzlYgSmaaCLpIjxgIvyjbqBC7ZsKSgU7IamUWL2ozWB+fG qGnolbggPFyZA0n2bybYAkRiPQw+wJZfaALtPGrapXLw3CSuEiI0Iwm2zq5I0mQ0YoP/ k3BeBmbOmHmMOqJBjTVdV+fSN7EPrS0fdyONcpLxZ33Yi8UW4lq3vR73eHHCXES4znJm 7dIn2IopG/v4TjXm89Okuk4n58fJ0WU+e47t5BSgo8QQ6tij4ek4SLpOn7lhgbFrCYFf 5Vi2Q4RJDHW5ZTDgLs0PcEeTXnACqRt01yngajAqaaoClxj+LeaJAdVs6yeWykHF/ABR 8I9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J2stDMTF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si6499417ple.262.2018.08.30.06.29.56; Thu, 30 Aug 2018 06:30:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J2stDMTF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729055AbeH3RaG (ORCPT + 99 others); Thu, 30 Aug 2018 13:30:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:55570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728722AbeH3RaG (ORCPT ); Thu, 30 Aug 2018 13:30:06 -0400 Received: from localhost (unknown [171.76.96.227]) (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 998112073D; Thu, 30 Aug 2018 13:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535635676; bh=dzYT/sytWBbQpJ3dxE+El5FNjnA62hMRvwr6T5myZWc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J2stDMTFRGNIwVib3t1IW11Cb0GqgPlJnmTkn9c5i7KtUlR4yGXu/plNkZcKr7WXQ 2ptW0HeaBUdJd1hiP9Y64Y95Qnhxs7sgUEmUxjxfFMwr4JTuikAzAOuNb8p/z+tsg2 hNRE5yPoZaIm56XeHY9S82pG0r57+e7TpRa9p2CM= Date: Thu, 30 Aug 2018 18:57:45 +0530 From: Vinod To: Andrea Merello Cc: dan.j.williams@intel.com, michal.simek@xilinx.com, appana.durga.rao@xilinx.com, dmaengine@vger.kernel.org, linux-kernel , Rob Herring , Mark Rutland , devicetree , Radhey Shyam Pandey Subject: Re: [PATCH v4 2/7] dmaengine: xilinx_dma: in axidma slave_sg and dma_cylic mode align split descriptors Message-ID: <20180830132745.GC2322@vkoul-mobl> References: <20180802141012.19970-1-andrea.merello@gmail.com> <20180802141012.19970-2-andrea.merello@gmail.com> <20180827053002.GT2388@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-08-18, 10:11, Andrea Merello wrote: > On Wed, Aug 29, 2018 at 10:12 AM Andrea Merello > wrote: > > > > On Mon, Aug 27, 2018 at 7:30 AM Vinod wrote: > > > > > > On 02-08-18, 16:10, Andrea Merello wrote: > > > > > > s/cylic/cyclic in patch title > > > > OK > > > > > > Whenever a single or cyclic transaction is prepared, the driver > > > > could eventually split it over several SG descriptors in order > > > > to deal with the HW maximum transfer length. > > > > > > > > This could end up in DMA operations starting from a misaligned > > > > address. This seems fatal for the HW if DRE is not enabled. > > > > > > DRE? > > > > Stands for "Data Realignment Engine". I will add this string nearby > > the acronym.. > > > > > > > > > > This patch eventually adjusts the transfer size in order to make sure > > > > all operations start from an aligned address. > > > > > > > > Cc: Radhey Shyam Pandey > > > > Signed-off-by: Andrea Merello > > > > Reviewed-by: Radhey Shyam Pandey > > > > --- > > > > Changes in v2: > > > > - don't introduce copy_mask field, rather rely on already-esistent > > > > copy_align field. Suggested by Radhey Shyam Pandey > > > > - reword title > > > > Changes in v3: > > > > - fix bug introduced in v2: wrong copy size when DRE is enabled > > > > - use implementation suggested by Radhey Shyam Pandey > > > > Changes in v4: > > > > - rework on the top of 1/6 > > > > --- > > > > drivers/dma/xilinx/xilinx_dma.c | 22 ++++++++++++++++++---- > > > > 1 file changed, 18 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c > > > > index a3aaa0e34cc7..aaa6de8a70e4 100644 > > > > --- a/drivers/dma/xilinx/xilinx_dma.c > > > > +++ b/drivers/dma/xilinx/xilinx_dma.c > > > > @@ -954,15 +954,28 @@ static int xilinx_dma_alloc_chan_resources(struct dma_chan *dchan) > > > > > > > > /** > > > > * xilinx_dma_calc_copysize - Calculate the amount of data to copy > > > > + * @chan: Driver specific DMA channel > > > > * @size: Total data that needs to be copied > > > > * @done: Amount of data that has been already copied > > > > * > > > > * Return: Amount of data that has to be copied > > > > */ > > > > -static int xilinx_dma_calc_copysize(int size, int done) > > > > +static int xilinx_dma_calc_copysize(struct xilinx_dma_chan *chan, > > > > + int size, int done) > > > > > > please align with opening brace > > > > OK > > Sorry for getting back on this. > I've checked it, but it seems already aligned with opening brace in > the original e-mail text I've sent. (4 tabs + 4 spaces). Okay, please see that code looks fine, I will check after I apply -- ~Vinod