From patchwork Fri May 3 14:32:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16670 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-fa0-f72.google.com (mail-fa0-f72.google.com [209.85.161.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CA02C23905 for ; Fri, 3 May 2013 14:34:58 +0000 (UTC) Received: by mail-fa0-f72.google.com with SMTP id v9sf2702404fav.11 for ; Fri, 03 May 2013 07:34:48 -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=ovhZqvgRiER+cTjf+20WEEhJb5/FREyw1+HtE/TLGjg=; b=mDHbaISRR7unTILvnvsxifld6viDmKiBvqgg53dGMT2p/iLIEdDdcFq49TjU1JmVea X5v6R5aPp/dwy4u83tqs/d70DQRgxuYrlXuZOQn4OXsgxrw0kSLsmRCySd2QfBvCiBrN J55Le3uN4vozoWwns7FD3Q1etufP+cGVBzr6HIFzRQq5QGKkcAAwq9giz7np+4QTk8qO 02LjGkQtD/G/jQnBsyYN0CAikbWCkFpioO1Yvkzr8CjfLmkwv64QvskLWog3+4uZ21Rq FZJVq/LeyDhcY49W9ydPLdBCmVmt9pAMKZAOinkayf2aFors+8VzDOM4EJ5rT13Wgu/1 D4Bg== X-Received: by 10.180.75.133 with SMTP id c5mr12514470wiw.2.1367591688302; Fri, 03 May 2013 07:34:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.106.132 with SMTP id gu4ls180250wib.17.gmail; Fri, 03 May 2013 07:34:48 -0700 (PDT) X-Received: by 10.180.189.41 with SMTP id gf9mr13652937wic.32.1367591688151; Fri, 03 May 2013 07:34:48 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id cz7si3597430wjc.199.2013.05.03.07.34.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:34:48 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f 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::22f; Received: by mail-ve0-f175.google.com with SMTP id m1so1529033ves.6 for ; Fri, 03 May 2013 07:34:47 -0700 (PDT) X-Received: by 10.58.173.36 with SMTP id bh4mr3766625vec.9.1367591687101; Fri, 03 May 2013 07:34:47 -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 nf2csp25240veb; Fri, 3 May 2013 07:34:46 -0700 (PDT) X-Received: by 10.194.77.146 with SMTP id s18mr14372916wjw.16.1367591686170; Fri, 03 May 2013 07:34:46 -0700 (PDT) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [2a00:1450:400c:c03::22e]) by mx.google.com with ESMTPS id m20si3610725wie.45.2013.05.03.07.34.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:34:46 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22e is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::22e; Received: by mail-we0-f174.google.com with SMTP id z2so1358368wey.19 for ; Fri, 03 May 2013 07:34:45 -0700 (PDT) X-Received: by 10.180.82.74 with SMTP id g10mr27324331wiy.10.1367591685782; Fri, 03 May 2013 07:34:45 -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.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:34:44 -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 39/63] crypto: ux500/cryp - Prepare clock before enabling it Date: Fri, 3 May 2013 15:32:25 +0100 Message-Id: <1367591569-32197-40-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: ALoCoQlcXVJ9jzDtA95fltMmY+QLOXxzlIhUfIopHTCBADrMXv6NTSXZKKm6abqS4fSkq3OLw+wy X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f 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-cryp 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/cryp/cryp_core.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index 22c9063..bf78d60 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c @@ -1459,11 +1459,17 @@ static int ux500_cryp_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 = cryp_enable_power(device_data->dev, device_data, false); if (ret) { dev_err(dev, "[%s]: cryp_enable_power() failed!", __func__); - goto out_clk; + goto out_clk_unprepare; } cryp_error = cryp_check(device_data); @@ -1524,6 +1530,9 @@ static int ux500_cryp_probe(struct platform_device *pdev) out_power: cryp_disable_power(device_data->dev, device_data, false); +out_clk_unprepare: + clk_unprepare(device_data->clk); + out_clk: clk_put(device_data->clk); @@ -1594,6 +1603,7 @@ static int ux500_cryp_remove(struct platform_device *pdev) dev_err(&pdev->dev, "[%s]: cryp_disable_power() failed", __func__); + clk_unprepare(device_data->clk); clk_put(device_data->clk); regulator_put(device_data->pwr_regulator);