From patchwork Fri May 3 14:32:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16667 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f197.google.com (mail-gh0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E3A9923905 for ; Fri, 3 May 2013 14:34:50 +0000 (UTC) Received: by mail-gh0-f197.google.com with SMTP id r20sf2522770ghr.8 for ; Fri, 03 May 2013 07:34:41 -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=vSWoYkljOOMehI0WDrXVusgiRBmaL9gfblOx24IdQ7Q=; b=QeNsCY2/Fn1ewNZb4gbjHFI9om6q1SV69asP3EacsRM1SiRFFQAJQ03viE5hgwek1Q R/WCYkJvjdoAABZkwUWJYFScKQ4r4e9uYXtVY3s75vNjKq2yLFt/z8uabatjq0fuc/++ TiIl9+tke15TsaQWe4C91/fVi8x5SJDEv73QzZFBm3IkQruFNXb1WqVc2CDHXIaiamBF IaAn0SDRCKcgTSFIe8cim4VmCOy7qaDyN/OK6PfooOd3VmmdPojKIbWX2K3VxmT1YYiC MntdUTU5GnYhZziSij++ftINLhdT4ErI4tqyoRJDjW5YUOWkbXq3x5oARhPkyKubI8xe 4a0Q== X-Received: by 10.236.128.207 with SMTP id f55mr8665295yhi.28.1367591681072; Fri, 03 May 2013 07:34:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.28.70 with SMTP id z6ls1436995qeg.91.gmail; Fri, 03 May 2013 07:34:40 -0700 (PDT) X-Received: by 10.220.91.17 with SMTP id k17mr3737333vcm.36.1367591680811; Fri, 03 May 2013 07:34:40 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id f16si692392vcj.45.2013.05.03.07.34.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:34:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hz10so1457660vcb.38 for ; Fri, 03 May 2013 07:34:40 -0700 (PDT) X-Received: by 10.52.69.109 with SMTP id d13mr3169840vdu.75.1367591680708; Fri, 03 May 2013 07:34:40 -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.58.127.98 with SMTP id nf2csp25232veb; Fri, 3 May 2013 07:34:40 -0700 (PDT) X-Received: by 10.194.71.103 with SMTP id t7mr14364513wju.38.1367591679632; Fri, 03 May 2013 07:34:39 -0700 (PDT) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [2a00:1450:400c:c00::22f]) by mx.google.com with ESMTPS id ec2si1365573wic.66.2013.05.03.07.34.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:34:39 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22f is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::22f; Received: by mail-wg0-f47.google.com with SMTP id e11so1687709wgh.14 for ; Fri, 03 May 2013 07:34:39 -0700 (PDT) X-Received: by 10.180.189.41 with SMTP id gf9mr13652186wic.32.1367591679151; Fri, 03 May 2013 07:34:39 -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 o3sm17516019wia.2.2013.05.03.07.34.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:34:38 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones , Herbert Xu , "David S. Miller" , Andreas Westin , Ulf Hansson , linux-crypto@vger.kernel.org Subject: [PATCH 36/63] crypto: ux500/hash - Prepare clock before enabling it Date: Fri, 3 May 2013 15:32:22 +0100 Message-Id: <1367591569-32197-37-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367591569-32197-1-git-send-email-lee.jones@linaro.org> References: <1367591569-32197-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnnmJzWuQRf6LaAcAZC7kxIA2EuV8q5Tn6y3/WFGdXWLYgAeqFHv2cEWqtt6Q7hZqqNdXGb X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 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: Ulf Hansson Cc: linux-crypto@vger.kernel.org Acked-by: Arnd Bergmann 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 632c333..1e8b2f3 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1727,11 +1727,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); @@ -1763,6 +1769,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); @@ -1827,6 +1836,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);