Message ID | 1437141294-15678-3-git-send-email-horia.geanta@freescale.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show
Return-Path: <linux-crypto-owner@kernel.org> X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B994AC05AD for <patchwork-linux-crypto@patchwork.kernel.org>; Fri, 17 Jul 2015 13:56:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE0262066C for <patchwork-linux-crypto@patchwork.kernel.org>; Fri, 17 Jul 2015 13:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06A6C207A8 for <patchwork-linux-crypto@patchwork.kernel.org>; Fri, 17 Jul 2015 13:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753187AbbGQN4f (ORCPT <rfc822;patchwork-linux-crypto@patchwork.kernel.org>); Fri, 17 Jul 2015 09:56:35 -0400 Received: from mail-bn1bon0140.outbound.protection.outlook.com ([157.56.111.140]:50720 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751305AbbGQN4e (ORCPT <rfc822;linux-crypto@vger.kernel.org>); Fri, 17 Jul 2015 09:56:34 -0400 Received: from CO2PR03CA0030.namprd03.prod.outlook.com (10.141.194.157) by BY2PR03MB285.namprd03.prod.outlook.com (10.242.37.16) with Microsoft SMTP Server (TLS) id 15.1.225.13; Fri, 17 Jul 2015 13:56:32 +0000 Received: from BY2FFO11FD056.protection.gbl (2a01:111:f400:7c0c::152) by CO2PR03CA0030.outlook.office365.com (2a01:111:e400:1414::29) with Microsoft SMTP Server (TLS) id 15.1.201.16 via Frontend Transport; Fri, 17 Jul 2015 13:56:32 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD056.mail.protection.outlook.com (10.1.15.193) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Fri, 17 Jul 2015 13:56:31 +0000 Received: from enigma.ea.freescale.net (enigma.ea.freescale.net [10.171.77.120]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t6HDuOo1027168; Fri, 17 Jul 2015 06:56:30 -0700 From: =?UTF-8?q?Horia=20Geant=C4=83?= <horia.geanta@freescale.com> To: Herbert Xu <herbert@gondor.apana.org.au> CC: <linux-crypto@vger.kernel.org> Subject: [PATCH 3/4] crypto: caam - fix RNG init descriptor ret. code checking Date: Fri, 17 Jul 2015 16:54:53 +0300 Message-ID: <1437141294-15678-3-git-send-email-horia.geanta@freescale.com> X-Mailer: git-send-email 2.4.4 In-Reply-To: <1437141294-15678-1-git-send-email-horia.geanta@freescale.com> References: <1437141294-15678-1-git-send-email-horia.geanta@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD056; 1:RbPjqjUJT1VYQuZHyXh8dHbw24AQJDlVgfwb7KZ3SfyU8dNzwoCNmOwx1dTbX5Klp9Gpe32blQeHCd+gOKVioRRiUDjem9DPw1dfxTPtfyE0s5MaN++G3Qe7gN3OUlXnZQQCB/AfK6sfRb7YSvDuZgLzoLTqDJXJFVRy2wjcLUJX/fGpx1q7dZMzzmgSFYvFu3XGUg4eMFl0jzuIQCRNpl/PrWAHFFtB4IIHt9Lgm1Arh97vaV+FDM3Cx/VHYXJ+Op6vYqPoM4v5PI+o/7DkapL60d348JVIGbtR0lb58cndfWXSP4viJbQKxFRDVnjTD5yoHhH+Q63ijS2P2JugDQXFgRiSDflIM8ystdEM6IqIgRdXWdXTvstmElYVCjwTF/o1u51k3AfX13dGxTkx/jbcmu0bCxdrJ521eI4dJtE= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(50226001)(106466001)(77096005)(2950100001)(6806004)(23676002)(62966003)(77156002)(104016003)(50466002)(33646002)(229853001)(46102003)(86362001)(575784001)(19580405001)(87936001)(19580395003)(5001920100001)(92566002)(36756003)(5001960100002)(110136002)(189998001)(5820100001)(76176999)(50986999)(105606002)(85426001)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB285; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB285; 2:WXaeIOqA0sE5UoYsae1b3SUEUKmfuLRcoTC2DvsobYHwvPDKyPCthPsLKtUdwFAzcZ5OyP9w71QcyMnRmJ4fAfi8yMq7qldl6DK5wE2GPhPn/mTytSuElxQTT7Fcm3sFNqxPFFS/CaZLPTn8RSEpdgY3tOWczaeRoKo8KRBmVV4=; 3:AG3aPTdoUj0YXkN8Blyw0r3cTJoVA7lGwS18SZ4NljN+ME2QSoh6tcbWrqYrvKbnVNVeTqeo2SFG06/mgV/YK37iMdzRC6362Fb6YDJPH6icBYV4okUV+2q90n7yxf3zvancdKWUnZJFH0DpX0HvFBo8+EvEmLgMgZDa3vcKT8vogQSMlGvXdstohryR5kVErbtx06ZMnnxF+Ro8b3Xr6KfWo4rAzV9Y0WJWyAdDjYg=; 25:yNrubWWZx0qRh3QYYVvTci2TOULmZICRnMqMNleUIeoCsPXeKdcosMbUEyFYdd5sL95vfTezEII/y5HQ9viKFd099v58DOhexBJMReIbcBpaI659+5vdb42heWD62q/91jmv+bviTnN8sesW6XY/hdXZDB1XJ2nfrR5rgIT8YojBfm7Rswp8kgeqi3cGsjxElPi1nNj6P4v0ANiWV0ivn2z61aQBwr+0abinRTYMdVrQ0e55X9cwtDVnEJjAjWLGtnklflwadKM/Lo18loQ/tw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB285; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB285; 20:/slSxwBpdaDPOiF1qpI8wBCpd/rDEzLiN6zTmb1IpFlIc1QyNWPaGIXVoESQCX2aPumcsCsvwPZFr26LesfkLGpbkxOM7ILEQWCTlKD/4u11YXqQBl5SCdCPOTF9Oi7WQ/PA5/aHEv1eqX96tF7ar8m6J9Sfo/RhGsKt7t+RIq8039IO8uzCg52BletybMZVbtRjZ+Nn7k9cv2tJd2b04rbxCywIr8ijtENtg0x7iTp3hoVq42inCzG442Xz0+60GsISv/gcJvI+RmJpATdmVZFK3NnnzZ3cerjqmv2TNo0gvIlX7WRZSaJsUiqxXjd8gtRzBGbHqaJ7rNAXh0ia1yYF+GOeOgW2ESSodkZmcVM=; 4:G/ace/qoU63ApKabPdmhYrw4TJxY59u7uzXXe1/mmhenvK8K3anBf2GdZhBMDrZMVsmwMS6acPp8o374GgTYcWhDk755ERu8MnCTm1Xds3WOfjdfEvPNwHVSEosK2NpBdodNFP2GpluxNotd8zQ3kqJUXUfFWsYasbwmN16OdMVjenwKK1QwOqHCc6/dhgZMkX1uNxVuPDE8mQGP++/ofell15kDHP3OpgztX4LLjlhCsuQ4uMWcC7fQZdxALPy9kagir43OpTzlZdkwRcAycKP2xX3OVj3GiYYx2ViwTtQ= BY2PR03MB285: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: <BY2PR03MB285AD9DD8D4D34354C2677492980@BY2PR03MB285.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY2PR03MB285; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB285; X-Forefront-PRVS: 06400060E1 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB285; 23:D2iJrkFz3xGloIctg7fEgt6+oRk/hZ/cPFNILAu+55JwYUVbdAOWdv4Qzr7TZX1AJ9NPUgCRYfWtDtSnQ7B0JSnIIbJ7Ep+o6ti6QLwalJHNG099RFjHoI0iMXZs1oMAKMkv6F5eU+xQ4Y7vos/1/7XPTEPzOhVf/rT/B2ubAKMPgnDpPxBa4PpIj+lsaWhVbjOQ1zhvbsWjHKhmwMRl5GjYoXWcIdttqnW/SJXcJ3Mizlf5lWEap0UeHLhlQRNh5et0pldHWVFlgoFJVFsWygwpDdn2qp5NdGqzocduRu+skP01oLA7i70LkT9o7MSRrwkzIF52jFerL0Bw+1Cy0h/B/Y9lt83o5kZoTr1NnMohrypHaI7GAQHIXFBhd5W/Japz4cYOrehrf7ynD6zcKDQcoa41GLtKO2PRgy2vPSvaJMdzfCxb05ZOwMPZHR0wEo2nflNv8KPDSma5N356ELCaLlexeGjcLc4SBIDfZ21JjPYhihHn2kpz0Yd+T89XLmG99BiBMeFGstBCfDkMmGXG17wW4OETWCbW/KErPLwMCpKRLoVPWgWQR52qp00Z/CZ3no1dVv2ognp/w/mCxDBKlP6MMSqbvIHeVu01B0ambTQixR8NOnI29iS4BGfgBuRUrQzDv+rnZ8NamBJsOJviBkDQFiv7LmPy1XtBPU+5xLRLB23/HGc8grW7xbHL19EmWhTJLIofybf0Uv4wTAzra1hFH04A0ERhcOGrU1vlOMeyfB6g6x5B3ZxAFpKah3iZFW/UIyZxVtXLjpGBkklZxbnN1WBAmRsgz6wXz3Tohc3raeVFk2MoWWVk5MVaC/Qqlh7Z1kMyWTkGJE/jyrHh6C3aqfjvF50WwxXRrFkkQ0ne6chm9gN09ebGnGICVmL6avw8ijca5sxa28IqpogF0YL5Gu5WqKQxnIfB55 uukOchak4vV5jkJDfBCQTf X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB285; 5:sFhFQni0C0ilgvGuPdlfjqfWcStdKgE8/Pc4ZSlGzc9jWWoe+DLyNo573YttXNTwr+yKmUltnLLpKESvBsGEvJx1/P5WmF4tF41QCVAfA+lGErkFuKfKsHVnqq5vAeM9i2uxH4/KnBm8Umw4b4QwiA==; 24:EBkxAEO7EGBfGExGdxsN5An9vW6Eo+DQ+xKcL6BK32sMZGs2sqdxl7exBTYZUipUORH2wxBxkmAZFlIG6rcAdwGt/ChZrxZcFME7gWbTIuU=; 20:DXc5FFh2ItQ4R9Ad2u56aZ886BQRt7nlersbtUFLZceFaQvM5r/k08Az2FQgaEAG5dBzkpFqVayz7SxlDJqCDw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2015 13:56:31.6789 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB285 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: <linux-crypto.vger.kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index b924477c0d83..189180976167 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -175,7 +175,7 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask, { struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); struct caam_ctrl __iomem *ctrl; - u32 *desc, status, rdsta_val; + u32 *desc, status = 0, rdsta_val; int ret = 0, sh_idx; ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl; @@ -207,7 +207,8 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask, * CAAM eras), then try again. */ rdsta_val = rd_reg32(&ctrl->r4tst[0].rdsta) & RDSTA_IFMASK; - if (status || !(rdsta_val & (1 << sh_idx))) + if ((status && status != JRSTA_SSRC_JUMP_HALT_CC) || + !(rdsta_val & (1 << sh_idx))) ret = -EAGAIN; if (ret) break;
When successful, the descriptor that performs RNG initialization is allowed to return a status code of 7000_0000h, since last command in the descriptor is a JUMP HALT. Signed-off-by: Horia Geant? <horia.geanta@freescale.com> --- drivers/crypto/caam/ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)