Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37096247rwd; Tue, 11 Jul 2023 09:21:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlHeXgMTaRmfWXw03cFvCH1kBKULbnn06b9kk0ug0g/RBsR6wXOUzwAfSMFsRZpsNAVDR02B X-Received: by 2002:a17:90a:d484:b0:256:2efc:270e with SMTP id s4-20020a17090ad48400b002562efc270emr15586863pju.5.1689092478985; Tue, 11 Jul 2023 09:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689092478; cv=none; d=google.com; s=arc-20160816; b=NJf5eMOfc46z5MeabQKw55ou5bIT3F8/m0FUKU0FdLzEd6xH99NeetM2M8AthV+266 gN87AE/D5L7lpOlmz4zLNHjbp2AqXOxSMhOn1UV13hs6DBEgp58pPz7D5p8ZBkAwVtzj Jfp3qS6vvwyoLMFUpfmR8wmhAN3J5XUdCtAYc+VyApGAurirMOJPLpum4HAPfhWiDLxd L342+Rub9dYxHqEuvwywuF6qBHjX5dn7nCZnX+OIgVW5c0Qv/ByppxTyS0bqFNIaxytn RDc/D6Nb2QT/gqe9W1oH6jOiTTDbBu9DmQMfgC4i/5rykXCT01lvj/R2gJ+pT23YiNZb QoiA== 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=Rfrk1uyNxWMBBOGH5Jxn2umsc9+1UwzSvXH/XCQVTMk=; fh=FR1TuMeeSkO8NrfcwD6Pn+GCDkn3IwyNRlohVX/xlRU=; b=y0RGn/Q5Uad7EUkZJTZveCg2s09xVsta9LkAbEeYWn5V2rezz8UNxwBHoPYZtgA8JQ l45DjaBNX+J33BAlSzv03tR9jZCY9/tDaeD567buTYPmFJIfpjq6WSsmeLHJoGrDL49E PSpyRP3sntu47IEjNR61YY4o10tg7XV0U3Id+HgfOU5tpCnef7d+tcPR9iQSShg44lJI mYCHmnzCCzuZjNTgwmLygZfLR0fyna5OT1w99Ie4nRLb/8H6t3YzmqIZUI19Rcwkp2u4 0TVpzHZbKebjSBogWkM6Fu3uk43pjaf4R1Y3T89F5rVQyCdP8FpmYjvN12mvHAa2yFu6 x0LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tQcn8OvC; 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 np9-20020a17090b4c4900b00263cdc45e8bsi10539050pjb.87.2023.07.11.09.21.06; Tue, 11 Jul 2023 09:21:18 -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=tQcn8OvC; 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 S230446AbjGKPuM (ORCPT + 99 others); Tue, 11 Jul 2023 11:50:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233000AbjGKPuK (ORCPT ); Tue, 11 Jul 2023 11:50:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6594911D; Tue, 11 Jul 2023 08:50:08 -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 0250661549; Tue, 11 Jul 2023 15:50:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A565C433C8; Tue, 11 Jul 2023 15:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689090607; bh=Rfrk1uyNxWMBBOGH5Jxn2umsc9+1UwzSvXH/XCQVTMk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tQcn8OvC6bRBN7WzpsoGdLVO3L4xuskzngmmfRCEj2SQ0jAC+8jd5iN20p9gHRbpg XUbhNgU9wAusI4gCQRZQWpSdosA5W/FQG4z1AWEgo24Qhpez1zvl8Qd08L+UQadjys qOLdKWVQ3JbXYchCASI4opWSvhez0uMrvZY11sAMGFC7hweCIW8F+sFtyDKkG13nS0 BpkHBiCRn9aeI6z28Cfu2Vk50UunuJFeo1j1nrYJyD6L4Kr0GqQXWYq2XqyGdtwIe+ r8LZOFGfyssDNKEB3zOQjK+1KK7aegmO8dmKUMp5no+2+L0MPlqIAyMOrhHo2iXkMt IC4BE92YJ2DdQ== Date: Tue, 11 Jul 2023 16:49:54 +0100 From: Mark Brown To: Andy Shevchenko Cc: 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 , AngeloGioacchino Del Regno , 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> <5959b123-09e3-474b-9ab0-68d71cfdd9a2@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z/wyG6sqMhUk9SL4" Content-Disposition: inline In-Reply-To: X-Cookie: marriage, n.: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 --z/wyG6sqMhUk9SL4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 11, 2023 at 06:30:06PM +0300, Andy Shevchenko wrote: > On Tue, Jul 11, 2023 at 03:14:54PM +0100, Mark Brown wrote: > > Like I say we *should* be fine with the refactoring without this, or at > > least if it's an issue we should improve the validation. > For the speeds < 1000 Hz, this change will lead to the div by 0 crash. > It seems that the current code which this one removes is better than > the spi_controller_xfer_timeout() provides. > If anything, the spi_controller_xfer_timeout() should be improved first. > So, for now I drop this for sure. Maybe in the future we can come back > to it. I don't think this is the only thing that might fall over without a speed, what we've generally been doing (and do try to do with speeds, we already need to default in the controller's speed and so on) is to sanitise input on the way into the subsystem rather than trying to ensure that all the users are handling everything. --z/wyG6sqMhUk9SL4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSteiEACgkQJNaLcl1U h9DAYgf9GamF50fucbXVx/aZUwGY2hD+eGYGVpMwfSRhuUlWbnbam1vDqMkEllpk X95Rur4vRJQA8erYbUKnhyABsYUSGd8CKx8/mDgvePWDPlYZ3TkdMV8z/j59HZbA WhFO3yBSJzNOgDxpftw96yBP7l7eZZHabEpeUAOx+SZ04jtNfdnRHeHBIBKL+YUT eFnArWnhTo4dUwNTaAojL5Lfgos/MGY9ABY3b2E4ZkjSaHCUTOa2rxKo9zjc43tE gdVuQ8cvshKLUDx2CFZ4oux+stLEOfjcsmR0prxZp3q9t2ywp1CsOHBY1ndd/8Ds SnUGepjz95NgZBU7ewJoIuRhKJUQtA== =GGl+ -----END PGP SIGNATURE----- --z/wyG6sqMhUk9SL4--