Received: by 10.213.65.68 with SMTP id h4csp3252373imn; Tue, 3 Apr 2018 01:19:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx492YeLUSPl5FRft/Rybb4SnnNu1uSMsrHexQJ0XV4sy847ZWBbCORvMLFuSvd1TJv6lXysK X-Received: by 2002:a17:902:be12:: with SMTP id r18-v6mr11174204pls.173.1522743547209; Tue, 03 Apr 2018 01:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522743547; cv=none; d=google.com; s=arc-20160816; b=ueO/QC9G3BASWJYWO5JNClgiI7/hkXxyxJPeuJp7HkSDFSxjDc6hQmxqPqplbr9uFV jqg6mMTsrxCSQcMgP6hfc11VqCYwCJzDaFlv9soh93qP5EuQ4n32SQHVw71bZZflaYLM UIsPH96LlzHzHhwHt3HeI+wC3Gx8zy28WzFmMjMQGnduH2wOemLlt6IZ4Zgvi7rzmvvE BqEmX+hLhvNXYlgfpYTWYnqI9lD1nOJh1W3iehsL6GDxBGl+0npuCkLvHe8tGrP1xpkN E1O7Ch9wO1chtuUZBzXisKQ2nmtOEuaEjcoDqwFMdZexeOKHkhBljoYbngGlbzeONGqT LP+Q== 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:arc-authentication-results; bh=wyGmN4lIEs62CUGylyNECRkiarvrvt6BLMAPaStrKjQ=; b=nVacu2mt+Ygn0zOn+EFPJk1fI1ldk+fg681VHgBL8QpxnAnlIFh3q3JBAllgR3YalY hJ3E5c5AFtBDo/eEYj5erHBn4K+/7l/XulKl2Xyq6zHCuiyH/KcI79x7J4UGFFb9HGTf GOADRRzvOV5IkUuym1cg9fxOLnqGuNEIyOF77yRFRSwna0fgcWdjo3zyOUG9HJ8/Yu3L JcLfuFrLkjAWcXqotNFHCf6sDgehTkSQx+kOeDHN3qEmXEFi+TErX3s9kRW9G8g9F2w4 cvwwcnPf5GhR2BDO2RPVyZoBW9JFKR7LJkXPf0R8Ns7JaLvXq1bufY/H3uFeL5ob5peO kLpw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si1549358pgp.243.2018.04.03.01.18.52; Tue, 03 Apr 2018 01:19:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754970AbeDCIRY (ORCPT + 99 others); Tue, 3 Apr 2018 04:17:24 -0400 Received: from mail.bootlin.com ([62.4.15.54]:39738 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754856AbeDCIRW (ORCPT ); Tue, 3 Apr 2018 04:17:22 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 7FC8920764; Tue, 3 Apr 2018 10:17:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 501EE20384; Tue, 3 Apr 2018 10:17:11 +0200 (CEST) Date: Tue, 3 Apr 2018 10:17:11 +0200 From: Maxime Ripard To: Sergey Suloev Cc: Mark Brown , Chen-Yu Tsai , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] spi: sun4i: add DMA transfers support Message-ID: <20180403081711.rqsp77mgnuvlnzt5@flea> References: <20180329185907.27281-1-ssuloev@orpaltech.com> <20180329185907.27281-7-ssuloev@orpaltech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yhiohrrbift4fmzp" Content-Disposition: inline In-Reply-To: <20180329185907.27281-7-ssuloev@orpaltech.com> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yhiohrrbift4fmzp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 29, 2018 at 09:59:07PM +0300, Sergey Suloev wrote: > +static int sun4i_spi_dma_setup(struct device *dev, > + struct resource *res) > +{ > + struct spi_master *master =3D dev_get_drvdata(dev); > + struct dma_slave_config dma_sconf; > + int ret; > + > + master->dma_tx =3D dma_request_slave_channel_reason(dev, "tx"); > + if (IS_ERR(master->dma_tx)) { > + dev_err(dev, "Unable to acquire DMA TX channel\n"); > + ret =3D PTR_ERR(master->dma_tx); > + goto out; > + } > + > + dma_sconf.direction =3D DMA_MEM_TO_DEV; > + dma_sconf.src_addr_width =3D DMA_SLAVE_BUSWIDTH_1_BYTE; > + dma_sconf.dst_addr_width =3D DMA_SLAVE_BUSWIDTH_1_BYTE; I guess that would depend on the size of the transfer, right? > + dma_sconf.dst_addr =3D res->start + SUN4I_TXDATA_REG; > + dma_sconf.dst_maxburst =3D 1; > + dma_sconf.src_maxburst =3D 1; And a burst of 1 seems sub-optimal here. > + ret =3D sun4i_spi_dma_setup(&pdev->dev, res); > + if (ret) { > + if (ret =3D=3D -EPROBE_DEFER) { > + /* wait for the dma driver to load */ > + goto err_free_master; > + } > + dev_warn(&pdev->dev, "DMA transfer not supported\n"); Saying why it's not supported would be great. Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --yhiohrrbift4fmzp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlrDOIYACgkQ0rTAlCFN r3TTnBAAgcFscT4aSqpBZIvbBl4ZyzqGYOoxXFaYBE9m+tnkrbpVU0aIVx4Zfogg M5d0r+FkrS6IhKSCCQ6xabOJN8EQvB1bkk7whcq8+584YcGxeqbAuAqY9pqARJ+f 9Nn5MUkLATPqgzT8efuu+Fjfwj4g4DHDWFiFqOcULPVYLfiYySkWfqYfPhGAdHKd 2AARSbFuURp3JeIspP/N9xMx9Oggw0J+Ba5R5KwMyF+/qhwGue0vsB3/JOMACg9E eHlTXxUYfM2oCL1Jybh7xUvnumrwQnixYnNGJZV66v+twI/UjXsXpSVJhDkL8rDG +HNZvaH2x5ymhpiTgm/6IWvYW5IdeB6WZXoV4cM1qHBQMBrpgQI+vofoSf7LJiWY RnACbUk9ls3Sh+zrZY3Xn0ZsneQ303EcvCrRyQuir5bXCUi6dCCZH4iWG2060pO3 U1mxL7DshzLUfjl0rB31rjjm6VpeclvlASHcVSqHlO3Ax34nSkwIysLEAkeQq+nU CfsAvwJAjtDHMGPlfjKG+kPZ0otO66ZTfcE6X+mgHQtr/odcL05nn3u/VX1LJUqn b3ILTtVC1qop+W0+umEB9avV8dd8OM6GtN0TrgDrzTfrJNgbLr+0wpas+jm8g/m+ MP6m9eycG6N7e/vIjPkbAGuP4oJHJDAYHzKHvLCddq4J9zUZJ8s= =7lOd -----END PGP SIGNATURE----- --yhiohrrbift4fmzp--