Received: by 10.213.65.68 with SMTP id h4csp3415887imn; Tue, 3 Apr 2018 04:41:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xFdXzL6ykPTbU2UfsQwgehBaTaN0syQ+kfYT/6y01Q87JqGDndbmL2HyQMql/ON2gk4jb X-Received: by 10.98.206.77 with SMTP id y74mr10339705pfg.205.1522755712148; Tue, 03 Apr 2018 04:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522755712; cv=none; d=google.com; s=arc-20160816; b=IwK0Ia//jlSBpryIq8uOxZ2BaNKWEvfop8GB8fxlvOjkAO4pGDthxKhNs93YESko8N XIJdTXXqD+6vufM/BVp0xxL1KtARaQzOUE+kJ6P0qHu4yzMCDyOo58T8WfTVqc7ONwSl sovLSxpHCX+mBXrZZjDlj/efXFjttChUIjM0Qy5Nau2GDA5caGAl3VUnvW6fxUh595S7 hsVD9E7GkHPwMHqHPprJn/lsr9B4/6UkZhFz5I7rINwLx2BfgZg08JZd5npRTBlOLjZE zMHUKdEnNXhmtVKPeo6RAmbPiu7Hzpz1WvRzbwor6jEWwLd/+GBALtCNbNKTVm4lrLPa c1Mg== 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=if7Dn7QrwR0cgO72HD1UnQNDaktRGUFTSOwgtQpD7AE=; b=C78ltvJqKaF6ri37y2EVoeE6IiUy6ltVBHZxw2Of27t5AnfkdcNorTiWvUc3oaxDF3 P7e2LQclK1gXSD0OCAU7nxenguO/dJPFKf4ObUGQPIP04mXWnSswUJKqWHk9/LV02xnF yZB1fh7eHGnDHqenqfn5BWX/IDV84DohMEvvApgN9BmVrBhzmsQsb/yZMqrBl8q+79Cu CKm1NnMW8T0XQUQmTjvHOKwbuKN7pc9jUJYJQ/UoWTodia4/zTc79vJblzSbIwhhw/JE hbCDlYC3VJvIVnVNs0drE294dB+xy0KVP0eSFsGmCX4iBZdNyN2zMbJyIVat6il9FKvZ jXcw== 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 h2si1908523pfn.191.2018.04.03.04.41.38; Tue, 03 Apr 2018 04:41:52 -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 S1755420AbeDCLkJ (ORCPT + 99 others); Tue, 3 Apr 2018 07:40:09 -0400 Received: from mail.bootlin.com ([62.4.15.54]:45508 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755319AbeDCLkI (ORCPT ); Tue, 3 Apr 2018 07:40:08 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id B7C5D20713; Tue, 3 Apr 2018 13:40:06 +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 8A9FB20384; Tue, 3 Apr 2018 13:40:06 +0200 (CEST) Date: Tue, 3 Apr 2018 13:40:06 +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 2/6] spi: sun4i: restrict transfer length in PIO-mode Message-ID: <20180403114006.u7tz2c7lvofsqwtg@flea> References: <20180329185907.27281-1-ssuloev@orpaltech.com> <20180329185907.27281-3-ssuloev@orpaltech.com> <20180403081041.3ully6bcyfwx2cx6@flea> <4390604e-092b-a89d-3581-b57ee9cbb6a1@orpaltech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aoxpu3mstcyx6fsw" Content-Disposition: inline In-Reply-To: <4390604e-092b-a89d-3581-b57ee9cbb6a1@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 --aoxpu3mstcyx6fsw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 03, 2018 at 02:08:43PM +0300, Sergey Suloev wrote: > On 04/03/2018 11:10 AM, Maxime Ripard wrote: > > On Thu, Mar 29, 2018 at 09:59:03PM +0300, Sergey Suloev wrote: > > > There is no need to handle 3/4 empty/full interrupts as the maximum > > > supported transfer length in PIO mode is 64 bytes for sun4i-family > > > SoCs. > > That assumes that you'll be able to treat the FIFO full interrupt and > > drain the FIFO before we have the next byte coming in. This would > > require a real time system, and we're not in one of them. > > AFAIK in SPI protocol we send and receive at the same time. It depends. The protocol allows it yes, but most devices I've seen can only operate in half duplex. But it's not really the point. > As soon as the transfer length is <=3D FIFO depth then it means that > at the moment we get TC interrupt all data for this transfer > sent/received already. >=20 > Is your point here that draining FIFO might be a long operation and we can > lose next portion of data ? My point is that, if you get another interrupt(s) right before the FIFO full interrupt, that interrupt is going to be masked for as long as it is needed for the previous handler(s) to execute. If you're having another byte received while the interrupt is masked, you're losing data. Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --aoxpu3mstcyx6fsw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlrDaBUACgkQ0rTAlCFN r3Qhhg/zB/QTUMcmQXwQBQgieWORjF9cUR+JElpDGfLaFLqguHcEU0f0GumhjiRx BfI1lrebeYs3zdlD8cXpr0kpDLtCpejykddxSaVXp8f6A17/MMSPCc3cxlpBDYxe L8sjak63UAP79YDcaf3F9dfdoKYkTx9uMgLiSZIMUiPzF9MHcaW79NuH/xgWUvvX WMjfkZlNz83YY0xtGj/uzP1t2kuxjqaZwBFfzkCdMg8E/QqzURyD6HVbVJBTgrvU OOsHzM2CvOgnEBAyM+E6VvYlyLDawJiGn6IaLf/5UEGlLL+5VJvRi7axQO5B7ApZ LupONp8VOWnhBjKTNinuMfGHaOdlq8pf9xH3jOYp9dZ6M3sQUuivJEqzGaus0HP7 j4yaF6LYpbsasJNs7ZjhztKnzXs0hgvC6VO/Rzy1jVJd6N5/7NOLjw53SWdfj1Hh AB6ig7ap/5JmROs1r4zetqBP3PdG536ADN8ckTbfb1nCcPV3QMAFzz87UrkKAWQO /EZQTqrTEOATtVAegc89H5LJiK/b9QXhu9wIp2HphPg5pwxhM1mFSNocEgXMUJyr iCjkolIAKjZ7K77s2KpfarRwSoag4Qpb1qhBFyHkDRZgB93OygBFY/anvgvDEMoy yB3UBTyKvpfmkdaviqqqY3kaJK7/dOTroqT5AhoeoEYoZYBfIw== =pVt6 -----END PGP SIGNATURE----- --aoxpu3mstcyx6fsw--