Received: by 10.213.65.68 with SMTP id h4csp409917imn; Wed, 4 Apr 2018 00:09:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Z6/3AB/HhntUeK7UHh7dzCOy79HgwQmFOYVo+MLtxwf0bPADwuDAifU0N7giWF0wa6BHv X-Received: by 10.101.102.196 with SMTP id c4mr1153884pgw.146.1522825780167; Wed, 04 Apr 2018 00:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522825780; cv=none; d=google.com; s=arc-20160816; b=FHbTjuQfhuXRTJ7bzItrXQbvy+3CaLfzJx116Mw2uub/2n9Zb8SXQMnI4K48W2NXIB JkgsVVocgiSOoTr7sP9xBiWIVOoZQhZ/jTJ41JeFgjYDJPt2xLYNiMp+veL79E7w13mf V1csj9w+6phjbseZqq/39v5UPdN11EP0dmf6Cza/S5PnDbHXVdhHOR0cJcRH8Wlc292e usviKHclNwAW3xvRjbrOzyV+X4o72aURb4ddCt6zl2PPp05oApZzSze8dDNk+/0JHklo RGDGA8isnKAco3TLWSVM9+MMXZe1MbJbH8lrsn2h9KoUx5KeN1t4OtTT6FOmcAWaeF+p GZLQ== 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=NqjnVtgIKHNW6xJ3R25a4xF1x82PRHnbHLgIAcrrKH8=; b=cMfjxFlt2G/JGB5AlUi/5T5w/ST57aBKVDK/TnZS++4j7UGezZO5k6mMtKEKJRcZDh /wkasfnBr1ZOIGFgtbp6A1uoGPFOUwFKaJz1LlbCZUKl9uDbdrbxTlqblm5czhAAvKmx 3pgcm10BzwTvBrq4z1Fs9LrvNUC/ktwWeK/AD5y4Uv7EZeBu24GMPKlcMNifCyaSt2fq cQTGV+OoxBKkHyp1GAy4CsCIkyCvEQ08Y6/TDp0SPbzK/DD6AAqLlXsx8I/LL5maJ+6p NE32CmaMUEy/D9NXNTJ++keTQ33y174rTGmpvjBq88l1Ts8yVQiMt5LKWtzutQXrUvaE GoXA== 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 d21-v6si2360471pll.557.2018.04.04.00.09.25; Wed, 04 Apr 2018 00:09:40 -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 S1751274AbeDDHIV (ORCPT + 99 others); Wed, 4 Apr 2018 03:08:21 -0400 Received: from mail.bootlin.com ([62.4.15.54]:38295 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbeDDHIT (ORCPT ); Wed, 4 Apr 2018 03:08:19 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 4F0B32070F; Wed, 4 Apr 2018 09:08:18 +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 21B1F2037A; Wed, 4 Apr 2018 09:08:18 +0200 (CEST) Date: Wed, 4 Apr 2018 09:08:18 +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 1/6] spi: core: handle timeout error from transfer_one() Message-ID: <20180404070817.6cens44jvlmdaxtm@flea> References: <20180403152905.1524-1-ssuloev@orpaltech.com> <20180403152905.1524-2-ssuloev@orpaltech.com> <20180403155224.GA11578@sirena.org.uk> <20180403161824.GB11578@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jixbiuhukrqgg4cn" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jixbiuhukrqgg4cn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 03, 2018 at 07:24:11PM +0300, Sergey Suloev wrote: > On 04/03/2018 07:18 PM, Mark Brown wrote: > > On Tue, Apr 03, 2018 at 07:00:55PM +0300, Sergey Suloev wrote: > > > On 04/03/2018 06:52 PM, Mark Brown wrote: > > > > On Tue, Apr 03, 2018 at 06:29:00PM +0300, Sergey Suloev wrote: > > > > > As long as sun4i/sun6i SPI drivers have overriden the default > > > > > "wait for completion" procedure then we need to properly > > > > > handle -ETIMEDOUT error from transfer_one(). > > > > Why is this connected to those drivers specifically? > > > These 2 drivers have their own "waiting" code and not using the code = =66rom > > > SPI core. > > Does this not apply to any other driver - why is this something we only > > have to do when these drivers do it? That's what's setting off alarm > > bells. >=20 > sun4i/sun6i drivers have let's say "smart" waiting while SPI core uses a > fixed interval to wait. >=20 > I can't say for every SPI driver in kernel, that's outside of my area of > expertise. I'm not sure what's specific about the sun4i / sun6i case here. Your patch doesn't have anything to do with the delay before the timeout, but the fact that we return -ETIMEDOUT in the first place. And I'm pretty sure that papering over an error returned by a driver is not the right thing to do. Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --jixbiuhukrqgg4cn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlrEeeEACgkQ0rTAlCFN r3RTyg/+LLCk5LJ18AFnqN1WDMGyPF5NEgPeSYBdWEoBlP79QTs5DKYzgK/CW8/I t3WkryZBNoBC0jb9NWa+YLjacANk4egs6hK7rY3kjkbIDx7Ni9QlEZpYFll0gZL9 f9mqE++6nIlS3qpFJNU+6g46NghIy0WhB3GhmXyzdb4meFMYo6KjiPLuqRSfjx2N CpZ0gzRTKPGPLj13q0ZPBqHAID5hhNIDG954rYBOKyZh+ykSG2pIH0Z98DB7XWau d3jBo50TI7XP3yEe3UkUlIgLa5j9PVIJyiZk9S2fDJqSeA7Oq5YLddkMsJtvsXcO WXW8lFUrRJLrVmaerz04ga98ad4JO8LiXyXuGGMYoj63dJ++cM7kUjjzGXiMzuBB jPDcUJaGZRV5mp2CzHpeecCtR0xPm0MquJcQp0tO7THWeSkttuqmb6MkJCMcEx9t o1NhKwYZc/hyKpFnIYeZRNIobscfouo5t5np7pB1W7N8jSSFCr6Nyiu/XLDHF+h3 VmigIkT7HkkcHyDgItFK5eiw0TY1yGJtq58U6CxsMLdRpyTM7eWCJRY4ofGmncwa c0d/eZ1QF6PLIlNCNxJMYSXa1iglLeXOuPUxj+fYzZPR7eiSXUFlwqAwFP21u2WD nGGSG8ySISUT/v8j9hrzPG0CKk5Lmo3mDZi72iVAHIDPdBoUyMM= =ZjNx -----END PGP SIGNATURE----- --jixbiuhukrqgg4cn--