Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3491503pxb; Mon, 4 Apr 2022 18:41:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwnzd8k2YsAyxqphjl3TpoW3kllAq7svEk3J9wNhTLaQ6mEpZcKd3mXXMADY0UNn+NJ/yF X-Received: by 2002:a05:6a00:15d2:b0:4fe:ff2:1a4d with SMTP id o18-20020a056a0015d200b004fe0ff21a4dmr1206041pfu.23.1649122897580; Mon, 04 Apr 2022 18:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649122897; cv=none; d=google.com; s=arc-20160816; b=Te5YRPCj2C8l+nYUUosjoDCMRufWZFupah6zSE9Pn/oVcChHlyB/wN5QGWtm3sAw1+ bLpSg+CcQE4qgtUIhYA5T/e6lSTuS0ifEiA7ImWy1nmqpgQ0fY4UtDX3kR+F5nq0QnEo eXnBritOJ/HcQ29XBxRPZPThae6dyTYGQHKsRZpI0TxZ+OqCLRGET42eoTCymaScczpC LmzUiAJQq8d70hegHm6pr7f5xHPv0FYhtqo+7VHzq/lNk1l15aG6o4tYPaiG146sIPS9 9NI4SuSaeFlrOCfVg/692UIshdFzqSRiiuPVuEvoVYLwDCg7QRDbUUTjCxL0qv5UD58k LYtg== 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=Zc6VIIFKcy+op7oiVyHdf8N32KwbpWfsc0NuQgZSdH0=; b=EbaALKu0wULVvmvsaq88EKw/dj0wV0CzldjLOktLMGSLgbG5nmjnvPtP5z9EmwaHAE PVih8DRn+a4I+DLVUtub+npVS/eVH7OwFJwTvLgIa3GV5SbADaGyjCxwJ7rvt/7HnIP2 gwTZ60AMorA8gK13LCey8VEvOxvYIGukSoiEkyznmveJHLxPeVq3/eUCASwE9P8JD5iE YJ1YX3YNcLF+KNhlEy4Gkwk3AxbC7DsEQuzaYyJqkv/hzGLAEjY7bADttj/tDd3VIj/r r0zeWvDSUWgaTnsop16axcwCKXRdoabwi3kfUtZcHp4OFMJHjOXag3ma0MXJcWFpm+oA QkXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@metanate.com header.s=stronger header.b=A09kS4qQ; spf=softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metanate.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q7-20020a056a00088700b004fac74c990fsi3157935pfj.366.2022.04.04.18.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:41:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@metanate.com header.s=stronger header.b=A09kS4qQ; spf=softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metanate.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A145C284E53; Mon, 4 Apr 2022 17:38:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233165AbiDDLk3 (ORCPT + 99 others); Mon, 4 Apr 2022 07:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359665AbiDDLk2 (ORCPT ); Mon, 4 Apr 2022 07:40:28 -0400 Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 427652DD0; Mon, 4 Apr 2022 04:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=In-Reply-To:Content-Type:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=Zc6VIIFKcy+op7oiVyHdf8N32KwbpWfsc0NuQgZSdH0=; b=A09kS 4qQJvDZkpFSIawTG5uMZmetjLA+RGO9CsRi4k2sbBzNeWaLiXery34BExS5su42r7muhdvrdM8WIQ x9KwpGUfSE2NDatySu4737MPqwRwtNiOED/1x+lPjJHTiOZC/BkXa91DXlY+JYYy5zhu8ZFYtQZ5K CuKq69Gq6O6Eg0yCb9motDhMhrLI9LGSQ/yF2UpHd6yHfs/wPEMzplvi2JxUHtACYQEq/XmM5dwv2 nw+6XDizcBR3gaE7Cilb9BabPVde3A0uq81yV2W12N7qgOBzuxhZn0zo2IkZGnBKwXNCZeZV4OEtp +NTMpxJjbuRIvHKTmSLwHnN7KGtqw==; Received: from [81.174.171.191] (helo=donbot) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nbL2S-000544-C8; Mon, 04 Apr 2022 12:38:28 +0100 Date: Mon, 4 Apr 2022 12:38:27 +0100 From: John Keeping To: Corentin Labbe Cc: heiko@sntech.de, herbert@gondor.apana.org.au, krzk+dt@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v4 17/33] crypto: rockchip: use read_poll_timeout Message-ID: References: <20220401201804.2867154-1-clabbe@baylibre.com> <20220401201804.2867154-18-clabbe@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220401201804.2867154-18-clabbe@baylibre.com> X-Authenticated: YES X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-crypto@vger.kernel.org On Fri, Apr 01, 2022 at 08:17:48PM +0000, Corentin Labbe wrote: > Use read_poll_timeout instead of open coding it > > Signed-off-by: Corentin Labbe > --- > drivers/crypto/rockchip/rk3288_crypto_ahash.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/crypto/rockchip/rk3288_crypto_ahash.c b/drivers/crypto/rockchip/rk3288_crypto_ahash.c > index 137013bd4410..21c9a0327ddf 100644 > --- a/drivers/crypto/rockchip/rk3288_crypto_ahash.c > +++ b/drivers/crypto/rockchip/rk3288_crypto_ahash.c > @@ -10,6 +10,7 @@ > */ > #include > #include > +#include > #include "rk3288_crypto.h" > > /* > @@ -305,8 +306,8 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq) > * efficiency, and make it response quickly when dma > * complete. > */ > - while (!CRYPTO_READ(tctx->dev, RK_CRYPTO_HASH_STS)) > - udelay(10); > + read_poll_timeout(readl, v, v == 0, 10, 1000, false, > + tctx->dev->dev + RK_CRYPTO_HASH_STS); This can be simplified to: readl_poll_timeout(tctx->dev->dev + RK_CRYPTO_HASH_STS, v, v == 0, 10, 1000); But shouldn't this be tctx->dev->reg ?!