Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp535032ybz; Fri, 1 May 2020 03:53:58 -0700 (PDT) X-Google-Smtp-Source: APiQypLI6O0tge6p9HPRh5vq/0FumTe7YHA4DzQ2wIDIulBwvqrPfkZJDeGF1n86ymOLU7kt7zqM X-Received: by 2002:a17:906:ce49:: with SMTP id se9mr2601893ejb.345.1588330438633; Fri, 01 May 2020 03:53:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1588330438; cv=pass; d=google.com; s=arc-20160816; b=Fi1hDy/jNgTJMeoWxhimYDVKdqRO0whFT65GBRF9aWI5ZWfgaS4J3lpDh2IGBUbnjW bsrFJWWVaSH31FjMVgGBx8iiFmdXC4O/+GH+rVEhB18il6FW1YblHxpi81eqNFJaN3DA KOM0weK6Y4+7XcZyA8meM+zRy81kxAXlYz0Kooapnw8C36X5R1ucmT9ywAl97zv4jIth KG2NyOCEVC3aOwiPcS3hYa2RFEo8hprkjOI1SyLSWdYV6oR29U0Cw5cjRdKH4eWil5Wl vDQT6lZOIZg5sxnQU9kCVPcXZNtDhsPIoWtgoU6Qq2MMIek9e1shxDjbTa8Q249fSknD w44g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Thw+s4qdYO8SQXU9N7HA0sRw/J0et2+3mdtKo82XHdw=; b=qqZzeZMXCte42ba2KuSmWBe6wXqZFUsK0uZZVjk4B3xumIeybZPcNh+JYShDqMbZnp W7gCNKbsSn2mSYcLalYcC3f4zE6IPmpbXlNYqI9NVP16mSRFU8JOv+UKsF5OLb1MIn2S khJPeiWnfuAzoxLx5h1cU3bTzT746kqgjT/R0baWzZxTtVZR1AJHNlWXjEhMO7TniiwK oYmcolVY9y+NAN5BBISle+iwru/v/NodTQhlrKemuqeUz8Y9yHCpxdqWDFdRW6F9vrrU 1NI1oee3IhvOCRBQcOmE2EANboNNUU7jF37swytj36MLUOZQegPzsrGbzZApwy8bj7rf Y9gQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=djTYzpjj; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si1393946edr.151.2020.05.01.03.53.27; Fri, 01 May 2020 03:53:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=djTYzpjj; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728352AbgEAKwr (ORCPT + 99 others); Fri, 1 May 2020 06:52:47 -0400 Received: from mail-mw2nam10on2042.outbound.protection.outlook.com ([40.107.94.42]:6117 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728268AbgEAKwr (ORCPT ); Fri, 1 May 2020 06:52:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XfTQpHXkiDMUiExoWtLJm6Pvd34DxXUvyfunZnePYR7E4aLHzgakvxakPEYWoFyXc93uXrIVMSmzyK1K7JREG93hJ2ByuFGZKBTSCDv+QesfSwz9qv2PdUt2SIPsrcd1+LE+g211dTHFNwJsEfC1ktFUpNXqTnQ/njkMDMhFjYac1RR35X8LqBHSA5aR0web/mYg1rwVdhh+hQHsEczg2DfK3x+jQZx7ndwz3I0mKISnzBbUPUvC/HvrS55Cg/GSt8vdSr5ZmRkymTJt6P+SoSEB9C3btWtFE/yDOqVC9L0rHK+BBNLKavCm3lHp/6rKPt3Uv4kGgPFlyZuCUyxaTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Thw+s4qdYO8SQXU9N7HA0sRw/J0et2+3mdtKo82XHdw=; b=BFv/eeizNQXuOPJcBf95rjRYqirfcrPBlxVIfNhIXqIgIdlSn0QbrjrOyUEFQMQc8paBvtmmobfnHHKO45YvwwoYn91pOKXx8d5JUFnwN20j9VjuKtUYDsp1itSY5XIURjk/NEEaPO0bX0MGFEHArlq6e6i4vRosvOASi6R1Hzo6Lqu79h5BcIajUilxIISqNZifMaf1hhNGlb7gxrFPLK8P65K7oap+j0wwPTQZxx5h3eOZ5mEf3/j5oi2FIBpL7W3DGbL2SiHO+7f+KIDwtTK4S6Ekd2VWoBD/LsHVjBcfNHOJdHwmi4mTxk8FZrRardd+1rk4Mg74myVvcejOlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Thw+s4qdYO8SQXU9N7HA0sRw/J0et2+3mdtKo82XHdw=; b=djTYzpjjX2yKUVKNmAvMPTBhcnNnq6a/1zyDc2r/nxZaPCLPQCJ38jFvRXHLa89zzqQE7QJpAkgodl+dGPD5xt9a6rtYPsCbdREc0Lm9nJprPRvZqWJLn+cmr8iZNsgRt58cfPum/y2SGbsAjpBBSJSAB6ALlQ8fls2aphQWQRM= Received: from DM5PR13CA0050.namprd13.prod.outlook.com (2603:10b6:3:117::12) by BN7PR02MB4131.namprd02.prod.outlook.com (2603:10b6:406:f6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.21; Fri, 1 May 2020 10:52:44 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:3:117:cafe::d9) by DM5PR13CA0050.outlook.office365.com (2603:10b6:3:117::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.14 via Frontend Transport; Fri, 1 May 2020 10:52:44 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server id 15.20.2937.19 via Frontend Transport; Fri, 1 May 2020 10:52:43 +0000 Received: from [149.199.38.66] (port=50830 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUTHd-00005o-Rf; Fri, 01 May 2020 03:52:41 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jUTHf-00043h-DE; Fri, 01 May 2020 03:52:43 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 041Aqep5019321; Fri, 1 May 2020 03:52:40 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUTHc-00043E-NE; Fri, 01 May 2020 03:52:40 -0700 From: Rajan Vaja To: herbert@gondor.apana.org.au, davem@davemloft.net, gregkh@linuxfoundation.org, kalyani.akula@xilinx.com Cc: michal.simek@xilinx.com, jolly.shah@xilinx.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rajan Vaja Subject: [PATCH char-misc-next v2] crypto: xilinx: Handle AES PM API return status Date: Fri, 1 May 2020 03:52:34 -0700 Message-Id: <1588330354-27942-1-git-send-email-rajan.vaja@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588328091-16368-1-git-send-email-rajan.vaja@xilinx.com> References: <1588328091-16368-1-git-send-email-rajan.vaja@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapsmtpgw01;PTR:unknown-60-83.xilinx.com;CAT:NONE;SFTY:;SFS:(4636009)(376002)(396003)(39860400002)(136003)(346002)(46966005)(81166007)(4326008)(70206006)(70586007)(186003)(26005)(36756003)(6666004)(7696005)(316002)(9786002)(426003)(336012)(5660300002)(47076004)(8936002)(356005)(82310400002)(82740400003)(2616005)(44832011)(2906002)(8676002)(107886003)(6636002)(478600001);DIR:OUT;SFP:1101; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bad77a4-de7e-4653-5667-08d7edbdc6d5 X-MS-TrafficTypeDiagnostic: BN7PR02MB4131: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 0390DB4BDA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L4+cXY+FA7xIty/vqSUUf8o1gueGiZnP53hQM6mbLi5NokBvXCASK70n/2hv3p4yvnu3WuvP8pmSyvl2XokzbpIbKBYRvoe3c3gwNcftG+MhxEGE6Pjtxcli058ZVAZS7LK/hTTngM+Y1dlhvlcKQeDCTXIBlGBcFNduiY7W9Xsgv8H3FNcWF5xDzuJBFTZebzOM4Dx8IY2MwY9PH4qeUMo1ySOMy+JmOzg9hO81ACnknPNlilNalT2Mb5f6J/dgFk1VeUAAE3a7oiIcRc2sSb1oajeGCsm7shN77C095ePhfZOQruSAmIIHi3Z2iBpvctXT4kdVwjGCR1rJ71VAXDAM9Tlj+nyMZKSBt4PcCTuakJgiCAWTErPB4o9vHL1djBpzWCpTseFLcOTUaIjz0gWeSxbmdL4QAtL+3plusD4FHgu5pYKLlLELwk76Vu6OWrZUDR+TgJdkbEnU5P0sswm9DH5H9uBnfVFbrA4p7SlSlrGg0jfUF1IC9TOWp5ZiPosaMvKVLzUPKRSD9gqKQw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2020 10:52:43.6586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6bad77a4-de7e-4653-5667-08d7edbdc6d5 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB4131 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Return value of AES PM API is not handled which may result in unexpected value of "status" in zynqmp_pm_aes_engine(). Consider "status" value as valid only if AES PM API is successful. Fixes: bc86f9c54616 ("firmware: xilinx: Remove eemi ops for aes engine") Reported-by: Stephen Rothwell Signed-off-by: Rajan Vaja --- Changes in v2: - Add fixes tag above s-o-b section - Add reported-by --- drivers/crypto/xilinx/zynqmp-aes-gcm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/xilinx/zynqmp-aes-gcm.c b/drivers/crypto/xilinx/zynqmp-aes-gcm.c index d0a0daf..a27e3550 100644 --- a/drivers/crypto/xilinx/zynqmp-aes-gcm.c +++ b/drivers/crypto/xilinx/zynqmp-aes-gcm.c @@ -85,6 +85,7 @@ static int zynqmp_aes_aead_cipher(struct aead_request *req) dma_addr_t dma_addr_data, dma_addr_hw_req; unsigned int data_size; unsigned int status; + int ret; size_t dma_size; char *kbuf; int err; @@ -132,9 +133,12 @@ static int zynqmp_aes_aead_cipher(struct aead_request *req) hwreq->key = 0; } - zynqmp_pm_aes_engine(dma_addr_hw_req, &status); + ret = zynqmp_pm_aes_engine(dma_addr_hw_req, &status); - if (status) { + if (ret) { + dev_err(dev, "ERROR: AES PM API failed\n"); + err = ret; + } else if (status) { switch (status) { case ZYNQMP_AES_GCM_TAG_MISMATCH_ERR: dev_err(dev, "ERROR: Gcm Tag mismatch\n"); -- 2.7.4