From patchwork Wed May 15 09:51:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16932 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7742E2396C for ; Wed, 15 May 2013 09:53:17 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id ia15sf724059qab.1 for ; Wed, 15 May 2013 02:52:40 -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=kE26UCcqGGwwgWJ/LZYZ0QmjFb4bzlgQxcQGy4MnikU=; b=kdZx6di5d7pA2xlNCT7yC3p1cKBXOqZvgG4RVn60UxrauRJ5A1pLkaPoe5pOjEB7cv NuFU4PY2TKwdcpCG/FIXnMbuirUxD7b66cu8JhYFMIao4vT8Gq61xvAVCHFwj19QT5qu b+mujadh4K4T8+YKPU1bpg0o6CkCkDxsSODli2XeFkk0Dxbxz0unynQjoyGIqa+v9QfQ UcPzHVqvaECjWGnlO2klLh2x7FKGgBrmRiIi2tK+bK2jiBxRaWzrxYZqh2lU05BX1w6c Sl6g1O4lMOU9eV54k//jcX5Au6nnDSyy2ecXYGa5vLmZ+thYxXP+OzjuFb2tafAUQnjz EDpg== X-Received: by 10.236.15.34 with SMTP id e22mr18176587yhe.16.1368611560853; Wed, 15 May 2013 02:52:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.14.195 with SMTP id r3ls612144qec.63.gmail; Wed, 15 May 2013 02:52:40 -0700 (PDT) X-Received: by 10.220.83.138 with SMTP id f10mr24208127vcl.7.1368611560694; Wed, 15 May 2013 02:52:40 -0700 (PDT) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [2607:f8b0:400c:c02::235]) by mx.google.com with ESMTPS id gr7si1012540vdc.129.2013.05.15.02.52.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:40 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::235 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:c02::235; Received: by mail-vb0-f53.google.com with SMTP id i3so279164vbh.12 for ; Wed, 15 May 2013 02:52:40 -0700 (PDT) X-Received: by 10.221.4.131 with SMTP id oc3mr1803107vcb.49.1368611560506; Wed, 15 May 2013 02:52: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.220.217.15 with SMTP id hk15csp11346vcb; Wed, 15 May 2013 02:52:39 -0700 (PDT) X-Received: by 10.194.143.100 with SMTP id sd4mr2787150wjb.54.1368611559277; Wed, 15 May 2013 02:52:39 -0700 (PDT) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [2a00:1450:400c:c00::22a]) by mx.google.com with ESMTPS id s11si517730wjq.212.2013.05.15.02.52.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:39 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22a is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::22a; Received: by mail-wg0-f42.google.com with SMTP id j13so4920356wgh.3 for ; Wed, 15 May 2013 02:52:38 -0700 (PDT) X-Received: by 10.180.205.206 with SMTP id li14mr13019344wic.33.1368611558738; Wed, 15 May 2013 02:52:38 -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.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:38 -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 15/39] crypto: ux500/cryp - Prepare clock before enabling it Date: Wed, 15 May 2013 10:51:38 +0100 Message-Id: <1368611522-9984-16-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: ALoCoQl+BZ8AWXFpqSv5+jlSXGKFkidVXjp3nb9AOj9KkRlrVXdwXd+74Uq6cRdB/uiLyp2rCSRs X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::235 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: linux-crypto@vger.kernel.org Acked-by: Ulf Hansson 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 32f4806..ccdf173 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c @@ -1458,11 +1458,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); @@ -1523,6 +1529,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); @@ -1593,6 +1602,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);