Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36858216rwd; Tue, 11 Jul 2023 06:38:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlFUgFzGZqLxE1sofPgA2zSE/pEgRR7owWaZFAIJYUk7cL/UKcE9eXRuZWwcha/jaToi3Qap X-Received: by 2002:a17:90b:1b4b:b0:25b:b2ba:2ff4 with SMTP id nv11-20020a17090b1b4b00b0025bb2ba2ff4mr12203308pjb.17.1689082705351; Tue, 11 Jul 2023 06:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689082705; cv=none; d=google.com; s=arc-20160816; b=svphjrVpvUtMBB0aCDVvsINdExnrgLos/bex6RmNcpNfoTFgTuu1DW3ug4mWkr+her yIBWrfBgSpOFyxf8k1hKJWgR1Z5RAn+AgQBYPeUKSxVi6N1FspmWDbTacMYVBqbMHmX7 Ih7Dpcf4kO3xIHsNZvhavyFLL9ucUlhj+4Mr/rirhtqt241YzdPmBqzuTqwMA0qOL7ft McMH0CowuVY6NhUHwxKGNVpNc4d5uLC48FfBtripYPqmOJ6Ap03GAVlj5RUHsOHUWpZ6 JPm8az8DhY23kPY4AVOLNTcvv3rM0eCh9vanEuOLRcRs7iTQv6W3ovAg6jXq07+KWewV XEIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WH1J3lxbYmwK4HX/vwQvN/bDM9AadSAUZU8trUClhmQ=; fh=TgUCc3epIGddJGb+FVJRuTrgRF0NFoufOkHnf8z+394=; b=dAPf+AKuTU951SaL09qk5cTpREaEdY0cOPIQaf92Bmwa/1LZRHoe1LHFjbBBYvYZrR adXfHzgZEm8ZK7DjKCAX6tSyvqzGyj9LQR5WWhrG9sd5aa+kDXC8Sw1dzk2q4MOTBJgq MBD/8RfDqdbQUQE/tDW7VerChAWRjlAFPG+A71sqZkcFNheS/TmbK3kNxoWsKIahGk8H 8Q3ppIJVRu7cbfjD6ZjFCCTC2Der3HFnGpPZfqn0VA1rOckJ9aSumMavO8DjJAiMubDx 2g1BWZg7uD0gkUJi0RzsURmdr3PBdZsEJ8gN2Q/RtBHFakHLY67B36eFucJuiIX59Fh4 XbWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BO5Sf+xL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a17090a9b0400b00263dccf9202si1559426pjp.156.2023.07.11.06.38.12; Tue, 11 Jul 2023 06:38:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BO5Sf+xL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232254AbjGKNFf (ORCPT + 99 others); Tue, 11 Jul 2023 09:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbjGKNFe (ORCPT ); Tue, 11 Jul 2023 09:05:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6240393; Tue, 11 Jul 2023 06:05:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E3617614BF; Tue, 11 Jul 2023 13:05:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE23AC433C8; Tue, 11 Jul 2023 13:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689080732; bh=HnVEva2jdOLXu3EN/cKYarAoyETVmcXrgG0CY9KCvZQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BO5Sf+xL4FaASSNsNdM5EGXByrv4WeTUxRBoPW2QNejIwlELvXTu5gKKqv4hkKhGg oi3ZfR9Shzo5QwnSHTFndf8ZIVkqpTClpssosTOBH6/4HIjVrlXO3KdynsW5+Pg7kp pbkKvKQx6ir3yg7CLJDoLHQzo0ewO66SzIeDifz9SCJzdBAZAn9RpEQzQEGNZHOmt+ 6tOI/PPlmxZBFom+gGGjOjy+qrSc5cI26iueLs1Gv6DR2sYD26rubxcFZS48+8Dw/G 5SSyFU8wEM4MuZLWsQU4tXLcKI+0ehoZc3/OitBA10N/7/7vB38b2KMdMwG1AhcrlN +CUurb7ZrrwoQ== Date: Tue, 11 Jul 2023 14:05:18 +0100 From: Mark Brown To: AngeloGioacchino Del Regno Cc: Andy Shevchenko , Cristian Ciocaltea , Yang Yingliang , Amit Kumar Mahapatra via Alsa-devel , Neil Armstrong , Tharun Kumar P , Vijaya Krishna Nivarthi , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org, Sanjay R Mehta , Radu Pirea , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Tudor Ambarus , Serge Semin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Matthias Brugger , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heiko Stuebner , Palmer Dabbelt , Paul Walmsley , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Max Filippov , Steven Rostedt , Masami Hiramatsu , Richard Cochran Subject: Re: [PATCH v2 04/15] spi: Replace open coded spi_controller_xfer_timeout() Message-ID: References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> <20230710154932.68377-5-andriy.shevchenko@linux.intel.com> <83c4b75a-06d7-9fca-ffa0-f2e6a6ae7aed@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="925w7TTgRoHZtFsT" Content-Disposition: inline In-Reply-To: <83c4b75a-06d7-9fca-ffa0-f2e6a6ae7aed@collabora.com> X-Cookie: marriage, n.: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --925w7TTgRoHZtFsT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 11, 2023 at 10:28:13AM +0200, AngeloGioacchino Del Regno wrote: > Il 10/07/23 17:49, Andy Shevchenko ha scritto: > > + ms = spi_controller_xfer_timeout(ctlr, xfer); > I agree on using helpers, but the logic is slightly changing here: yes it is > unlikely (and also probably useless) to get ms == UINT_MAX, but the helper is > limiting the maximum timeout value to 500mS, which may not work for some slow > controllers/devices. The helper is limiting the *minimum* timeout value to 500ms - it's using max() not min(). The idea is the other way around, that for a very fast transfer we don't want to end up with such a short timeout that it false triggers due to scheduling issues. --925w7TTgRoHZtFsT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmStU40ACgkQJNaLcl1U h9B+yQf+KBYXJ7506wC0Am0zY2LnPrpwi7/uhVWQsN9GzhBVU0RGwam2xuqmpCeo A3o92lqKSQPkQGllTlnuM3r4jp2qDy1/U/QJJxak+i/i8NjuVxIQQIKtnM/nRQxh yRpIp6WbVt+HJsdFgPS6j6r/3m1qS4eTbso7/ciwLzdRc2Yxk9SLXFteOErlAEoq hhR7VxhID4BE72a+1NbyuALEVGjSMYBdpddD//Qa1UsJVw1yK5HuM51CaQd9bTlo EtrmXMgaG9FB+lQeu2zedT6HTQQH/hOB77luYq4zGm849tw2sfBPIhqVgQtkkutv 4hpXSMiuD+iL32PThXfathhu4xvFiQ== =l6sR -----END PGP SIGNATURE----- --925w7TTgRoHZtFsT--