Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2623552yba; Mon, 8 Apr 2019 00:44:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkBM1L72eUmK5Same6RMR+W1AxCX4Cup9Y5eON6Bf/OtGe/v0FT5c2qBOWqSmH5rkz0GH4 X-Received: by 2002:a62:e50a:: with SMTP id n10mr28268388pff.55.1554709445159; Mon, 08 Apr 2019 00:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554709445; cv=none; d=google.com; s=arc-20160816; b=MItSyanzpiTtlamMe4+80+0uX+VdtXx5X3HI6bmmlQc8stmy1UQeZlHZrKjbdpef/U YN5GA3B4WmnIKlC4WyBVcM/zPmxo0L8W+P8N8rIRPtoUvrFayWH8A0VOwljRoRL8S/Z0 jZUN6PeCjvgn0vnk+nO+H5v3QdpbMCEAYO2L3bw2OkJqam1vU1FdjRz0D4geokdI9kCm +x/6iOqFwMP/rjs2H7C3i/XcicJBWSLwibe8G+3bESoZxq8cCTgDd2Yj9yUioIKFWzDg jCEkAm6GfXbI1/XN4TsWRjwLicVB/oakscwRsfe4SPho2FnrN7JX5pnrVQQtIOMge7ik 8Kug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=mzgL90xy/Z18CpzSweHDi9oQPt1aVLICyetmISiGRGQ=; b=TwItmvm4RI4lBAu6FyI/MoJpT2GibaxlfKTsSE2VotqywgLJAJCwl4/Rta2kSKm032 UgI4tX8wALql2Tq6LNivCJKSq+pJBf2kDoMuKLFsWAACEaRC75FanpRd0dqJZtLocOfr RJPSnDglGCN4fTLUDIyMyajxfuzUVMqz4U8etHvJioXdcL2VsAzpx22PQyuL71C5bmys nHZRcA4ihp9BFLqQFxT6Rh01C/sEQvE1lrisM/xPizKif/K8rLC8zlQ/DGHbb88B+tOz c4vbxKaOVlyirqwz7izWMyImM+tak5U7h+yGMeWP192rXNII3bC+MHZEB5U3t8/Y9OGG VyaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=sjBhBHk9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z11si25652259pgu.306.2019.04.08.00.43.50; Mon, 08 Apr 2019 00:44:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=sjBhBHk9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726486AbfDHHm7 (ORCPT + 99 others); Mon, 8 Apr 2019 03:42:59 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:11846 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbfDHHm6 (ORCPT ); Mon, 8 Apr 2019 03:42:58 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x387bVNi016730; Mon, 8 Apr 2019 09:42:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=mzgL90xy/Z18CpzSweHDi9oQPt1aVLICyetmISiGRGQ=; b=sjBhBHk9OxbLO9LyUd9VeNj5y2fc3lJof9vc/0E/va6r3H+2wyME2Eu8NXIOXsdbTjIs lLMGbuytQOTHBgLnMMPpUDHhPXmhANmI0ibrgOk5j+6CpJWyTIHZAj6qE3MyO9eWxlDJ U3RKU73FDof5UukZ/X5zlK9lDb8fWyE7TUPUgDUjyGM5Ff4L8PXoJS2qJglcXN7sBRLn 6TZECxLxYMd1bggwRn+1217xjEbBJD0/lS4YK95KgWyWnf4FHEvALhOYHmejlPa7FZIJ qMOFQYqLTO/jefnMT17lqOxpi/BajbVdwJYFX1u/HmYHmnhBir6V8Tin9Is1SvLMEgss jA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2rprcf1jfg-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 08 Apr 2019 09:42:01 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E951738; Mon, 8 Apr 2019 07:41:59 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9BC5512E1; Mon, 8 Apr 2019 07:41:59 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 8 Apr 2019 09:41:59 +0200 Received: from localhost (10.201.23.65) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Apr 2019 09:41:58 +0200 From: Lionel Debieve To: Herbert Xu , "David S . Miller" , Maxime Coquelin , "Alexandre Torgue" , , , CC: Benjamin Gaignard , Fabien Dessenne , Ludovic Barre , Subject: [PATCH 1/1] crypto: stm32/hash - Fix self test issue during export Date: Mon, 8 Apr 2019 09:41:58 +0200 Message-ID: <1554709318-25389-1-git-send-email-lionel.debieve@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.65] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-08_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change the wait condition to check if the hash is busy. Context can be saved as soon as hash has finishing processing data. Remove unused lock in the device structure. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index 4a6cc8a..bfc49e6 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -181,8 +181,6 @@ struct stm32_hash_dev { u32 dma_mode; u32 dma_maxburst; - spinlock_t lock; /* lock to protect queue */ - struct ahash_request *req; struct crypto_engine *engine; @@ -977,7 +975,7 @@ static int stm32_hash_export(struct ahash_request *req, void *out) pm_runtime_get_sync(hdev->dev); - while (!(stm32_hash_read(hdev, HASH_SR) & HASH_SR_DATA_INPUT_READY)) + while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY)) cpu_relax(); rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER, -- 2.7.4