From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C897C3DA7D for ; Tue, 3 Jan 2023 13:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: In-Reply-To:References:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8TdxAQHM2qZU3E0u/JAhuphcjlRg0+4NvM3DoVkz+3s=; b=nr8XBjjE15slgU OI9Ehi+z/noxoBfRRnn04iokcHpfiSsMoIw2P7lK3lOg2hGWz4bRZKcoq07cNpI1uutUzxkiYsZyT xukInYl+1jbnKMB8EB4PQMnVYwWytBf2xIj5TOUpIgE49v5u3MF2sjqTN49aBaPtkHXPJ06xswtfJ A7DII3X1s637mwYY8TBGXIN4yvncOXXyYTcDxISQPAJj2vAOyGq3AHnXZPzpwP31v68SFUx8zMEwv WNUWbQjOhcqFAS+Waj2Rx4M+1V4PSrqIMt++nH6PNlCo0fYqiqUfMhS9sz+Mt1luYccv+cvopsBQ8 piSenL+gqCjcf3lHnwBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCh93-001SRR-V2; Tue, 03 Jan 2023 13:15:59 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCcQt-0006rk-Lr for linux-arm-kernel@lists.infradead.org; Tue, 03 Jan 2023 08:14:06 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3033HGpg003144; Tue, 3 Jan 2023 09:13:52 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : references : in-reply-to : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=selector1; bh=0fNLTPCVMxlTbstLKSuvIRzgSXB7ZKfAUBpmvsQjllc=; b=aA6vCUX0QJX+AiVDpVgMXc2JMrmXDOunfH2ukpzOWB+fKhI4tMBOfSMHNgo5mqGr1rDz VWVWFx0rruIH7iUYrpiha9Jqh76G1P9bKK3am8ssE6kDSKbNTZt9MMGGYtIT0nXlYKE3 Y0dje3xi6bTYMJ3TnGc76+3z/BnZi4ubZ7icgPsWK1at3C/D39FlDEC+WH0/fS2Zk1En Ro52fEq/0Eif6DqNcn4kysRsQWpweH2pyNKIOjcGAhqWCkaVOEYlVFwQchu2E7PemkDq bMBnx5och0ka8/hyFUCGF6gM7zt4EculpgZ7uS2i0ntvSVko1PNwrcdYts4Lf2kmsEy3 fQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3mtcupkgk5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Jan 2023 09:13:52 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4118F10002A; Tue, 3 Jan 2023 09:13:52 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 37AD52132F3; Tue, 3 Jan 2023 09:13:52 +0100 (CET) Received: from LMECWL1288 (10.201.28.198) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Tue, 3 Jan 2023 09:13:50 +0100 From: To: 'Linus Walleij' , 'Herbert Xu' , "'David S. Miller'" , 'Rob Herring' , 'Krzysztof Kozlowski' , 'Maxime Coquelin' , 'Alexandre Torgue' CC: , , , , References: <20221227-ux500-stm32-hash-v1-0-b637ac4cda01@linaro.org> <20221227-ux500-stm32-hash-v1-3-b637ac4cda01@linaro.org> In-Reply-To: <20221227-ux500-stm32-hash-v1-3-b637ac4cda01@linaro.org> Subject: RE: [PATCH 3/7] crypto: stm32/hash: Use existing busy poll function Date: Tue, 3 Jan 2023 09:13:44 +0100 Message-ID: <000b01d91f4b$509b3ee0$f1d1bca0$@foss.st.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: en-us Thread-Index: AQE9xJnjLNHmulQwHw6lCuUzVFT/vQLW0/48r6xWuRA= msip_labels: MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Enabled=true; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_SetDate=2023-01-03T08:13:44Z; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Method=Standard; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Name=23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_SiteId=75e027c9-20d5-47d5-b82f-77d7cd041e8f; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_ActionId=d270d5a5-e33e-46b8-bd19-8468824ddf5e; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_ContentBits=2 X-Originating-IP: [10.201.28.198] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-02_14,2022-12-30_01,2022-06-22_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_001404_576020_575D90A8 X-CRM114-Status: GOOD ( 17.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Acked-by: Lionel Debieve ST Restricted -----Original Message----- From: Linus Walleij Sent: Wednesday, December 28, 2022 12:04 AM To: Herbert Xu ; David S. Miller ; Rob Herring ; Krzysztof Kozlowski ; Maxime Coquelin ; Alexandre Torgue ; Lionel Debieve Cc: linux-crypto@vger.kernel.org; devicetree@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Linus Walleij Subject: [PATCH 3/7] crypto: stm32/hash: Use existing busy poll function When exporting state we are waiting indefinitely in the same was as the ordinary stm32_hash_wait_busy() poll-for-completion function but without a timeout, which means we could hang in an eternal loop. Fix this by waiting for completion like the rest of the code. Signed-off-by: Linus Walleij --- drivers/crypto/stm32/stm32-hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index 0473ced7b4ea..cc0a4e413a82 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -960,11 +960,13 @@ static int stm32_hash_export(struct ahash_request *req, void *out) struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); u32 *preg; unsigned int i; + int ret; pm_runtime_get_sync(hdev->dev); - while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY)) - cpu_relax(); + ret = stm32_hash_wait_busy(hdev); + if (ret) + return ret; rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER, sizeof(u32), -- 2.38.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel