Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4737301iob; Sun, 8 May 2022 23:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYlXobYOs8/nEWZrT/mHUPlQOjnQAa7C06NDWmxSdFdxNYr+E00oxcJqBpDmlnYw5v4wAM X-Received: by 2002:a17:903:248:b0:155:ecb7:dfaf with SMTP id j8-20020a170903024800b00155ecb7dfafmr14960924plh.84.1652078794526; Sun, 08 May 2022 23:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652078794; cv=none; d=google.com; s=arc-20160816; b=VVOzymLp5Tc2Yk1sMkU/q0GXhk/lniS9W9wNxHUJw+2wIo8KMY+OIWt+EnVslIZsaA YyhPo2uTOKLgUxG2huNOmURNfu/ce8ZPoVQHl6cwvG6EpdzJwGSviHrGp6aLPhVKoUhQ g2s2LHAQSLiH58rOfTpRGum0AV+e9EeIFGHrXdMnB2irk2q7ipVQR0qeWk7F48XOWRxc xd7dicoD8RH48UCSbXIrGaqBzOBbgVAQHLjrbEUD0X9xOY91+nGpJs/3pmG/JWUtUIIZ bzmymqirNcdbs5k3LXtWA7aE9RivuuFVWI7AGPTjoMjyjGQvyR6tOsIU1uSWpOFZhwSm 7ZxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R5vq5Bgg0GZnREfAKsIq2BCzfZlNqniOuDOVX7ptgS8=; b=p540RxwP+FtfoNlVLv+0GC6udkt8w9lKmErEcJ0XXuMXoTycd/pPfL9fFg3dSv6kIy EqvOHaZjjmHjpyly0oxlMeR4C1Tk/Tem8H5t/zLUYJ+ai8yrAJ7UNLDFZKt6y/inh+14 1HtKo4JCpSf0foBmRW/D/7uVVk2Y8zDF7zMqVZ7ra5Tl+6sEiEU9KqtZPTSWSLSNIwez 9x5DOg2gNxAacVP+qH1PMSWJ7jD9UeX0oUZlCE4cp0IK4Qc2XN3v9qje3svtNjnyO2fS Bhmx7FxrF7azaQVYsPbxK2KgBSdcdWhmPGpcgjRFMOY64OXSXBPznRO2ScbuZAVOxaXy b9hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=JM69r6XB; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mw1-20020a17090b4d0100b001cd6a811925si15159093pjb.48.2022.05.08.23.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:46:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=JM69r6XB; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D64611369B; Sun, 8 May 2022 23:41:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbiEHTVu (ORCPT + 99 others); Sun, 8 May 2022 15:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237238AbiEHTEW (ORCPT ); Sun, 8 May 2022 15:04:22 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D50DFA6 for ; Sun, 8 May 2022 12:00:23 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id o12-20020a1c4d0c000000b00393fbe2973dso9661444wmh.2 for ; Sun, 08 May 2022 12:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R5vq5Bgg0GZnREfAKsIq2BCzfZlNqniOuDOVX7ptgS8=; b=JM69r6XBahlTafzNdFRMQ1zAiMSwqONkuy9jTWoq4dOtKpEQTtc4Z9JnYmHyCxVRZX 78YFg923+WPzFGVNs+Hh2YvCfgzWoV6BqgfF2DHvAQJgfHbk+mZ6b8mLNVdwRWxbXHLY 2V0+26mKwFr2aM6fpbMVOb5SVsV+nRRXv+18LoiPaxOo4lQ+j1C7NMHavr+ac/UsFr3z xyEzJhII5AHAeoXsvKU5ve+pMrWl06AFrpn3LQZc4RGFxOF3FaZ1ZLjps9WrDgiQUYcM 2BoRqu5UpP9V19J43GDtRI+sMHk6XTjB0qPhBOQer+HEBd6n4FPg/o7mt5y1t80tfpNo f2mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R5vq5Bgg0GZnREfAKsIq2BCzfZlNqniOuDOVX7ptgS8=; b=JK6A+tgvVBGMFqR70kDcDxUh6Lc+596e845K21UFUlUtz9mWZ2cWEFRaihjP/WsPdY toViugBTlLc25q7GCHh4rkel7hwFgWK2DEcy02v9R5YCl2ezHrQXOsBmzYkZVX6W12X7 l9bDcJWRygc3WNfpzj5cB0bv9i+TRAjzP5hqv1nvJ7aZNyhD7FNJ25SryR9E8TLcUCue wO5exb2TcQgXgocnIEkqnsGy1YFhTF2Xpkcv/c9X+Pt3FlaIBsTXrddaM7ECQ8wLqyC+ JlDo1ORLyRlSPSNLKsCiGUpCop7nWz6UPAZ0RrvFozD3tpLXnXhc6vGXGaodpVuEMFzj eH+g== X-Gm-Message-State: AOAM530cD/rfJ7hiQ73PSiAwhlQWWmRaZLv4CC7BnOye5ffNK4I9kniH ywANKFuT6plKhbG9voMkhm47hg== X-Received: by 2002:a1c:e916:0:b0:37c:f44f:573 with SMTP id q22-20020a1ce916000000b0037cf44f0573mr19376737wmc.179.1652036422599; Sun, 08 May 2022 12:00:22 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id n16-20020a05600c3b9000b00394699f803dsm10552348wms.46.2022.05.08.12.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 12:00:22 -0700 (PDT) From: Corentin Labbe To: heiko@sntech.de, ardb@kernel.org, herbert@gondor.apana.org.au, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org Cc: 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, Corentin Labbe Subject: [PATCH v7 17/33] crypto: rockchip: use read_poll_timeout Date: Sun, 8 May 2022 18:59:41 +0000 Message-Id: <20220508185957.3629088-18-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220508185957.3629088-1-clabbe@baylibre.com> References: <20220508185957.3629088-1-clabbe@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 Use read_poll_timeout instead of open coding it. In the same time, fix indentation of related comment. Signed-off-by: Corentin Labbe --- drivers/crypto/rockchip/rk3288_crypto_ahash.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/rockchip/rk3288_crypto_ahash.c b/drivers/crypto/rockchip/rk3288_crypto_ahash.c index 137013bd4410..1fbab86c9238 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" /* @@ -295,18 +296,17 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq) sg = sg_next(sg); } - /* - * it will take some time to process date after last dma - * transmission. - * - * waiting time is relative with the last date len, - * so cannot set a fixed time here. - * 10us makes system not call here frequently wasting - * efficiency, and make it response quickly when dma - * complete. - */ - while (!CRYPTO_READ(tctx->dev, RK_CRYPTO_HASH_STS)) - udelay(10); + /* + * it will take some time to process date after last dma + * transmission. + * + * waiting time is relative with the last date len, + * so cannot set a fixed time here. + * 10us makes system not call here frequently wasting + * efficiency, and make it response quickly when dma + * complete. + */ + readl_poll_timeout(tctx->dev->reg + RK_CRYPTO_HASH_STS, v, v == 0, 10, 1000); for (i = 0; i < crypto_ahash_digestsize(tfm) / 4; i++) { v = readl(tctx->dev->reg + RK_CRYPTO_HASH_DOUT_0 + i * 4); -- 2.35.1