From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3064CC433E0 for ; Wed, 10 Mar 2021 07:21:26 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC5CB64FEE for ; Wed, 10 Mar 2021 07:21:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC5CB64FEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=metafoo.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 78EA247A19; Wed, 10 Mar 2021 07:21:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3yRVWJAgxsnv; Wed, 10 Mar 2021 07:21:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 19CD54EC1A; Wed, 10 Mar 2021 07:21:24 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1DE581BF47E for ; Wed, 10 Mar 2021 07:21:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0CA6C6F48A for ; Wed, 10 Mar 2021 07:21:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=metafoo.de Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4UovPbUx6nAG for ; Wed, 10 Mar 2021 07:21:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from www381.your-server.de (www381.your-server.de [78.46.137.84]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0D5516F488 for ; Wed, 10 Mar 2021 07:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=qz+v/U8OfCpTcBxQ524rjA3+edB4w4v2XAKWVao9tZw=; b=NOcAydZc5yBZM0Muwj7fz+C8N6 MLVX5u/dL4dKLslXt9sIydO9khfqiXZy8yYjcv1kT6LDVjL/8hiWkYVoIrzv4E/HCeSH7Qjdz3Fa0 jVoOH/9yqvIniidnNF7Nsziu54b/eKK9jz9QFQVAO2ICDFZypDI04wgSKrt1D5SX06TIqupGjiq6y d/71t5fC8hQOTrGNz6/jHWJmo37Ix9C6lsRdQx8RKT+nwmWuuCdc8beN5t4DnJemOfoxj8mzUEYlh XWZvpdDGVsG/PFnkQFgSwOylKlq7ODZf4TnzXtJn691AbSdy+LIzbbdsAJlFF4pFr1zkpUDM83kqI /BUNDg1g==; Received: from sslproxy03.your-server.de ([88.198.220.132]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lJt9f-0001ZM-Fz; Wed, 10 Mar 2021 08:21:15 +0100 Received: from [62.216.202.180] (helo=[192.168.178.20]) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJt9f-00041w-55; Wed, 10 Mar 2021 08:21:15 +0100 Subject: Re: [PATCH 01/10] spi: spi-axi-spi-engine: remove usage of delay_usecs To: Alexandru Ardelean References: <20210308145502.1075689-1-aardelean@deviqon.com> <20210308145502.1075689-2-aardelean@deviqon.com> <8a6ec9a1-71f8-ce1d-600a-66eba9244a54@metafoo.de> From: Lars-Peter Clausen Message-ID: Date: Wed, 10 Mar 2021 08:21:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.102.4/26103/Tue Mar 9 13:03:37 2021) X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, elder@kernel.org, gregkh@linuxfoundation.org, ldewangan@nvidia.com, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, linux-spi@vger.kernel.org, greybus-dev@lists.linaro.org, broonie@kernel.org, bcm-kernel-feedback-list@broadcom.com, vireshk@kernel.org, linux-tegra@vger.kernel.org, f.fainelli@gmail.com, johan@kernel.org, thierry.reding@gmail.com, linux@deviqon.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On 3/10/21 8:16 AM, Alexandru Ardelean wrote: > On Mon, 8 Mar 2021 at 18:42, Lars-Peter Clausen wrote: >> On 3/8/21 3:54 PM, Alexandru Ardelean wrote: >>> The 'delay_usecs' field was handled for backwards compatibility in case >>> there were some users that still configured SPI delay transfers with >>> this field. >>> >>> They should all be removed by now. >>> >>> Signed-off-by: Alexandru Ardelean >>> --- >>> drivers/spi/spi-axi-spi-engine.c | 12 ++++-------- >>> 1 file changed, 4 insertions(+), 8 deletions(-) >>> >>> diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c >>> index af86e6d6e16b..80c3e38f5c1b 100644 >>> --- a/drivers/spi/spi-axi-spi-engine.c >>> +++ b/drivers/spi/spi-axi-spi-engine.c >>> @@ -170,14 +170,10 @@ static void spi_engine_gen_sleep(struct spi_engine_program *p, bool dry, >>> unsigned int t; >>> int delay; >>> >>> - if (xfer->delay_usecs) { >>> - delay = xfer->delay_usecs; >>> - } else { >>> - delay = spi_delay_to_ns(&xfer->delay, xfer); >>> - if (delay < 0) >>> - return; >>> - delay /= 1000; >>> - } >>> + delay = spi_delay_to_ns(&xfer->delay, xfer); >>> + if (delay < 0) >>> + return; >> Bit of a nit, but this could be `delay <= 0` and then drop the check for >> `delay == 0` below. > hmm, that's a bit debatable, because the `delay == 0` check comes > after `delay /= 1000` ; > to do what you're suggesting, it would probably need a > DIV_ROUND_UP(delay, 1000) to make sure that even sub-microsecond > delays don't become zero; Ah, true. Lets keep the code as it is. On the other hand you could argue that we should round up to ensure the delay is at least as long as requested. But that is something that should be changed independently from this series. _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel