From patchwork Thu May 2 10:49:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16579 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 69BA3238EC for ; Thu, 2 May 2013 10:50:13 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id w16sf699414vbb.9 for ; Thu, 02 May 2013 03:50:06 -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=D3m/eJb5uboy2cAXxwKILXz98aoDr8flyTFZMD9yi7hnhhuz2BH8nzcqYMJtUQr/xD SZ2N9QWdnIAUMRjmPAN6H0T9ceC7PjVm614byGYHyMPM4dlLx7fYgynsxh5Jg8IKUYid kwPASxikBPh2Tprtj7WlXNQZKUvfNgNTIAq3Z7xTPrR7n/wxZIiX952Vp3GNAGsFhQhH WFCDVrZO8coz0hkS0hXT42jykVjlygnF28WlnxDLJ1hUUbfCUp2S0wAwjSkU3AL2lzFI VcEKb5v+aTQXdHoex0Wfldg+mCetRDLKAk8ZSS6i6UiuQboZHiNQgPhXu6GkoBzbzAWA 6g1w== X-Received: by 10.236.134.132 with SMTP id s4mr4923978yhi.56.1367491806257; Thu, 02 May 2013 03:50:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.197 with SMTP id e5ls1181529qeo.42.gmail; Thu, 02 May 2013 03:50:06 -0700 (PDT) X-Received: by 10.58.34.12 with SMTP id v12mr1932248vei.55.1367491806090; Thu, 02 May 2013 03:50:06 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id tq4si1599700vdc.105.2013.05.02.03.50.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 03:50:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 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.173; Received: by mail-vc0-f173.google.com with SMTP id ht11so334163vcb.18 for ; Thu, 02 May 2013 03:50:06 -0700 (PDT) X-Received: by 10.220.189.9 with SMTP id dc9mr1973695vcb.8.1367491805971; Thu, 02 May 2013 03:50:05 -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 nf2csp195687veb; Thu, 2 May 2013 03:50:05 -0700 (PDT) X-Received: by 10.194.104.168 with SMTP id gf8mr7010613wjb.58.1367491804868; Thu, 02 May 2013 03:50:04 -0700 (PDT) Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [2a00:1450:400c:c03::233]) by mx.google.com with ESMTPS id u5si8005220wie.114.2013.05.02.03.50.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 03:50:04 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::233 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::233; Received: by mail-we0-f179.google.com with SMTP id t9so357882wey.24 for ; Thu, 02 May 2013 03:50:04 -0700 (PDT) X-Received: by 10.180.185.44 with SMTP id ez12mr6916215wic.7.1367491804463; Thu, 02 May 2013 03:50:04 -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 x13sm9665546wib.3.2013.05.02.03.50.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 03:50:03 -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 1/8] crypto: ux500/hash - Prepare clock before enabling it Date: Thu, 2 May 2013 11:49:43 +0100 Message-Id: <1367491790-9727-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367491790-9727-1-git-send-email-lee.jones@linaro.org> References: <1367491790-9727-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkEuplLaZiO00wu/sevHUK9fazHuhJho0HiOc1X2Mg5SfiU6GgLtwVPyVgdbSklCbCzx0ch X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 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);