Received: by 10.213.65.68 with SMTP id h4csp411692imn; Wed, 4 Apr 2018 00:12:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx48lPqjYOiZnhMlSgTNBFht9sQzwdDnBtFciMuH6Z2tlR4zIe7qBXzWpoDCsvBs78OMAjJd9 X-Received: by 10.99.123.19 with SMTP id w19mr10820178pgc.405.1522825927987; Wed, 04 Apr 2018 00:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522825927; cv=none; d=google.com; s=arc-20160816; b=fYAA1m/SNbdc86yRxBA/+X+ISjdIwPg4P37sQryXiJ/TbBH8TlytCihz95hDnxKGmN IVlxMPgMCbqRCm+B8nF/SYVIH+PG5HUjik6p5lOeF9DL9hrirEbfxmfCEwXE9emg1c8W ClQJsBH67+y/6LjYUnvq747oOOvl9JMLuWMzvAT9hH0Kl4On1Klwzj8973DMNKQzBBlK 2dEMuv81ZD0Hns6CUIH2j7u+mLOkg3xuakWbrP7BbOqOxN9bqxESZyE//duIHvFTXif7 W1GLpCzjYK38xIEd01ngjsJZodGHNJxvnHhpSKoMONtXH3W2c6QzMN36RugxvnTGNueY SmuQ== 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=Goy7BZ6e9Je5ay7WWwKWE5WG16kkh3f0lDCxza3Tmy0=; b=D/W/t7fuS5BvSjRXyx5ZczQ0dOZs+J5LF8QclFT3G5RojEBtfbSZWI1zwwob25/453 FbqlAmx2isqJb3huDQCPvi0VuanE7Ct15AJToptb98LplJQUqTu4IwQOqLOUpVl2vNM5 ej5rO6Sb1gtFJIInJf+J3mollCTH89tX4LZGY8y9WC30sGvqXqiTl/bd0kgOYL23FUkp Sd/bU6gWAkcmoesw4vvbmkKyaRqp3u7H2COQhRGIF0pqhZa7CXX9fpZgE1e7O6AVvZbg UOxQZ96UDNeoJZHr8G3ccgm3Ct04pTCRdwnlfoJmtvtq2707xOPM0m5rm1b1sEr2IJmR n2hA== 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 o188si3189777pga.132.2018.04.04.00.11.53; Wed, 04 Apr 2018 00:12: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 S1750853AbeDDHKm (ORCPT + 99 others); Wed, 4 Apr 2018 03:10:42 -0400 Received: from mail.bootlin.com ([62.4.15.54]:38400 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbeDDHKl (ORCPT ); Wed, 4 Apr 2018 03:10:41 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 107E52070F; Wed, 4 Apr 2018 09:10:40 +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 CBCE32037A; Wed, 4 Apr 2018 09:10:39 +0200 (CEST) Date: Wed, 4 Apr 2018 09:10:39 +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 v2 2/6] spi: sun4i: restrict transfer length in PIO-mode Message-ID: <20180404071039.2kiizzkzzogsk3o4@flea> References: <20180403152905.1524-1-ssuloev@orpaltech.com> <20180403152905.1524-3-ssuloev@orpaltech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="l5s32d26kspvte6f" Content-Disposition: inline In-Reply-To: <20180403152905.1524-3-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 --l5s32d26kspvte6f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 03, 2018 at 06:29:01PM +0300, Sergey Suloev wrote: > There is no need to handle the 3/4 FIFO empty interrupt > as the maximum supported transfer length in PIO mode > is 64 bytes. > As long as a problem was reported previously with filling FIFO > on A10s we want to stick with 63 bytes depth. >=20 > Changes in v2: > 1) Restored processing of 3/4 FIFO full interrupt. >=20 > Signed-off-by: Sergey Suloev > --- > drivers/spi/spi-sun4i.c | 37 ++++++++++--------------------------- > 1 file changed, 10 insertions(+), 27 deletions(-) >=20 > diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c > index 4141003..08fd007 100644 > --- a/drivers/spi/spi-sun4i.c > +++ b/drivers/spi/spi-sun4i.c > @@ -22,7 +22,12 @@ > =20 > #include > =20 > -#define SUN4I_FIFO_DEPTH 64 > +/* > + * FIFO length is 64 bytes > + * But filling the FIFO fully might cause a timeout > + * on some devices, for example on spi2 on A10s > + */ > +#define SUN4I_FIFO_DEPTH 63 The FIFO depth is 64 bytes, so the code should remain the same at least from that regard. > #define SUN4I_RXDATA_REG 0x00 > =20 > @@ -202,7 +207,7 @@ static void sun4i_spi_set_cs(struct spi_device *spi, = bool enable) > =20 > static size_t sun4i_spi_max_transfer_size(struct spi_device *spi) > { > - return SUN4I_FIFO_DEPTH - 1; > + return SUN4I_FIFO_DEPTH; > } > =20 > static int sun4i_spi_transfer_one(struct spi_master *master, > @@ -216,11 +221,8 @@ static int sun4i_spi_transfer_one(struct spi_master = *master, > int ret =3D 0; > u32 reg; > =20 > - /* We don't support transfer larger than the FIFO */ > - if (tfr->len > SUN4I_MAX_XFER_SIZE) > - return -EMSGSIZE; > - > - if (tfr->tx_buf && tfr->len >=3D SUN4I_MAX_XFER_SIZE) > + /* We don't support transfers larger than FIFO depth */ > + if (tfr->len > SUN4I_FIFO_DEPTH) > return -EMSGSIZE; This essentially reverts 196737912da5, why? Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --l5s32d26kspvte6f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlrEem4ACgkQ0rTAlCFN r3Q1mA//f8KiQiJRkgbslVR6N6IzVRjn6I2BTsOQyQD2Uvaaz4w9cqjwbejaZjEv Z0/9bPqKTnTraLjOg//sf8EcTVh6ZT9AdhB3eEKGrzjNiN4BFyegHETgR5Kvgp/x iCO4bipdVSG0Ar/I/12Cy21eK+oJgVWDDuoU9vPpENVaESs5r2oUU9j9ffDv9XRM 0h7nBUXW9cD7q4305PpLZw3LTBTVUOwmpg3n2UzVpPbP7dxKg7p0L8DhjUOXs/Te 3Thl1o0A7tkPn8doJo6i0pXOmswL7GbRQWGJvAsJUL+IfG0gZvAW3V9cGwQKXD7r IyaiPcwasavH1I/I9fP7kp1B1i9+CpsySC9MVITEcDZYnSjXPMcpaoHUTA4A/mRX oRSfGv7FtbNpKvyoZXKSuMpEtEzrDPZFelUpfdparCVNY7YNkZN6jB5uXgQJ2Iqw k8KShkTazxUNjGBP9+fkgwQML4PUoIKEgl8Ugs/iguVeahcN35ObEmehVlVC+k5M zBPfHqQgB0T7HV5DemKGSJBpfs0XU2m7dOjaLX16nNW5UIzmlWZb2fny6DQLy+Y0 g/UnBk9pLXCseX3w0Hgn0Qbgh0B8RnIeh+xQNu3CQzPxXf/IfDIV+iqsevJvkuE9 5+qhTRjLTbMrkhq1hxrWL+9ITmD0JET+/9jk+iAxa5ijk9MpL5w= =VK+/ -----END PGP SIGNATURE----- --l5s32d26kspvte6f--