Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2758025iog; Mon, 20 Jun 2022 04:15:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vXcMDRIk5Umj8htinyJLAJiASGv9d78GvjkxHXtnYvI2ov49Cg/BJNHt7BzWtQXNdQm2x1 X-Received: by 2002:a17:906:d550:b0:704:ae79:7db1 with SMTP id cr16-20020a170906d55000b00704ae797db1mr20468925ejc.478.1655723754248; Mon, 20 Jun 2022 04:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655723754; cv=none; d=google.com; s=arc-20160816; b=BAe/pQIPTAtTk+cRJmKoUsIwRU4Rvg5kGriNi9Pcs3Y0ay6nvGRzaXxEp2sT0FWffC XtONwrtg3L+XlIYigJ4FrnqhVq9rpdVEiRu1lycR/OxwkLUCs9cFoi2docnSVcXQv04e y2tMhkA4Vs1SCe+gZWXPDv9WTgFT5g0cjrVlAD4/CmY1VEwxkTSvUtTHZg0JRcUkJKRe 0ok8+0joed82aD5f/oqPsZVZqISyIh1wEIVJp1qsU87CtO3FwJ7kVpHfym/Qb7J+dkjz YFhVJeJJ9M/Wfql4MIA3b5u7y294e3J0+eUGGALccfSKG+HODrrp9/usFkFQN1t2gCEa zw/w== 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=JtWYZV1ZUB9zWxnOO4bgicY4RQzn+QgQFFTY9VvrXQw=; b=XMByNUgK9qcG1aRjdNoa+BchcQFxcFTR2+W9tvpVU76F7d33Xheeu+3/V1bGJYVZ5v hmhITjtRaT1UBaJI4zrBV7OzzxpZCSeMemLb3lpEWZxXfQmSaPm+7ZTTZX36RxUvUm1y eEfR5Jkrxu0XBrUXJxCct9Yk+kQjyC/bFm7WtygtlNh9x9P+3bzdO0nrDD+7p3Sl8WEq 7X47IuJlBtuXXhrJVO689Af9v6HBHUdlo+iRMRSWOR6WduWMHv2onF1+viYiKkJp7ZK4 xZnAdKSdVaUcMriq+3lSkifsniUJrUenFGxMGQwTvC1MVzty4z7f1amHhZlrKfpx/E2s Lnow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@metanate.com header.s=stronger header.b=n8sIgXF3; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a05640250c900b00435816c8ad5si2836972edb.595.2022.06.20.04.15.27; Mon, 20 Jun 2022 04:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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 (test mode) header.i=@metanate.com header.s=stronger header.b=n8sIgXF3; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metanate.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241201AbiFTLOn (ORCPT + 99 others); Mon, 20 Jun 2022 07:14:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233263AbiFTLO1 (ORCPT ); Mon, 20 Jun 2022 07:14:27 -0400 Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2162518383; Mon, 20 Jun 2022 04:13:18 -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=JtWYZV1ZUB9zWxnOO4bgicY4RQzn+QgQFFTY9VvrXQw=; b=n8sIg XF3SiOc5XAmJlqEPRH9w4T59X6m+7fZ5y/F/Qb6F7qWo0h1ajoVkArF7YcYfpp+TZQF4c7i1aJubw LqhGrGilz8QDOo/hoZUC2DO0heXPlc3eC+RbrCVvOVaoxDNANduUUyMy/t1a12wzWtcnFs6yOoh9J DUlSHMLnjeqXeunHjxFjtL0izeiyMyfr3Q6f0h0RhFGWSHaQJhd+dVwtpGX31R6WM1ybVzm32DjMG DzNcZLqUbbMtWjdn57XS9KRslbU+ZvrvpAPiA9ibsWTccyd4rYC0Ukwo6Um+iP77+PCsyopPTGamH vxvHbVfim8mrn9zqJS5N+kBJZKQhA==; Received: from 92.40.170.2.threembb.co.uk ([92.40.170.2] helo=donbot) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1o3FCk-0002O9-Hw; Mon, 20 Jun 2022 12:04:26 +0100 Date: Mon, 20 Jun 2022 12:04:24 +0100 From: John Keeping To: Corentin Labbe Cc: heiko@sntech.de, ardb@kernel.org, herbert@gondor.apana.org.au, krzysztof.kozlowski+dt@linaro.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 v7 14/33] crypto: rockchip: handle reset also in PM Message-ID: References: <20220508185957.3629088-1-clabbe@baylibre.com> <20220508185957.3629088-15-clabbe@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220508185957.3629088-15-clabbe@baylibre.com> X-Authenticated: YES X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS, SPF_PASS,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 Sun, May 08, 2022 at 06:59:38PM +0000, Corentin Labbe wrote: > reset could be handled by PM functions. Is there any further rationale for this? After this change there is no longer a guaranteed reset pulse on probe since the reset control may already be de-asserted. This is normally the most important case for a reset as it's the only time when the state of the hardware is unknown. The original use of devm_add_action_or_reset() seems a bit weird already since there doesn't seem to be any need to assert reset when the driver is unloaded. > Signed-off-by: Corentin Labbe > --- > drivers/crypto/rockchip/rk3288_crypto.c | 19 ++++--------------- > 1 file changed, 4 insertions(+), 15 deletions(-) > > diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c > index d9258b9e71b3..a11a92e1f3fd 100644 > --- a/drivers/crypto/rockchip/rk3288_crypto.c > +++ b/drivers/crypto/rockchip/rk3288_crypto.c > @@ -73,6 +73,8 @@ static int rk_crypto_pm_suspend(struct device *dev) > { > struct rk_crypto_info *rkdev = dev_get_drvdata(dev); > > + reset_control_assert(rkdev->rst); > + > rk_crypto_disable_clk(rkdev); > return 0; > } > @@ -81,6 +83,8 @@ static int rk_crypto_pm_resume(struct device *dev) > { > struct rk_crypto_info *rkdev = dev_get_drvdata(dev); > > + reset_control_deassert(rkdev->rst); > + > return rk_crypto_enable_clk(rkdev); > } > > @@ -222,13 +226,6 @@ static void rk_crypto_unregister(void) > } > } > > -static void rk_crypto_action(void *data) > -{ > - struct rk_crypto_info *crypto_info = data; > - > - reset_control_assert(crypto_info->rst); > -} > - > static const struct of_device_id crypto_of_id_table[] = { > { .compatible = "rockchip,rk3288-crypto" }, > {} > @@ -254,14 +251,6 @@ static int rk_crypto_probe(struct platform_device *pdev) > goto err_crypto; > } > > - reset_control_assert(crypto_info->rst); > - usleep_range(10, 20); > - reset_control_deassert(crypto_info->rst); > - > - err = devm_add_action_or_reset(dev, rk_crypto_action, crypto_info); > - if (err) > - goto err_crypto; > - > crypto_info->reg = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(crypto_info->reg)) { > err = PTR_ERR(crypto_info->reg); > -- > 2.35.1