From patchwork Wed May 15 09:51:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16929 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 578CF2396C for ; Wed, 15 May 2013 09:53:12 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id gd11sf2163059vcb.1 for ; Wed, 15 May 2013 02:52:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=fTX1hPlkYx5yQ8O8m/zxcmclffROdCqN7h7cb59RFsI=; b=GBPTRWTr0EcDhVA1n35ynrpWxwdLNmQED4LmhTGjgUsASttFRff6c177KT/AFpzE3l h5wvgaHNQJq0OrYM/vngw6o8tvU9l4vLHRxSZZIzvmGOZwRPwL1fTw0zosn3v3LacBG2 ttdUbb1xrxi4py41RPbywZTesiJlHJbmBs5hqlr2gKzxf6w2VtIK0NetzqA1rFSQc3JG LeiK/ButcCdLtA3cEpgfZVJhXQttyiDFEmazB8l6ML/+/WDOOTVI3quLz5/bPcyfTbFC 3xlFhEp+04AP+kI8WQ4B4JyQxBDtdepEZ2WS98NcKgSxEUWC/cAIWtgLf7CDyhcLRv2U wesQ== X-Received: by 10.224.42.141 with SMTP id s13mr23056731qae.3.1368611555645; Wed, 15 May 2013 02:52:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.16.164 with SMTP id h4ls593265qed.40.gmail; Wed, 15 May 2013 02:52:35 -0700 (PDT) X-Received: by 10.52.230.164 with SMTP id sz4mr21097378vdc.118.1368611555476; Wed, 15 May 2013 02:52:35 -0700 (PDT) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id di3si1032006vcb.51.2013.05.15.02.52.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:35 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::232; Received: by mail-ve0-f178.google.com with SMTP id d10so292961vea.23 for ; Wed, 15 May 2013 02:52:35 -0700 (PDT) X-Received: by 10.58.106.77 with SMTP id gs13mr3680705veb.22.1368611555275; Wed, 15 May 2013 02:52:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.217.15 with SMTP id hk15csp11337vcb; Wed, 15 May 2013 02:52:34 -0700 (PDT) X-Received: by 10.194.90.74 with SMTP id bu10mr2784221wjb.3.1368611554269; Wed, 15 May 2013 02:52:34 -0700 (PDT) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [2a00:1450:400c:c05::233]) by mx.google.com with ESMTPS id ey9si517718wjd.161.2013.05.15.02.52.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:34 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::233 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::233; Received: by mail-wi0-f179.google.com with SMTP id hq7so1415991wib.6 for ; Wed, 15 May 2013 02:52:33 -0700 (PDT) X-Received: by 10.194.120.193 with SMTP id le1mr2804692wjb.4.1368611553749; Wed, 15 May 2013 02:52:33 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id q13sm2898210wie.8.2013.05.15.02.52.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:33 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, balbi@ti.com, linux-usb@vger.kernel.org, linux-crypto@vger.kernel.org, davem@davemloft.net, herbert@gondor.apana.org.au, vinod.koul@intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones , Andreas Westin Subject: [PATCH 12/39] crypto: ux500/hash - Prepare clock before enabling it Date: Wed, 15 May 2013 10:51:35 +0100 Message-Id: <1368611522-9984-13-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> References: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkyUuNtczJCO2N8KtIx/YF1dH41OwUfdZGlwrJJ6aBbhLvMq+3DA+nstveHnr4hmlZ/cos1 X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If we fail to prepare the ux500-hash clock before enabling it the platform will fail to boot. Here we insure this happens. Cc: Herbert Xu Cc: David S. Miller Cc: Andreas Westin Cc: linux-crypto@vger.kernel.org Acked-by: Arnd Bergmann Acked-by: Ulf Hansson Signed-off-by: Lee Jones --- drivers/crypto/ux500/hash/hash_core.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index cf55089..4b02428 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1726,11 +1726,17 @@ static int ux500_hash_probe(struct platform_device *pdev) goto out_regulator; } + ret = clk_prepare(device_data->clk); + if (ret) { + dev_err(dev, "[%s] clk_prepare() failed!", __func__); + goto out_clk; + } + /* Enable device power (and clock) */ ret = hash_enable_power(device_data, false); if (ret) { dev_err(dev, "[%s]: hash_enable_power() failed!", __func__); - goto out_clk; + goto out_clk_unprepare; } ret = hash_check_hw(device_data); @@ -1762,6 +1768,9 @@ static int ux500_hash_probe(struct platform_device *pdev) out_power: hash_disable_power(device_data, false); +out_clk_unprepare: + clk_unprepare(device_data->clk); + out_clk: clk_put(device_data->clk); @@ -1826,6 +1835,7 @@ static int ux500_hash_remove(struct platform_device *pdev) dev_err(dev, "[%s]: hash_disable_power() failed", __func__); + clk_unprepare(device_data->clk); clk_put(device_data->clk); regulator_put(device_data->regulator);