Received: by 10.223.185.116 with SMTP id b49csp647790wrg; Tue, 20 Feb 2018 05:40:14 -0800 (PST) X-Google-Smtp-Source: AH8x225/Jr5XVwCzvSooZOYllvZWWng4oIgBu7dg/itCYACsMrF/MXED34coGzJkw0OlI9zaM0LQ X-Received: by 10.99.124.7 with SMTP id x7mr4084134pgc.356.1519134014265; Tue, 20 Feb 2018 05:40:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519134014; cv=none; d=google.com; s=arc-20160816; b=GvjQfaVsEMLH0vaMeb8UTDZGS4HEgNvCpxcAGkgxmJcky4Z2wvZ+58CigAabEjc2O2 N2YIxR/gKieFfY2fmaAR7v9UcDcCkj6R82GGyrUoIp+zlk/3S/1FTXAF0oBBbIEYlv10 EZusMzfMr+ESJ6cKquqwsSsNWug/Uu0GG4zVSUFJFNoaCfE2zQEI+n+43BEkFQ26Kkss MxHrZryeeR/XCz4xft6WoIBVmFf1YqeES0AAaU1VBFq/HDTd9pQB6jcTcTUUqVQo0pqT OHy+7ezAFt8OzvWyiMwUOl7P5HltD6OiWO43LkkCZL0BvDLtS+WCLqoA4+IioH1VL4PP SjAA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=lvdDBk0MR/FdgRmxn4T7J3HUHiYrRoORGTvzGRd1b/8=; b=Q79fjui46WBKr2BGbl+KsNPNa/0GFcpytTvyifSoGHOYg/aNFvMxiyp81/Xmza3Uhn Q/XMcZAlIiiEVUXarfG+9uI1GMHOEazPWg6oNBe+40UhayewpBAwUW23IU2ry0riFCR3 XinuNVGDHAP5dGZrYJGQ5qZIY4Fnh3g6R6Ov6ODNSaVJEhjIXXdIWm6iV2NzeEeFzFrt mMo4rAWo6XhUzncNe9fQ1hQ4qZZ6r2PKwt80tOgnpORaGellP/sqvshgsglruuGaqmeG RlcdLJchSCc3ndZjhaPkL1RmA4AklA3oXtEt4IFYd37dS2gkue/Q+Hp66EnVQ/HvUsXS dtkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lJDTgdag; 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 p11si3450648pgs.537.2018.02.20.05.39.59; Tue, 20 Feb 2018 05:40:14 -0800 (PST) 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=lJDTgdag; 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 S1751890AbeBTNjV (ORCPT + 99 others); Tue, 20 Feb 2018 08:39:21 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:38062 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbeBTNjT (ORCPT ); Tue, 20 Feb 2018 08:39:19 -0500 Received: by mail-qk0-f193.google.com with SMTP id s198so16385758qke.5; Tue, 20 Feb 2018 05:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lvdDBk0MR/FdgRmxn4T7J3HUHiYrRoORGTvzGRd1b/8=; b=lJDTgdag8ReLpCu+Hvk9d0ReaePKE24OJKC6pVushXc4PdLUHB5NpL0gW4R6No/8ic 1bNvssK3c5wzk8vqy6MmSoJ2PZg5dVP+u7OEELE7+ioCBsNE+pFwE3NT0y5wBinJHQJd CsiRpN/PZjq6yKfNYjU71wRQdmmmaYjWcas+ehzyOGpP6GZJU6GOwA405Y+WO3Rpfifa VvLqD4Vlv/v6SH9mHPNPxhoG4tPJimDEOlqO8lRDo2xxtDOzRt8WFMAq+yuJBLd3/Vwb SjX7CP1XivmJImfGj6t793jTPoJi2WTj7IDiSClBFbaPsDjaXdURkweHfvwif9y0cmO3 yCLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lvdDBk0MR/FdgRmxn4T7J3HUHiYrRoORGTvzGRd1b/8=; b=aDqz4MgR42YXSvQBMyRX1yIKpJxv8wjtkCqxdkl9AsZNpRsPKa4fu2j/F9kIRtP3ij aReWdxBmobxXklGA0z8TVCTtMuJfOx93EsiUcQxpG/IZydlrs0W55wswdTcz1V4rUcVk LaLOB8uHd3ciOCs1FTriZbXQsdKQfIGLC+wmjFLP7vL+75951Y61NLEn/32CY82YfxR8 5GRkhxigkH/4dfFPLcTqXRDUsmJhLg/lQIP0i/xAmYByIj4vHjCftnvjG0SMJiv/pepo argMu3M+VyfMznhhQJmMYk7ld4E6mExNVvHQEmakyPgQi1bcGcu+D5ns5FFCTtS3Nu+d SFgg== X-Gm-Message-State: APf1xPATUWngPpJjunqGjXOICg4JDSO0gbGk95/E708qit128fipwPpA RpTan9jWzOcrVQ1ZYuawrOKzXtWzRg7yMRhav4I= X-Received: by 10.55.124.67 with SMTP id x64mr1577914qkc.137.1519133958114; Tue, 20 Feb 2018 05:39:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Tue, 20 Feb 2018 05:39:17 -0800 (PST) In-Reply-To: <20180220123047.24469-2-Eugeniy.Paltsev@synopsys.com> References: <20180220123047.24469-1-Eugeniy.Paltsev@synopsys.com> <20180220123047.24469-2-Eugeniy.Paltsev@synopsys.com> From: Andy Shevchenko Date: Tue, 20 Feb 2018 15:39:17 +0200 Message-ID: Subject: Re: [PATCH 1/2] dmaengine: Introduce DW AXI DMAC driver To: Eugeniy Paltsev Cc: dmaengine , linux-snps-arc@lists.infradead.org, Linux Kernel Mailing List , devicetree , Vinod Koul , Dan Williams , Rob Herring , Wan Ahmad Zainie , Alexey Brodkin 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 Tue, Feb 20, 2018 at 2:30 PM, Eugeniy Paltsev wrote: > This patch adds support for the DW AXI DMAC controller. > DW AXI DMAC is a part of HSDK development board from Synopsys. > > In this driver implementation only DMA_MEMCPY transfers are > supported. Just few comments, code looks fine I hope. > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -13344,6 +13344,12 @@ F: include/linux/dma/dw.h > F: include/linux/platform_data/dma-dw.h > F: drivers/dma/dw/ > > +SYNOPSYS DESIGNWARE AXI DMAC DRIVER > +M: Eugeniy Paltsev > +S: Maintained > +F: drivers/dma/dwi-axi-dmac/ > +F: Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.txt AXI is earlier in alphabet than DMAC in previous record. Linus even submitted a script last year to sort the MAINTAINERS data base. > +/* > + * Synopsys DesignWare AXI DMA Controller driver. > + * > + * Copyright (C) 2017-2018 Synopsys, Inc. (www.synopsys.com) > + * Author: Eugeniy Paltsev > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + */ Now we have SPDX identifiers. > +static u32 axi_chan_get_xfer_width(struct axi_dma_chan *chan, dma_addr_t src, > + dma_addr_t dst, size_t len) > +{ > + u32 max_width = chan->chip->dw->hdata->m_data_width; > + > + return min_t(size_t, __ffs(src | dst | len), max_width); size_t -> u32 ? > +} > + unsigned int timeout = 20; /* timeout iterations */ > + do { > + if (axi_chan_irq_read(chan) & DWAXIDMAC_IRQ_SUSPENDED) { > + ret = 0; > + break; > + } > + udelay(2); > + } while (timeout--); Off-by-one. You will have 21 tries here. } while (--timeout); -- With Best Regards, Andy Shevchenko