Received: by 10.213.65.68 with SMTP id h4csp3446594imn; Tue, 3 Apr 2018 05:14:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx49HCVBRePayKZTn9o0RSJt5mNxotXDdseCT7EbRjawFsC8nEZ4dlzZKBKtbtEYt9IfWD47P X-Received: by 2002:a17:902:481:: with SMTP id e1-v6mr13858761ple.377.1522757669185; Tue, 03 Apr 2018 05:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522757669; cv=none; d=google.com; s=arc-20160816; b=Jn1b4ZbBQdJ5YMTn8ibyZJ9ft6bLYdkcseZexPa9b0L7ji0hH4/ZXf0facwbgx2oPX fdDJkmPLlpdJ8b7Lpc/duUmOZVMsvE/toq6bAHsRP94VyQfWWX2PfPFO+vrHI5+OoV+s VhnkfYpTJY35T55i4bw17r4UdX8fln/zFRHsMKGJebMA0ww+aUd9wng7d9AUlhS4iYgh BeaAHYpIcplyICAOZCcPC4c9Lb5NKsGShLqVSm25yDGbgETvt+lX4bvoOcpQvYab68km BYKXSclCqt2tbnQm+SYk06ubNmXs6g5dFmcGi3N+lxvy/WrtKzdwDHITpteuDewJi0sw 4k2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=I8j5uO8m/S4Riwu+/mFAgOAZffLbcCi9ElDM/NzSJqI=; b=zt8qvjjUaOWE7nlByjby1dIZnD0kLgIYFjqIWEMbcOF/08bxH1Iien8n8uw1UQ425y 1ks34okUh3l149U3uRNJfR2uymXnMKYmrZyLjWvwrg8gal6rpo4ZSz1Cxb0ql3n+3pVj TYVov6MaCZKyeVh9lrQwcBmH36rt8ovgMcZYNNdbaNPOYMjcpebo26yk0T0lrP1G3jSG WXwQ37+RyT73X48vK+I87Oy6+auBqNilt7EM2jD6cOB4e4hUrwjxA9siME0Wg6sOe2Va Lz4w5ftG1bvJMK2/6HJQ9kpv3hXIWiUksOPlGchrSHJZ7Q0rdJAyFmDAfvEvFb+8f9k9 +wPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@orpaltech.com header.s=mailru header.b=c4FCZQ3e; 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 z20si2032027pfh.251.2018.04.03.05.14.15; Tue, 03 Apr 2018 05:14:29 -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=@orpaltech.com header.s=mailru header.b=c4FCZQ3e; 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 S1755475AbeDCMMv (ORCPT + 99 others); Tue, 3 Apr 2018 08:12:51 -0400 Received: from smtp15.mail.ru ([94.100.176.133]:50750 "EHLO smtp15.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755300AbeDCMMu (ORCPT ); Tue, 3 Apr 2018 08:12:50 -0400 X-Greylist: delayed 3838 seconds by postgrey-1.27 at vger.kernel.org; Tue, 03 Apr 2018 08:12:49 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=orpaltech.com; s=mailru; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=I8j5uO8m/S4Riwu+/mFAgOAZffLbcCi9ElDM/NzSJqI=; b=c4FCZQ3e9qcn/xWS4y5xiCvVMQ3BogQkG10j81QauS6t14DK9kBOnm5nzPivyiRVVX3poddyjlAs1Y5xqcCW+TUjwU8XgMhrD8Frid4adYK2uU1aYo3jqbE2GgGrkb0poClCUpYBPt9ce1KOHJ4QZ51f/BgOTSX7qg0qlUuGET8=; Received: by smtp15.mail.ru with esmtpa (envelope-from ) id 1f3Knv-0007DW-MS; Tue, 03 Apr 2018 15:12:48 +0300 Subject: Re: [PATCH 2/6] spi: sun4i: restrict transfer length in PIO-mode To: Maxime Ripard Cc: Chen-Yu Tsai , Mark Brown , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org References: <20180329185907.27281-1-ssuloev@orpaltech.com> <20180329185907.27281-3-ssuloev@orpaltech.com> <20180403081041.3ully6bcyfwx2cx6@flea> <4390604e-092b-a89d-3581-b57ee9cbb6a1@orpaltech.com> <20180403114006.u7tz2c7lvofsqwtg@flea> From: Sergey Suloev Message-ID: <34b3af7e-8e05-b131-d3ac-4920daf6343a@orpaltech.com> Date: Tue, 3 Apr 2018 15:12:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180403114006.u7tz2c7lvofsqwtg@flea> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Authentication-Results: smtp15.mail.ru; auth=pass smtp.auth=ssuloev@orpaltech.com smtp.mailfrom=ssuloev@orpaltech.com X-7FA49CB5: 0D63561A33F958A5AAA831C4D1275B73B582B4C635EB0959EE928EAF31F0B597725E5C173C3A84C30584FF81F342DA076FACFDC58F4FDB698CCB3ED2A1DE2304C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F5D41B9178041F3E72623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-Mailru-Sender: C5364AD02485212F3ACDC11E67D84917CD963AD9F8FACFE52ECB286ACEAC7BBA069BFC61DABEEB110841D3AAAB1726C63DDE9B364B0DF289264D2CD8C2503E8C22A194DADEED8EEDCA01A23BA9CD1BE7ED14614B50AE0675 X-Mras: OK Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/03/2018 02:40 PM, Maxime Ripard wrote: > 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 <= FIFO depth then it means that >> at the moment we get TC interrupt all data for this transfer >> sent/received already. >> >> 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 > > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ok, I am going to put back 3/4 full handler then.