From patchwork Wed Jun 22 13:23:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 9192807 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 432FC601C0 for ; Wed, 22 Jun 2016 13:25:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3427228408 for ; Wed, 22 Jun 2016 13:25:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 288D528409; Wed, 22 Jun 2016 13:25:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8378E283F7 for ; Wed, 22 Jun 2016 13:25:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752323AbcFVNZX (ORCPT ); Wed, 22 Jun 2016 09:25:23 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:41138 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752300AbcFVNZV (ORCPT ); Wed, 22 Jun 2016 09:25:21 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u5MDO5Dx017265; Wed, 22 Jun 2016 08:24:05 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5MDOow3031359; Wed, 22 Jun 2016 08:24:50 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Wed, 22 Jun 2016 08:24:49 -0500 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5MDONwB022607; Wed, 22 Jun 2016 08:24:47 -0500 From: Tero Kristo To: , , , , , CC: Subject: [PATCHv2 09/27] crypto: omap-aes - Fix enabling clocks Date: Wed, 22 Jun 2016 16:23:42 +0300 Message-ID: <1466601840-18486-10-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466601840-18486-1-git-send-email-t-kristo@ti.com> References: <1466601840-18486-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lokesh Vutla Enable clocks for all cores before starting session. Driver has to pic the aes core dynamically based on the queue length. Signed-off-by: Lokesh Vutla --- drivers/crypto/omap-aes.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index 8178632..cf53d3f 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c @@ -760,18 +760,13 @@ static int omap_aes_cra_init(struct crypto_tfm *tfm) struct omap_aes_dev *dd = NULL; int err; - /* Find AES device, currently picks the first device */ - spin_lock_bh(&list_lock); list_for_each_entry(dd, &dev_list, list) { - break; - } - spin_unlock_bh(&list_lock); - - err = pm_runtime_get_sync(dd->dev); - if (err < 0) { - dev_err(dd->dev, "%s: failed to get_sync(%d)\n", - __func__, err); - return err; + err = pm_runtime_get_sync(dd->dev); + if (err < 0) { + dev_err(dd->dev, "%s: failed to get_sync(%d)\n", + __func__, err); + return err; + } } tfm->crt_ablkcipher.reqsize = sizeof(struct omap_aes_reqctx); @@ -783,14 +778,10 @@ static void omap_aes_cra_exit(struct crypto_tfm *tfm) { struct omap_aes_dev *dd = NULL; - /* Find AES device, currently picks the first device */ - spin_lock_bh(&list_lock); list_for_each_entry(dd, &dev_list, list) { - break; + pm_runtime_put_sync(dd->dev); } - spin_unlock_bh(&list_lock); - pm_runtime_put_sync(dd->dev); } /* ********************** ALGS ************************************ */