Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37081464rwd; Tue, 11 Jul 2023 09:11:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmks90FNADYDhjhu1qzStFOWjqqIbFZnugcdbtAPPExnpiSs63SoLtDU2gUCB4Pc3ZRHpQ X-Received: by 2002:a17:906:3282:b0:991:f7cb:cc3d with SMTP id 2-20020a170906328200b00991f7cbcc3dmr13842823ejw.65.1689091886062; Tue, 11 Jul 2023 09:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689091886; cv=none; d=google.com; s=arc-20160816; b=aRbTMrMP3cDHjCNjrwsL74eJGRKpKK6ROB4mbFdsPC/+xEoM6YhlhqyX58oGD2un1j L4qHtgnQQwR+OyKMFv+E6egmaxZzYuBIUke8oK6N4RoleZKbUbsOh3GCn6xclaDIuKEJ vDKkBCjgtojEl5LdRITD2t+IEEE8Sn6HQoKTHWp3Oog7EWyE7a3wGsUjmCSyCD82/kJO 45ZlpO85YnGJN6GytnQtskPLs+xxc6t8gIAlEycF0u2kPR26Vq8NRtj+Ca4p/LI42/pi 8C6ob7yY2VpfN5MGs/E5QBplDXYr/V0Lr2TidrkeH8SmixCPfg5z5k0gAM5YNPfu/uV5 G73g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=r4r1AlvPQOrBvxNxQz1r1nEFum6Fk1/A9QT1lgD2iUM=; fh=xBut9vtegYDRcLjXNIseFeFa7BXxcdxb18VqmH8P67g=; b=fGnBQm4SoAuOv4hj1rY1snpWqX61GR5iYSAyqE5qcyWIpd2aC7eh5BO6t2QNoAEToT F/BRnbjRBnlaM26+P3F8jPnRpwGTWuWebc+pcSQRGL7244eDP25/veY0SbcQcuYM0dG7 1cORlpABogse0R5UW026RAew977HoG1woAxLs8ZOEGwEey290e3j7LU3UpgKCB80T04R 8iJ14+T6n34E0tmObtoy4dGATjsbQxGOh7s3esLIjBVrXnfvFWMHV4hpQ8qm06nHiDuF NbfPDeW/zsnH4XAOcY/8MDOjq+CL6gANOUsZ9FhRtVZhqCEAF8jqyMDi4DbJPYCP8Fbw XvVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hBr5izgD; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t26-20020a1709064f1a00b00992d0de8760si2302804eju.911.2023.07.11.09.10.51; Tue, 11 Jul 2023 09:11: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=@intel.com header.s=Intel header.b=hBr5izgD; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232209AbjGKPa1 (ORCPT + 99 others); Tue, 11 Jul 2023 11:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232179AbjGKPaZ (ORCPT ); Tue, 11 Jul 2023 11:30:25 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E0D136; Tue, 11 Jul 2023 08:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689089424; x=1720625424; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=WtKHEzd9TLb1fy9g0AvI3P/4wH5wHUCXn6+ARbR9U1s=; b=hBr5izgDJD/+xQBRT3DHHo56zIVWGr+PwRKeYslY6byoAX8dVJKP/IlP XY2wrXphIylhXd4071LpUGpDRQMvcVoheqR2xYz/VGZeg1ocw+At12Ode PTC74t9K5YYezReTYPdi0oDkc/r4Djo/4nZ5gRCaOUN1m4d3t/zLJe6Xq ptVaXtDqdCnfmUoyRk80WfAin8VYCXMblITX/1QZeF3sZhL4mF4qsSzh9 LDYiFacjAfODc99/FRomUQEFDlayLL1LDWMqsytLRRHjVZhB0ff9c6TOl QyJW3PUvicDt5m4ta+3WiJMbTZ535Wn09jYYEWE781W+LtuVQ9dAC9WKE A==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="428346794" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="428346794" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 08:30:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="698462660" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="698462660" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP; 11 Jul 2023 08:30:10 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qJFJX-001swf-0G; Tue, 11 Jul 2023 18:30:07 +0300 Date: Tue, 11 Jul 2023 18:30:06 +0300 From: Andy Shevchenko To: Mark Brown 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5959b123-09e3-474b-9ab0-68d71cfdd9a2@sirena.org.uk> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Tue, Jul 11, 2023 at 03:14:54PM +0100, Mark Brown wrote: > On Tue, Jul 11, 2023 at 02:01:13PM +0300, Andy Shevchenko wrote: > > On Mon, Jul 10, 2023 at 06:30:32PM +0100, Mark Brown wrote: > > > On Mon, Jul 10, 2023 at 06:49:21PM +0300, Andy Shevchenko wrote: > > > > > + * Assume speed to be 100 kHz if it's not defined at the time of invocation. > > > > You didn't mention this bit in the changelog, and I'm not 100% convinced > > > it was the best idea in the first place. It's going to result in some > > > very big timeouts if it goes off, and we really should be doing > > > validation much earlier in the process. > > > Okay, let's drop this change. > > 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. -- With Best Regards, Andy Shevchenko