Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1494070imm; Mon, 3 Sep 2018 01:48:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ66W/z7dOAb/+9KWJSI3Mls4S9gGBcV51lmkSgM8c3K5U3B8RpVE2LarElhWzu++M0zgM4 X-Received: by 2002:a62:e511:: with SMTP id n17-v6mr28088871pff.210.1535964521153; Mon, 03 Sep 2018 01:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535964521; cv=none; d=google.com; s=arc-20160816; b=FPGDXK4P23+0RPN0hWN9HuLphVPvUSGTP3zdEpyWHIIhpR9U//CBWx6fNpMpy6FDGf 1pJlUV6wlgUMYYjAiYJrmznDbfQA/NaLSO2i/56qkS3OoIeBGO1LDnEfHCqrYMJ+Qpsk zMKDeGLhAjfQJuaDNOAWSVO3zXkffJKng8s+Krl3XIuXe4xmuaarz7D5mht9q5dYU+TP JKEf1LVJ3dyFcYfsi9ky4hpT3f12oRFrFxxYbTzZYUcVCTYeugt8t6NjwFhSX4hgplSn 8CDzJ3qK9H7b5gpxHkND61EzkLjr8LyK7kSSK9fHbzZMA6qqSGGhBJyhz683MmUBHlrk PewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=CUdhx+ffl1usLrRC0oJn2G13e2wYwQwLxlV6oLEgFpk=; b=CN11gQKtW6UrpMFkzJ2ObmfbDn4MKfeo3EVn9CZlmehndWdjIHW9fqC4E4Wowks0PR r+1IMCpF8o+glHV+4NW/5OINL7BTzSjn22KxHsK+XIphsYs0zjw+xb78ioC8UUpJAPS9 DhYr2CuAjuNzoazMo3yd0qFvz7VIqdREYFBrtvrDyccJ4nOtMa3/fCV6sex4kVaga9FO lcniEBHeyl7PPlXTAIZm5aFfUqVzZ4WPSiQpZPOnMvY4g0SrVV7LS0tcsiFA92akLffE pGF7mvaSmbrjvJ08Fb1V2c4CZ+KZRGaTz5wZHYeau9lPm27TzJoNedYS11XOdVd23KSf ByfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VVx+A641; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z188-v6si18814156pfb.26.2018.09.03.01.48.25; Mon, 03 Sep 2018 01:48:41 -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=@gmail.com header.s=20161025 header.b=VVx+A641; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727169AbeICNF5 (ORCPT + 99 others); Mon, 3 Sep 2018 09:05:57 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:50603 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbeICNF5 (ORCPT ); Mon, 3 Sep 2018 09:05:57 -0400 Received: by mail-wm0-f68.google.com with SMTP id s12-v6so305305wmc.0; Mon, 03 Sep 2018 01:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=CUdhx+ffl1usLrRC0oJn2G13e2wYwQwLxlV6oLEgFpk=; b=VVx+A6415V9kr5SYSbGYn1LEabDk2r7eKE1cYXUXAsDqWq5pY0lBb/cbuWR+cSBpt/ CqH5kZ5Esnfum2QuFBxEnKfxhr2yLBCXK8Dq+79IGquq4UGQUg4J4Lix6PPMo8owIP7G 8FpBFLRO+KuzOSEfrX3/nqZNiChzEzYGSwwOH4IuV+6XkAUwiEe/nYw8ZqdE0pQdRjrf tImlx4zTSTEudubPRgBqOHJpJBHRrgoWSIPQN/sL3AipTYxRrd7JpGIsA/SPsQOOGtt7 tMym6XMLXtZMzo2xXSrhUXgPbDpqQo2R3RqRZSTtbC+Q82YwYmsMafmS3cLWqSqRXSrr xLvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=CUdhx+ffl1usLrRC0oJn2G13e2wYwQwLxlV6oLEgFpk=; b=GjHx5AgAbcFSrdigXEOyXLjRGvAZO3UFGj1P9NCIBVX3VTCdBL1P0LWbWb0I7uHN98 bdG6bDkMu6mOkV7ky8qKF1kx9GckmWkfpTxjfuz+/D1jDx/8wMxWmLeiaVpSQvQa4jV3 0rSkXle8ELRyLQUwNoAA+0yNvJXpnR/e3+yNtq6eYQ5UGVnPw3e/VPix2MyIyV0L+Q5n cC9gKIknKlbzkzhcNtR6vh/O3m5M0xxk6Z1PRp3gkp9LFndYv0YVY1lEkt4l/8xUXXHX WFtw1jxBWXOoZCqR73dJk37Lpx5VvzLRuIPD2cItJ7TAyQ0J4nX1kOTOKNrkNYpL6ggs BdCg== X-Gm-Message-State: APzg51AbJ97/ohXJsWtbqzvCWl9fFaV2dYFujqFBCs8LdY3xU5cUHvnd Fa2EiXyX114DRLh7d46KBskKZWTTNfvhZxQ2tSQ= X-Received: by 2002:a1c:4c0e:: with SMTP id z14-v6mr4715254wmf.89.1535964407638; Mon, 03 Sep 2018 01:46:47 -0700 (PDT) MIME-Version: 1.0 References: <20180802141012.19970-1-andrea.merello@gmail.com> <20180802141012.19970-2-andrea.merello@gmail.com> <20180827053002.GT2388@vkoul-mobl> <20180830132745.GC2322@vkoul-mobl> In-Reply-To: <20180830132745.GC2322@vkoul-mobl> Reply-To: andrea.merello@gmail.com From: Andrea Merello Date: Mon, 3 Sep 2018 10:46:34 +0200 Message-ID: Subject: Re: [PATCH v4 2/7] dmaengine: xilinx_dma: in axidma slave_sg and dma_cylic mode align split descriptors To: Vinod 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 30, 2018 at 3:27 PM Vinod wrote: > > 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 Yes, I confirm that here the code does look fine: the 2nd line is aligned with opening brace indeed. Do you want I produce now a v5 with all the other fixes you asked for (basically commit message fixes), or you are going to apply/check this one and should I wait for that? > -- > ~Vinod