From patchwork Thu Dec 5 09:53:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274545 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B01F3138C for ; Thu, 5 Dec 2019 09:54:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 89CC924655 for ; Thu, 5 Dec 2019 09:54:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CXZklMhj"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="RBU4g+Vg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89CC924655 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RHfLbhlWM8e7cs38DdWC4uyW20lbwW4icqh/Yn6wR54=; b=CXZklMhj7qSLsv 9FckqeWE1ZVGJ9JtjjlwODy0j4sfc4OaUTuxE2pmsVrpMJptmt10pwLRfSn0u5LBbKmbPOWwvVPir DFtr8whfkMI42fNqgraiI5ZBS9p4baSmZ2OmhNZ+WkXfKadzlP5hlG5+NaZxTbC48IkKaoOOnKpO2 WLM/UkpQdgpsMQlHga9oZjwfHBBEKjfkr62WLKR0NY+18rzOt01MNtC8fo5wZ8AzwWf/khi9czqnT tMY8KA7ijzfy/b1ZkEv1OAevfdGg5p8tCkAeUSEguCPHJtXkde/fdwxySnAwfK2M/N21fe/Yrkcl1 EU1kVPGnkbHlbMnVuN6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpn-00035T-4X; Thu, 05 Dec 2019 09:54:07 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpW-0002qe-GK for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:53:52 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: K3sR3s3MPyg/PyXBh3yHpZqlZ8ONfTgbQyKzaFlRUCbJvIJdeMea2zf3vM6sFDqKxwjniIdOvV jcS3Z/c52Sl+T8TfPFKVYOK1Z7f484gzvfBby6HrGilom2VtKD3DVI/wYZFvPgHPa+E8zdKuCS zcYa/JAMiGRd7A764Fle9BZxnmTdyrbE/w0SL1XSn7ZeKEJjDsMc5wradLJrjTAsUmEizN6Z9T Ou1NJlZxhGGJ5zMDD9FrNUfyiStPAr5n6/T6hO+hVWIWZZgJ5Np09vEBcgewaDnHYufxFB9vo9 6YE= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="60720954" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:46 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:53:49 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VE5KfNsOIBDVG/YZnCo9R9rChMfqy0J6vdm3qn1vA0TA+hii5jomuw1oLAA5L8AwGpaWoE4Thu7JP9IL5pjy9W6azCB5ceW05+V+uxrD5n9BuGb1mNMIBTWjS8T91zCTFxY7atN+SJhkWjGSOKM0gNUFmONwzzYu1O7OmCUegYyegA6shtb+gYSu3v+9LArn+qkZfdiAfiZudmjdyzIo9b3KAkaDr5TK2MaFfN941+bIuhh+mf55hamD8W7Blildm2mQEvCj8UqbKTpm/OwDJac6hcjmopDp/ibuIz/Hc7++q5lthw98GTW/H1CHcmUH97+Occ9dyOUHe1ayfQ/3IA== 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=IOO8PmtaQNZuOVLYcw69z1A+SqhxD8ISuA/qBEJA7fw=; b=nkFO6iMannDdfZfGbFCey83sSLZn37NVJ0dC2bUlUHO3C+aPBePF6GTdi2iQP4lfMeHYoWzWfT3o1hg7azJ6pM37a6H4iH5gFjN5MBDp22bx8BHjlbRrll6OkOFGa2n+XRzkMSrxQTtEyG1hreWVruzCKP0UFDJo0D2KcHZCXfH8d1hVmb/JfEP3oYO/1XzRd5D+FUmPh2wplNzJw0nyITTtwuytRmZ0U/DWHX/aEkusgaIEf86OEgwTz5Y1ZXaJxihUdcpnPEZbW95CmVVJ9ldpj21b2tciDOQPFjUCNMFfb4fIXlkN64VJuH83M7n8FkGCE5nFnINv0OWQB+FHVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IOO8PmtaQNZuOVLYcw69z1A+SqhxD8ISuA/qBEJA7fw=; b=RBU4g+Vgt0TnET9chiwdPl+wJeiu3Aa/Dop2Ap+Mkxvdrsv0qoBov0zzv+Sl39vYeDNkq88WuPBnPJuN+e4nEuhHiL4nUVLdn6Zb/xzn9rz0wAJKpIR4IFZvHnR9snKep+lu0vfPXZntam0xMfixzQJxpR095ZCu35auvyVTgyY= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:53:45 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:45 +0000 From: To: Subject: [PATCH 01/16] crypto: atmel-tdes: Constify value to write to hw Thread-Topic: [PATCH 01/16] crypto: atmel-tdes: Constify value to write to hw Thread-Index: AQHVq1HiQdo0kwKAYU65ZEc/1MYA/g== Date: Thu, 5 Dec 2019 09:53:45 +0000 Message-ID: <20191205095326.5094-2-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b2fc5d9e-e5a6-4f9c-90d3-08d77969045c x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2512; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(4744005)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hv8CK6lhJoF+gOFjh5aDhckWSeExwAls/nYCXf4AoW5yuWpgoy+Y9NsTR03wwdd8wuTHCc2mcRmXk2RdBNDG++dSIUiAbjfLzco1zGcIhCqNB5Ub+dLXp89IHopKUImbZKt2UQmhuQW7vpP+SkWPuxbB+FZsnHo702IEGW1PIj9f2bU04VdMOAGKOi1fYXG1dXvbNpxiY5Zs0KP8gUZ4fFJNvDYW5gXz1QSm+XOq3DZRZ+y40CsdxKdmqxvtOPjKq3/QOuaaTs4JDJTdz7EL4H+Nm/cawXfqkLa+M9gxIvWoCl3ZPq+G8fNwuAmXlsVyrogaG/U5DwXWxpVssebl96icKLWhgWsxznHCJDNwVLtG8ycrN2xcIvIqW2I7aoMCTRPg+uy19/5Er0rg6wxXl61TJQJiFM77MqAXJqadieo7l0aE8rpzWy7whqNRuwqh MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b2fc5d9e-e5a6-4f9c-90d3-08d77969045c X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:45.0195 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EEXexdC9i2rBxqqTiayWOdEm/+N3A2GiUP3nJ8YrnIxBGIi5fjWzDmeotQ00F0dLI95A95IkYfQ9wZ72X4cDRSE67PDh13Mb4Shaesqvd4E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015350_595309_25070289 X-CRM114-Status: UNSURE ( 7.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus atmel_tdes_write_n() should not modify its value argument. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-tdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 0c1f79b30fc1..9b69e7a26639 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -189,7 +189,7 @@ static inline void atmel_tdes_write(struct atmel_tdes_dev *dd, } static void atmel_tdes_write_n(struct atmel_tdes_dev *dd, u32 offset, - u32 *value, int count) + const u32 *value, int count) { for (; count--; value++, offset += 4) atmel_tdes_write(dd, offset, *value); From patchwork Thu Dec 5 09:53:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274553 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE732109A for ; Thu, 5 Dec 2019 09:54:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3E63124651 for ; Thu, 5 Dec 2019 09:54:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NB55Nmv/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="V1fC3O/I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E63124651 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WXAYkZ20pMUcXR+elfNkYQpgnjjEaim7MOc8tfjk5Ns=; b=NB55Nmv/kGiD5a G4/+Z9IqmeuJqcM0qKo23I5iI38GP024H9rxvLXo3kXW4f8np1OI1WCgFZOBZTgk9MpvhkhtvMax4 MAr4SXdQrE00punsb70oLWMdV9omnYxgP7h3wBZZdI/Bufp0Vtw0uQuyxYDvcJN9wmRU5byQuzjWN QzT/BSNHCiZNeWQycAVDI/L2oXjIPP3NUG7rHSu2EX0jgEr0EU4kdD4FcKiF8UXo+n1mJnmdt2pl1 m1vP53QCivkbZiRgBZ8dbvXSC/9zHPDlDE+E2FDoUwpq0wKWc1LeyFRlVvHxDimgZeKohMgT0W6bw v+UJXy2z8m5aa5VM2K5A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnq3-0003Wf-8s; Thu, 05 Dec 2019 09:54:23 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpW-0002qf-Gz for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:53:54 +0000 Received-SPF: Pass (esa3.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa3.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa3.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: TmwG57nGtPEW1qnWkA7UfgOV1HaSzCU9+TdmtqAxXB2Jo8t7r4Y0AvIvQ4Em/N7G/YZ71RIPYy 0J3Ixn1Nh9zkcJQh7D3u2JNKd6/255a/jpxP0HiDXoK6EA9iiwQLb8/QMl6AmV5XtIa5uxwdsS JD5H+eko9GRu80CMvaJ/3b1ZAQdF5q+wU25G2Rsv5Qg+HwmJ7uazWPoonEG8y33CDfN9oeKfnI R0KDsXhWglBx8SRaHEphyJlHD0z9EDOt50Sq5tQftbkWh0a8sR6NOxNgvJUeMjO+IVPfVnyg0a Lys= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="59347306" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:48 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:53:50 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sxv0oKueKwz/qZXOSy9Vv1XImPxIJmnnYv5eNm7L8QsWszbKsEkheoWceY9295VUMB53iNm39C2hr/QvCpXO4VMMlQ+BMOMO+ZAQr1QmvW7HeAecq85/rPzDEHmD3q0WKaQX7J7CCjObV9rlrZf9W7u4SRI1gpugQO7Y30C7uAi/h9YfhvCilmcqfiG01YkMmqPszsQ9LZQmbSPu+uIZDbpt+gsh0I52JAQCL5nxXLYJ3smcD1hlnugjiGapSdTCEVeGWfpQkuprxKjLpuSOg7lOQ9JNL/lID9Kwetjm7MD4yxKREmSYpUIGUK8OZeDlAeIHLcOCUWKZCvVHd9Qs+w== 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=hXA+XnseAC1Qe6w9lVKYyCqn8salS7FIgQksEUWoFsE=; b=lMI/GOd/oV9PmInYfynC40j9Hc4ay8wNx0AgLsO019NDlDBci6mIukPJnX2MBNGh05odAGoX4GuJD+WWrhFWBwgO0KmnRtWTZhXp7lovASfGtpNYYgx2yKWli+TKzZ2+CjKQyMLtVllIIhUqTUINF70zxWkfwXBawQVk3W8pNrCnbm49wdog4WkwEqxC7R7CUumzfOLruD4cWrzMZnkOv6QNqhGXmTijnzEMiovAP3BjNFuLv3+LmRwdynRcKEZS96lrdIWljYyzaYTUZ5/kZb/z1fFTPQ4p2VJWkzFiiTqGI4HKaGg1CZtJ8/c0xzYDwqgrCWx1iEe/AmGG6vZQ6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hXA+XnseAC1Qe6w9lVKYyCqn8salS7FIgQksEUWoFsE=; b=V1fC3O/IxJ75raJJCrVlSaC6tbP+6yFNKCRHD16wsmcVjvG2C29A2dt57I3fi5J4oGkuS9nwovFclANYeUrcGNf2T7yhSgwqJj/HRRfxlTQXaSsvFZi/R8KSDeWJP9rBRpCOKTtfwUBf4edUZBELecxYLROP72JznUlxlqsjFNU= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:53:46 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:46 +0000 From: To: Subject: [PATCH 02/16] crypto: atmel-{sha,tdes} - Change algorithm priorities Thread-Topic: [PATCH 02/16] crypto: atmel-{sha,tdes} - Change algorithm priorities Thread-Index: AQHVq1HiMEgFlFkcD0GAuCy2Po73TQ== Date: Thu, 5 Dec 2019 09:53:46 +0000 Message-ID: <20191205095326.5094-3-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 29f6a808-bdad-49a5-64c9-08d77969055b x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(107886003)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: B2/oUNv0fcSJxBH2+cR3B5tHBk38W54iV0N7Wijy9UwK8JP8lpwThH54LkuNS6HQ3l/BlJvhRNKtY99KNmefLQpHX75tAkNqClA4bMNL0BdYYx24Er2BAEclzS0EqqZx3MB+FdEpWKF9mpe+SM0JsrkCMLliGHWSv0kKblaKZ3ucRRSZmzmn2tn1Xdap96iWeaaT8va91qOD1T/W0QdIlwYjxngdAkC+Wr+Ly5JccP369+r++q8bgRedO1XEdAoZrur2AIiXgCF0u8ltK30Ak1LdskUwZgjYXnsoamAkIQjyW73k+CiiIMcjZHE3W5cQX6bBNlwRa+nH9gN8EVbSklMgQEBAL22XIkzS5OYtl+B++/AqWzK858NYFjm6MmPl3d6SVqwOBzWbUBN1mKDXFjV82VxqOIHSaf0KCJI4nLy+H9oEuTRUQt8fo3bk3BlJAEviflKEPSOLakDJaecoAkHbT2v0MuDTqBvM2b+ZPP3THr0uzA1frB5LqUg89WW4 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 29f6a808-bdad-49a5-64c9-08d77969055b X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:46.7045 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tlej7/C20royESG81HyJ0r5ySoU2hvHKejITPxZGl0ViqejoU28+ICfBf8aylsPYd5abT9MCvkLo0uazaUfbywXkgSdqprAGl0BbYSvQVrY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015350_640895_18BCFA11 X-CRM114-Status: UNSURE ( 7.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus Increase the algorithm priorities so the hardware acceleration is now preferred to the software computation: the generic drivers use 100 as priority. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-sha.c | 22 ++++++++++++---------- drivers/crypto/atmel-tdes.c | 22 ++++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 8ea0e4bcde0d..3bbec58bf2cd 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -40,6 +40,8 @@ #include "atmel-sha-regs.h" #include "atmel-authenc.h" +#define ATMEL_SHA_PRIORITY 300 + /* SHA flags */ #define SHA_FLAGS_BUSY BIT(0) #define SHA_FLAGS_FINAL BIT(1) @@ -1263,7 +1265,7 @@ static struct ahash_alg sha_1_256_algs[] = { .base = { .cra_name = "sha1", .cra_driver_name = "atmel-sha1", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA1_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), @@ -1287,7 +1289,7 @@ static struct ahash_alg sha_1_256_algs[] = { .base = { .cra_name = "sha256", .cra_driver_name = "atmel-sha256", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), @@ -1313,7 +1315,7 @@ static struct ahash_alg sha_224_alg = { .base = { .cra_name = "sha224", .cra_driver_name = "atmel-sha224", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA224_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), @@ -1339,7 +1341,7 @@ static struct ahash_alg sha_384_512_algs[] = { .base = { .cra_name = "sha384", .cra_driver_name = "atmel-sha384", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA384_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), @@ -1363,7 +1365,7 @@ static struct ahash_alg sha_384_512_algs[] = { .base = { .cra_name = "sha512", .cra_driver_name = "atmel-sha512", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA512_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), @@ -2099,7 +2101,7 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha1)", .cra_driver_name = "atmel-hmac-sha1", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA1_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), @@ -2124,7 +2126,7 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha224)", .cra_driver_name = "atmel-hmac-sha224", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA224_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), @@ -2149,7 +2151,7 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha256)", .cra_driver_name = "atmel-hmac-sha256", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), @@ -2174,7 +2176,7 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha384)", .cra_driver_name = "atmel-hmac-sha384", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA384_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), @@ -2199,7 +2201,7 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha512)", .cra_driver_name = "atmel-hmac-sha512", - .cra_priority = 100, + .cra_priority = ATMEL_SHA_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA512_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 9b69e7a26639..a6b36abba3d1 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -40,6 +40,8 @@ #include #include "atmel-tdes-regs.h" +#define ATMEL_TDES_PRIORITY 300 + /* TDES flags */ #define TDES_FLAGS_MODE_MASK 0x00ff #define TDES_FLAGS_ENCRYPT BIT(0) @@ -929,7 +931,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ecb(des)", .base.cra_driver_name = "atmel-ecb-des", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -946,7 +948,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cbc(des)", .base.cra_driver_name = "atmel-cbc-des", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -964,7 +966,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb(des)", .base.cra_driver_name = "atmel-cfb-des", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -982,7 +984,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb8(des)", .base.cra_driver_name = "atmel-cfb8-des", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB8_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -1000,7 +1002,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb16(des)", .base.cra_driver_name = "atmel-cfb16-des", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB16_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -1018,7 +1020,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb32(des)", .base.cra_driver_name = "atmel-cfb32-des", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB32_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -1036,7 +1038,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ofb(des)", .base.cra_driver_name = "atmel-ofb-des", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -1054,7 +1056,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ecb(des3_ede)", .base.cra_driver_name = "atmel-ecb-tdes", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -1071,7 +1073,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cbc(des3_ede)", .base.cra_driver_name = "atmel-cbc-tdes", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), @@ -1089,7 +1091,7 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ofb(des3_ede)", .base.cra_driver_name = "atmel-ofb-tdes", - .base.cra_priority = 100, + .base.cra_priority = ATMEL_TDES_PRIORITY, .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), From patchwork Thu Dec 5 09:53:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11F98109A for ; Thu, 5 Dec 2019 09:54:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E202F24651 for ; Thu, 5 Dec 2019 09:54:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sLQkNrQH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="obB0rWTi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E202F24651 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e9YgIf8EyQBuuL3E17JAJ4xqVRI9hRMseuu4VH61474=; b=sLQkNrQHSSuhsw JqkgveCmyuKgTT6qKyXiWhzwMh1I8NYV0w/w5c9ZYQDiEPAz0IAkr8UqkKsnHASI9r4u9aQlzYhyU TX4tzm8YpuleTMJGpPmRED4rEYBWCzdrzfD1qYISiwI4yQxanGuYN6I0GI/HN/4Qj1Our1+9LSfIg aku4sOU4Mqxb4X1WuWDrAwCwElflAntU4YnYzpxeNOlkRSk/bijgLUhANPkjMqeDbOXnK6G8cXI83 45AKXCNWQ6E8xFNm9kf2TFcAUNqw9fVo2ImBXT6UNM5RqoJ5F0bmSX/F2WmmWfcEqzFVKLUEnfpKZ ed8UlnDo1ptR/7VEMcNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnqH-0003mg-EC; Thu, 05 Dec 2019 09:54:37 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpZ-0002tU-LU for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:53:55 +0000 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: PNgXXz95UjId+Hb3U2+E8Kpn9FGmn6ik2/Om4Eu7+iahHgJnPDMKq5PxnCM4GsDhuDtIVyO/A3 SctJJuAUext6B0n6dCMHn+XizyT/3+dh1gqtEoNW2i8PheYCucO7vltVj/XutH9gHBT1EDE8ZX 1nblrHbr7IaeRzZzNsVgN92Y5BsVvJcd2j5cFC5oF6SS7hNCDYgwcIJqNhQQpU7DeYRrlDXJeh fyz5dOTCSB0WueQGbzvKHShKWfjtWoe+62mFd6uVt/eYDj8isVH0hlvGBnt//97/eiImvEHIem XIg= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="56727485" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:52 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:53:49 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+wMCodjntEXyRsZzkB7b0IEhNjOq4KdL9KVVBzbSFlgxGr3sFC6ggUN3vpsWr1pQoV8/yYLHlk5VIXiFlj+jeDLFyZxFsAR8akc70H3u6TCWNDAbf2PW6GtR4EBeATemhqKJ/sg2xdRfTDC2bAyIASD+PWv+urQHvBIK2GwH5C5cv7e0Ln4jCS5mV+BbDQSErnlE1GoCJ+A7HuTUte9EJW/5p0Y+ONCR8KpE/3BwGzO0FZZeBSSyidNS3IgVzMV+nF28nqnkfQQZPqqp12d4780nnrcYf6EDlwrdB+3s78xmFNC/bHA6HVs9XykkzGBOVVEbokryVJ1YISNsEZJaw== 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=ldXAqFTjbIpsLqqTAA6PBPnNaB2lxCFmQ+XhJThz9tM=; b=RHqzzVTaEM4j/qU4/z6PqTdAYfJuMKSKRoWkivQeOMHx9dB5cOu+H0A6sldW3TUWwl3sQl5dQ4DZuHBZ7SBSzs4SlsCeJQGi/ym63x06YSQcnJmO8lIFyiuJgm9B1VVqrQQX/zHEyQaXy+1Lo+hTwuWDe82YbaSQNp/Av5QfLXcYUYkcppyUpfZtSX/Fnpc/mGhRME77KqohW4O14KyUsRwX3D1dZB5FESX6c6QbLVjo/+c6TUkmf76iUVFkeCVNPtDxqiEGUnogufY4PzMCujJKCmsDDGWor2MmeAQ91qpq+zcJxftNhCrPeIyZVe58WA6D3LEGPgbl6uR+EufqMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ldXAqFTjbIpsLqqTAA6PBPnNaB2lxCFmQ+XhJThz9tM=; b=obB0rWTilb8cjAkTAop9XF4ioTtwF6C8n2QGyJmAanOIF0DIv6CXasJvbAZFjDxqyRMl2nvEQDr6FfKqzJCOJNmVAWhc0H0HfEFWm5en9E79tfQwVli2TA7m1xgjJueZ8WGzVqIzh/BX9ehRU+CJnk+4bPkep5sR8syv/BE1o7s= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:53:48 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:48 +0000 From: To: Subject: [PATCH 03/16] crypto: atmel-tdes - Remove unused header includes Thread-Topic: [PATCH 03/16] crypto: atmel-tdes - Remove unused header includes Thread-Index: AQHVq1HkXDSMVXrvFESo+HMrRCMz0g== Date: Thu, 5 Dec 2019 09:53:48 +0000 Message-ID: <20191205095326.5094-4-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2b3d298f-fb04-49ea-be7b-08d779690664 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:374; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(4744005)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UdkKF+YnD2nYiamonXrfJ2mc/d/449dayWSaJeMRceSPMC4hjETQGnPO5pSof6DTEnjPK6Bkyal351EaXhx4EnwgRSVK7l7yh8VRxMS4im2AG8k0b+Enq1Ju/oDWmHwM+dd9niGFEbG9xNWT7QHI4EFqHC4pCUqvC04t7hIBLUUkY4P77279V82YLIR3FIW9uZ+F4Y2d6T0KW2WEwE7plfwprrWNqlgh8sbQ2ySqcPO8rLcywWUKBvOILvbWYcKp+hShacuSZsbzKUr2CmYGlep4wjqi0iKaAC6dMyDiB9uwifuPvr9Va49iDL+YGIpuJDVmq3rV1UjJTDOXKcZay0CVMWkFVwFY6KzSSFM4yCgnDj7XSrIMTnKzC8n06wpg6mXHH1h3C55/o0fQJW9u1wTonvNJnaYo9uyQKTJfVfxq3a5NId/9ZOCBS++HWGGB MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2b3d298f-fb04-49ea-be7b-08d779690664 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:48.4375 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: poDPU+RMrqE9k2OGoxpEmOxeLOFrhRla0FD3MXqzb745IsSmakbC3b/XK3izxtAVFJKrHJShD0RBOVeen7711gi8v230MhKv6HLyxsn32NY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015353_774619_781F9E94 X-CRM114-Status: UNSURE ( 5.35 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.253 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus Hash headers are not used. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-tdes.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index a6b36abba3d1..1b1767ca9444 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -30,12 +30,9 @@ #include #include #include -#include #include #include #include -#include -#include #include #include #include "atmel-tdes-regs.h" From patchwork Thu Dec 5 09:53:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274577 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F818138C for ; Thu, 5 Dec 2019 09:56:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3B1532464D for ; Thu, 5 Dec 2019 09:56:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XdKqMN7E"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="uW4XbtAv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B1532464D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mp3mQwhOvuVcZXUW2hdcSy9p1Uf77duEEwRJDBMQlrk=; b=XdKqMN7ESM8igL Wt0OyXVglfJnY2tAtpA7pcYJlQKXN7XXlIgUzaUW/9Lnwfihs/KYiK76ocVLe+thX2kbx1gRmEZGU niMuzHbdWrY/1htQHMqgzLCzkblZxBgKJRM/P3f6YAe/oWEkGjhrnKVotm+6qWUzo5ABrZh97WhtC e0j3FgqAyUmSSDjmvB+UNFU1PgRDJZz88sX0m6gDKpRhY7oYkm3LHkNvqKRiYc3QOiWWzpG3q7Fjn U5j8mriFLAAdXJqIKr4KUHkK8FXvslKXn3wdaTkr1h++D5fFDnqnNUEfotGNqa5gc8mnyskdwwHYH p1N6cck1QrWwLck7MrfQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnrb-0006SN-9I; Thu, 05 Dec 2019 09:55:59 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpg-00030j-On for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:02 +0000 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: mvrC3xOwnAcgryn910WMshypjFqmoH6Pr7vQ6aek52q2oO+RvzByEDKljyFxtDKYP95Plkdkg9 kN62HxHZ1LwrpGSLJmnOLDGmYb5FSuAj+AePUNbBYrT/yNcBrIbYKg+3jLFsySw0sRAoYDrh1R V+Wtpkg4RasHgV3BO4q0hlj9hV1bruf0J/UvP5SAK4WS6nZ9qazx7siftWbERRyuWJLpISja+Q IG7P6NvWdEFWraKrjIOnMYByeB/eFuwY3KGWrt6IzHLGQfQZnTKhksZYMr695Qnh3LTDRv22NM X6w= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="57544835" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:56 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:53:52 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ayJZbXF59jqlORHEK7GxEeRbV8EitzLEATdd0zkDAFVd9YCakEQlkTlELLcioQIe+8BIs7RwmpS7ACo9FSbR5WMVdISSVey2slf/D/UKzk9UU2bYJZFv+UqQj8atJB0xoBtIDM5/qIYUjopRgs7SKkZg782CqNusppOVcjiKsTpq0uSswbvCF+7Q/95AlBk5JKARWEuGHqiwUWradwzV76njbLR8eD7vHGGDMVGOeSRslUbx/QrMJbhprAACQ3R/X49Kr3u+BP0H4YeMPjS2f0wEJr+/iZdOtZXPR+f8yZUHEtDAoNprbiSMewikIzbtAuPeKv4Bjg9owD7Tmbrf9A== 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=mvSrvoS5dVkNU+oGN2yTf3DQHoV59G2i2Qo6vcY+f9M=; b=TgpmPneSWdIUhwWnLA2VJj4KQDWefGnr06A5GSxmBfGBYfbZagdYADmN5SSFzZ5icWURLMp9VPbwCqJSMmp4AYUzAOs6X/P4pYRAA1bWAGDwErgnGzrH37mGeTvYmDVv+fKVmbxbAQoGm8mmDs9Xt/G4Zn8sbMfyvl+4xsebjoJ9rRgmPTnJIl54Xn8Dpw5dg81Wfr9F25Gid6AWv9vigEdubfZ10p6MmWOQZU0BxJvZcwIm3KvPpubAiiu9KH+sqA5sGs0lBJ25Fx9us6xphxUzhPbNQLCvYVRju2abftzPZAOlQ3fslTJiRz4iPoq8eWnu4btfGgx/e4GqogdQjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mvSrvoS5dVkNU+oGN2yTf3DQHoV59G2i2Qo6vcY+f9M=; b=uW4XbtAvZ6utytbEWvjWxKLgJmZurVwG6d07FSN+rjPGVYu78BTCfb9BViFtq5EF8o3y3N6jnIBN0AljPKSvfn488wzVjPgqDVSk+MrhW0MKqGQSxqhzykVy+zb4p/dVdtK9PjUo2q2e0ULfua7TKN84UkUlwZ3A0BxYkH6accA= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB4288.namprd11.prod.outlook.com (52.135.37.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.20; Thu, 5 Dec 2019 09:53:50 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:50 +0000 From: To: Subject: [PATCH 04/16] crypto: atmel-{sha,tdes} - Propagate error from _hw_version_init() Thread-Topic: [PATCH 04/16] crypto: atmel-{sha,tdes} - Propagate error from _hw_version_init() Thread-Index: AQHVq1HlIYTa3qx/o0e+5eYjgTGE8g== Date: Thu, 5 Dec 2019 09:53:50 +0000 Message-ID: <20191205095326.5094-5-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 949bd7b1-98eb-4ce4-2129-08d77969076a x-ms-traffictypediagnostic: MN2PR11MB4288: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1169; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(189003)(199004)(6506007)(1076003)(305945005)(4326008)(2616005)(86362001)(478600001)(11346002)(102836004)(107886003)(2906002)(50226002)(5660300002)(66446008)(66946007)(66476007)(66556008)(14454004)(1730700003)(64756008)(76176011)(8936002)(52116002)(81166006)(186003)(5640700003)(81156014)(36756003)(71200400001)(71190400001)(54906003)(6512007)(316002)(6486002)(25786009)(8676002)(26005)(6916009)(99286004)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4288; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZJOB9lrb2Iv2qFCBxPkbf61byBKWRIeHHEo96dc9cNt1aCbMmzimWswZD81VJkDenLYJLnz4TQFH9R64zewZ6Nm/jUdce3qOheHxyJvzJJKElqbDvkcGgMTj0fN1v6c1e7UBFc+A5qNbIHuq6WFC+4SQaSELaflSDuNbmt3W1XpAkJdnAPHil8vNS6XBDJDTdO0eZVu4EI0ESeDWOcUMHEwO6MjOW50uBUDujWSiD0Eqd5aM1tNFbhIw8fNe1KbgzPXO2cmu/3m2uYnEghKRSPBGMnXuoULZTN7bHKYxA9YESikMULs1wppvEYqWpP6VLPLPSr266iaav7MzHPNjlhfZUZay3T79OwbNy0uMl6aNRzQNbZzbhMwDO/DxxLww6Lk6sOE8G7ZbgN8Eq82TPjXVXFpZN7lOgnr713FHvGJxmiAP1UXjEgjsumAse+8CfDboQ4j6KaiLosp2dC5U+VkwR5fJw1DX6bfmuIqDre7OKUQvoOc0wMzGcmKDUg/x MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 949bd7b1-98eb-4ce4-2129-08d77969076a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:50.0956 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6/PXqWM6g911pFXIwoyebhNfmJris6bkwgJWOLJyXxgZx9DqI9miDuTN2NAAeVEPNnjmXurbD0gMnBivfrLWyvr69z6Lno8MYgo5KUHOyxc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4288 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015400_872108_23A0D6A9 X-CRM114-Status: UNSURE ( 8.23 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus atmel_{sha,tdes}_hw_version_init() calls atmel_{sha,tdes}_hw_init(), which may fail. Check the return code of atmel_{sha,tdes}_hw_init() and propagate the error if needed. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-sha.c | 14 +++++++++++--- drivers/crypto/atmel-tdes.c | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 3bbec58bf2cd..bf53b8aa8bfc 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -1038,9 +1038,13 @@ static inline unsigned int atmel_sha_get_version(struct atmel_sha_dev *dd) return atmel_sha_read(dd, SHA_HW_VERSION) & 0x00000fff; } -static void atmel_sha_hw_version_init(struct atmel_sha_dev *dd) +static int atmel_sha_hw_version_init(struct atmel_sha_dev *dd) { - atmel_sha_hw_init(dd); + int err; + + err = atmel_sha_hw_init(dd); + if (err) + return err; dd->hw_version = atmel_sha_get_version(dd); @@ -1048,6 +1052,8 @@ static void atmel_sha_hw_version_init(struct atmel_sha_dev *dd) "version: 0x%x\n", dd->hw_version); clk_disable(dd->iclk); + + return 0; } static int atmel_sha_handle_queue(struct atmel_sha_dev *dd, @@ -2811,7 +2817,9 @@ static int atmel_sha_probe(struct platform_device *pdev) if (err) goto res_err; - atmel_sha_hw_version_init(sha_dd); + err = atmel_sha_hw_version_init(sha_dd); + if (err) + goto iclk_unprepare; atmel_sha_get_cap(sha_dd); diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 1b1767ca9444..c47ceb593fa4 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -236,9 +236,13 @@ static inline unsigned int atmel_tdes_get_version(struct atmel_tdes_dev *dd) return atmel_tdes_read(dd, TDES_HW_VERSION) & 0x00000fff; } -static void atmel_tdes_hw_version_init(struct atmel_tdes_dev *dd) +static int atmel_tdes_hw_version_init(struct atmel_tdes_dev *dd) { - atmel_tdes_hw_init(dd); + int err; + + err = atmel_tdes_hw_init(dd); + if (err) + return err; dd->hw_version = atmel_tdes_get_version(dd); @@ -246,6 +250,8 @@ static void atmel_tdes_hw_version_init(struct atmel_tdes_dev *dd) "version: 0x%x\n", dd->hw_version); clk_disable_unprepare(dd->iclk); + + return 0; } static void atmel_tdes_dma_callback(void *data) @@ -1309,7 +1315,9 @@ static int atmel_tdes_probe(struct platform_device *pdev) goto res_err; } - atmel_tdes_hw_version_init(tdes_dd); + err = atmel_tdes_hw_version_init(tdes_dd); + if (err) + goto res_err; atmel_tdes_get_cap(tdes_dd); From patchwork Thu Dec 5 09:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274565 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C570014B7 for ; Thu, 5 Dec 2019 09:54:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9C1FE224F8 for ; Thu, 5 Dec 2019 09:54:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OL4Ikkjj"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="Zr9IAIg0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C1FE224F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+DPidlROdKLSbVCqvYyciHKmIq7aJ7OE/pTQDCMxwXc=; b=OL4Ikkjjk7rAWR BPb5CANRcRlolniK90WUdTYRcc/QCoSBZR7QxO3DV7pURgBKNpvwmGC9alqaILzZaDf50CyUeAJaI hXWE2lP9NlhqzgF9Ji6x1wvUiNSpssFnjwI+5m5Dsb9iIgBRjlWEx2CnZeKRHX4FfqzoQnRYBNmcx LcMlznWHa9tLJKF5s8MO0gUiQvNofgLP83FJSzAP/ruD6zuSMuyWYXAPvpuQfAeN8z4T5jTkH2lwy NnBBvzXKyLKwtNV2Q3rug3Wa7DPrOMFzyehJ6g2Qm64ipe748MDM9MKi6rPML107HaIc0J1vAre9V TOTxJxUbovtYhI+ehKMw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnqZ-00045s-Hn; Thu, 05 Dec 2019 09:54:55 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpa-0002v6-NA for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:53:56 +0000 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: nAraF8Z1WJnLPSx/pW5Jf+syvA05dKgfPX8hNNy8rwni+B2oVlY8H1lVrtHoHE7Lwc7ye6doVW hCjpAN6k+eLycYeX5KlBCkJiGbh+dsypXVrm10D8hUeZYtnh5Thz1f5R/efqTsgvUg1qV7KgWq GAObcB6lzqbx8Fh02pM1th1RK6blUcR3Gmg8feHaa+4qJ0QuTjthEMvplB23Nejg1AkRjc6K/N Z9je2did8cQH44r1Ms1p1Dpa6qA9iNerMxoKGBa73O1Y1oElfVZ+clHDjIp3bEsZ174bFFIfx4 ZP0= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="56727487" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:53 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:53:53 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ys+NhBOJZTcaO+wKQzKxWp79OIGuZz9232uuHPK5Cb9ze9VCMrjoO2fjmyZSzS3/3el2Nylgr2g0z/Fb+6RI3jT2Z6FMv0ODZb0qExuv8RWv3kgMQKwz8/jtNGjtbZH+AkSi81uT1DQVfjosukkfFFOfDRx/8CqCbquVoJz6pTe+xmcHE8MmmxcgFdDDKzi3fAW4mTlFCKhKwMKWNkZ0PnTGocYXEK3BVbATM3a4s3dc2fxuNr2+2AvoBtLO1SVPajsfZXsmMmogpt7dVQAVzzY6GTlx718UhahDfyJ8z+SQ/uYQvNX3XvSnddkInuXv/YHSV2Dd4IYe/rV8tpgKsA== 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=Cr4SYo9OxlgO2sVpVu17o/n2cbERIBgvQtBwUP2ML98=; b=c5wOkIzXdq19+GOMQGa+/Ag/q6Mih6FnEeOKVmVhKyM4G+rsDR++473ucKbVG4mH9o2VDURwFNNTgaaIOFonDhChuczWwWbgIdpWz8g4bOqiwyWNeOsaSmDO9+DXnQe6W1/UP6BjtgelolsN/Jdi0UskyR6pH06litFkOt+Dq7hbiQwYusEKdLmkyfTTg8a2ffrtwiRoiet53M0pzhbxudsLQkYzY5uiCFSX1reOpSw/U+I/vyf7GUs/XeiK5vuoPIn4/NuXTQNmIvyx3QmFeU7FzHRJGe098Vo6ZoyFwnnHPrscrGoIKSVHLH7kthm3DZFFY07ShHxLZ3pucNPTIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Cr4SYo9OxlgO2sVpVu17o/n2cbERIBgvQtBwUP2ML98=; b=Zr9IAIg0QlfkHm+dNY5zUyv1ULlcHL/tWYkUnYabXTXfaWOjxyihOt+BQUY0a2hTObg3tJTkQoo6/fhw/jZpyfwoBp1EMmJ1f5Et6bSo8dzsKJC+qbM+8IBv0Qo3rjrFS4S/KWGhi29mmgQI9XsNxE6uUeWVc3gscUxlsWg9k3Y= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:53:52 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:52 +0000 From: To: Subject: [PATCH 05/16] crypto: atmel-{aes,sha,tdes} - Drop superfluous error message in probe() Thread-Topic: [PATCH 05/16] crypto: atmel-{aes,sha,tdes} - Drop superfluous error message in probe() Thread-Index: AQHVq1HmlpXgnPH4V0KtO9/Hzu9rWg== Date: Thu, 5 Dec 2019 09:53:51 +0000 Message-ID: <20191205095326.5094-6-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc2e9a7f-f10e-4706-0002-08d779690887 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:281; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(15650500001)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(107886003)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w2WENlLinklQ6R9IfvN8aoA1Z6iHRKZEywiVcC97W9J2KydnBB1Bewq0HS9UMFvP6vBV9skwLgZ7r28cCnm2lm/o0MreWV5Q0vU6bw4Z95jW4qFq5rAe35Z49+dsdvHiF86P0A2R8AlY8RL2OX+eZRvMKlRGjDd4b9teKsiNfcj7/DkT6ZgPW3G2f0xEVkLK/WiDUDS1R+oZMcD28KsJlrC7lNtTl4FTvp8gy024Zktx5HWpKKIS+rMXFDDi00Q7qXU6cn9dNU8llIazyE7wyBwHFixdGosIBNywo7QezxoaKORugNcBEWGh2INrxWXanmXmYKpFhoZPEG+pZOqYpAf0xdj6vUOgigierDAgHm9D1FLRgp7kM3i6c3kvSxUs1MXEMIqYdMZ3bItYCkvnHxD45b7p3y6t18B0yMIKlE3XoetbPQDkOy+75daHmb5VAqLJjHiD+U2CCE9y+zua7w8OXH7yBaaJX86eXYZB7DTYzvntQlKtfDRz//ZQXYCw MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: dc2e9a7f-f10e-4706-0002-08d779690887 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:51.9125 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: U8jXK9J5EHSwmyq9nmYPO9Shu50YV9K+KpLcdg2tAXkwN3RfuigD3WDXeQdV3jNTh+A+cMBzkTEHKnIDBhNj5IouGf3l6YupGzu8936UXm4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015354_827673_3802B38A X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.253 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus In case the probe fails, the device/driver core takes care of printing the driver name, device name and error code. Drop superfluous error message at probe. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-aes.c | 21 ++++++--------------- drivers/crypto/atmel-sha.c | 8 ++------ drivers/crypto/atmel-tdes.c | 8 ++------ 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 91092504bc96..1cb5564e73f4 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -2620,22 +2620,16 @@ static int atmel_aes_probe(struct platform_device *pdev) pdata = pdev->dev.platform_data; if (!pdata) { pdata = atmel_aes_of_init(pdev); - if (IS_ERR(pdata)) { - err = PTR_ERR(pdata); - goto aes_dd_err; - } + if (IS_ERR(pdata)) + return PTR_ERR(pdata); } - if (!pdata->dma_slave) { - err = -ENXIO; - goto aes_dd_err; - } + if (!pdata->dma_slave) + return -ENXIO; aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL); - if (aes_dd == NULL) { - err = -ENOMEM; - goto aes_dd_err; - } + if (!aes_dd) + return -ENOMEM; aes_dd->dev = dev; @@ -2741,9 +2735,6 @@ static int atmel_aes_probe(struct platform_device *pdev) res_err: tasklet_kill(&aes_dd->done_task); tasklet_kill(&aes_dd->queue_task); -aes_dd_err: - if (err != -EPROBE_DEFER) - dev_err(dev, "initialization failed.\n"); return err; } diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index bf53b8aa8bfc..e85fa48e3d10 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2756,10 +2756,8 @@ static int atmel_sha_probe(struct platform_device *pdev) int err; sha_dd = devm_kzalloc(&pdev->dev, sizeof(*sha_dd), GFP_KERNEL); - if (sha_dd == NULL) { - err = -ENOMEM; - goto sha_dd_err; - } + if (!sha_dd) + return -ENOMEM; sha_dd->dev = dev; @@ -2871,8 +2869,6 @@ static int atmel_sha_probe(struct platform_device *pdev) res_err: tasklet_kill(&sha_dd->queue_task); tasklet_kill(&sha_dd->done_task); -sha_dd_err: - dev_err(dev, "initialization failed.\n"); return err; } diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index c47ceb593fa4..9baae2065474 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -1258,10 +1258,8 @@ static int atmel_tdes_probe(struct platform_device *pdev) int err; tdes_dd = devm_kmalloc(&pdev->dev, sizeof(*tdes_dd), GFP_KERNEL); - if (tdes_dd == NULL) { - err = -ENOMEM; - goto tdes_dd_err; - } + if (!tdes_dd) + return -ENOMEM; tdes_dd->dev = dev; @@ -1373,8 +1371,6 @@ static int atmel_tdes_probe(struct platform_device *pdev) res_err: tasklet_kill(&tdes_dd->done_task); tasklet_kill(&tdes_dd->queue_task); -tdes_dd_err: - dev_err(dev, "initialization failed.\n"); return err; } From patchwork Thu Dec 5 09:53:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274573 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1021138C for ; Thu, 5 Dec 2019 09:55:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8D4B2224F8 for ; Thu, 5 Dec 2019 09:55:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PK1igSeP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="r5GDvXb7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D4B2224F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NPN1WBaZqug5B5arY+KmZp/u27MHqh+yygDVbaYDioA=; b=PK1igSePRdvVYV dsAOD364pBqQKnP0xN+CIWMVfuCR1FesuKQOkpm2VDZJLHVEvlmtvMj1n4MBpX3bZaean5AQIpwHg gsFLeMSD235NzcSGrPde64/5wCwaSCVramOIIq1r1rgpeKIvmc/6roSF2jHWe3rCVoYz2WLDBWyXO K6aVCEWRlgGzDt13Es3TT5avoRf1Vwt2P58dNnyr8nuLyvKDI4iW6f48g1teXEva73svWHf/ulfuB HZWFJvqVyr9LqrMGUjLLG3Wdy55CoQHZ6JDdLS/UHJl2jcQ/0zGu+2PBkSOLlcxv3Mv9/NIK1joXi XwuKAzDY8ba0fnivUQOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnrB-0005tQ-7x; Thu, 05 Dec 2019 09:55:33 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpe-0002xF-S9 for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:00 +0000 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: DINsbWI6hwNMFT59pN1L42ywqJVuGdiULiicDLS1QV9/SwTZy6R/vF7UxGB8usviS1fCtgrBao nmvCvfOJivYhfjVj/NHf9HFWm0aNCwrUSLuOgLszK67bpU0iqD1FT5A4y04vFxsa/3f7+aMwEt s1fEuvtxGn9zz4FOhRKP+59Q44hQE5wtumwWlyMZNeJwCt9c6/4IyllXZAnpFeQbgeC263bbO9 K3CTo2LrUaZfpMcbkHLZxsNHu1JiMqS25vG1Sa3/Nb5XW7kS2VZztoDR6jKIuBTENoB2pR6RjG VgI= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="58828890" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:56 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:53:59 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JpEvl4cX2fDNXMfWK7EV0NNZOeRhCnubqTBRksNNN9Rxnd9nMQ/qL/mr4LgykLnZGpxu+R2ToCFzoslud2nYHyk+8fUegoO7MIbGqAQ1QgbE4Tx313H7RvxCd4ZbUBbbidsLRlJ7QWQtacJqlT0+Qw0svF01efT0ksTEK28QeIeAKFHVmZlZ9Y8KK5wSUfdkPoCVlFCOM2DdSIKBkPl5zs2fMqYg8zm/4sQpYTx6KkNqL0hiqKB7PUEAQIn0a8C0UVZmNtLIK8EYV5hRVGr9KmNHsPvR56nkpVluYK00MgWUZZoJW6El6/amuFlhPdbrKCK0j57czJ6jBPmCl4H8dA== 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=SOYRrHFvK4Fnxfw91jxATUd72f9U5vBFOZr930ZMXKc=; b=l+95gbydJzroMsiOZlC6uzRjBoFwlW53HkDle3Aitjw51RD9woCOD/bTlw0xefQxi2XZym2/KcNfrWdJ82m/4CK8EM4ae97o2/G9EKFXJ5SpHAP7ygOXjbHwl0nOX+6bT4Qj7qbmqfjzX4DgMVWbcFcOBykdmWQsNnKOAmMeFoeLRXJg59UY5R+1RvTKvscwTgfcBm7M6uX6h78bq2mGASUYzdU/nJWvPxWEeOT6Ul/ZQjw49CbuG2NQESh5b1t4yoN9ahEagnxeuYYQkWk35j/CpUvYXI7RoPwhaKDcjbO49sK0kByA7sTeTu2Q2pFyDa/bWi4o4IildryKgbt3gQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SOYRrHFvK4Fnxfw91jxATUd72f9U5vBFOZr930ZMXKc=; b=r5GDvXb7tBCxN3LkeKSYKMmCDTslo4V/AweddlvnVGUh2mvK85ljjQudcP62QWJDgjKlkF4k55M3i36vW9BmsJHGlUTvX6ZDjsB8YrxSdnCTYCEtmuUAl0mZP3CZwLR/SF+wHZ6nDUwHikdeqfB0Pbr2f9cz/gWOANsn5YDfX7I= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:53:53 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:53 +0000 From: To: Subject: [PATCH 06/16] crypto: atmel-{aes, sha, tdes} - Rename labels in probe() Thread-Topic: [PATCH 06/16] crypto: atmel-{aes,sha,tdes} - Rename labels in probe() Thread-Index: AQHVq1HnsuLmnGSJ10WhJdITuvt32g== Date: Thu, 5 Dec 2019 09:53:53 +0000 Message-ID: <20191205095326.5094-7-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2f63ed5c-3edd-494f-eed8-08d779690979 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:220; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4tlqrL9+mDNHdtjphKWyYoMz4jKOSYzbwfmTnzIwYtTuv/Cb4ZxGPbuF+Menk/6+GC5VSzI+8m4IQj8oeSmiP1uJNFf943d17CXgauHnDNLWSnjBMz0xAqIQsU0JeuZVdHg8vj3GzXlFSwvFQQlMU+ThM0yqVjEDnu8IO3pjBvSHlNM7OWAX8NQLw7XmDVg5VXJKyMCvZZyBySPubdZYus4WmKZa0YG2ASqdJrqeWTg/XhNKpHhWzF14zMpQqOnYVtLeMHu7qXiM6cWVwXKshHE8OeUCkm3cdUpiYCRxy8G7AhhSNGlRNsjtfJDitszxc3R6r9htKon3iV99Bj5Zr1e+LHwj9ueOj0e5MJSi/1Xf5Fk5PnUsF40vbVGxSHhgBySsXQ7X4ByARpW6y2Me944ZwYw3EwJNKvjmazuDvtjfLNQ7J0sdcoNEayhu5/XDMVj++ORuEUmKz7+gtficQg5kTHhA/F6bqkrq511RTbZMt6FFDobMUxxmU+lybqnd MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2f63ed5c-3edd-494f-eed8-08d779690979 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:53.5106 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ugeHGve8XYE3/ShdoaLPduKsOodJ7doESEmv9jgPQV+V1j3Vohbyaz7uaG9kPoin2rfoxifH/T09c5LVIFLYaIBCKpJsxjQD5rtLqxKdByc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015358_964364_E9823AA5 X-CRM114-Status: UNSURE ( 8.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus Choose label names which say what the goto does and not from where the goto was issued. This avoids adding superfluous labels like "err_aes_buff". Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-aes.c | 27 +++++++++++++-------------- drivers/crypto/atmel-sha.c | 25 ++++++++++++------------- drivers/crypto/atmel-tdes.c | 26 ++++++++++++-------------- 3 files changed, 37 insertions(+), 41 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 1cb5564e73f4..0744859ec793 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -2650,7 +2650,7 @@ static int atmel_aes_probe(struct platform_device *pdev) if (!aes_res) { dev_err(dev, "no MEM resource info\n"); err = -ENODEV; - goto res_err; + goto err_tasklet_kill; } aes_dd->phys_base = aes_res->start; @@ -2658,14 +2658,14 @@ static int atmel_aes_probe(struct platform_device *pdev) aes_dd->irq = platform_get_irq(pdev, 0); if (aes_dd->irq < 0) { err = aes_dd->irq; - goto res_err; + goto err_tasklet_kill; } err = devm_request_irq(&pdev->dev, aes_dd->irq, atmel_aes_irq, IRQF_SHARED, "atmel-aes", aes_dd); if (err) { dev_err(dev, "unable to request aes irq.\n"); - goto res_err; + goto err_tasklet_kill; } /* Initializing the clock */ @@ -2673,40 +2673,40 @@ static int atmel_aes_probe(struct platform_device *pdev) if (IS_ERR(aes_dd->iclk)) { dev_err(dev, "clock initialization failed.\n"); err = PTR_ERR(aes_dd->iclk); - goto res_err; + goto err_tasklet_kill; } aes_dd->io_base = devm_ioremap_resource(&pdev->dev, aes_res); if (IS_ERR(aes_dd->io_base)) { dev_err(dev, "can't ioremap\n"); err = PTR_ERR(aes_dd->io_base); - goto res_err; + goto err_tasklet_kill; } err = clk_prepare(aes_dd->iclk); if (err) - goto res_err; + goto err_tasklet_kill; err = atmel_aes_hw_version_init(aes_dd); if (err) - goto iclk_unprepare; + goto err_iclk_unprepare; atmel_aes_get_cap(aes_dd); #if IS_ENABLED(CONFIG_CRYPTO_DEV_ATMEL_AUTHENC) if (aes_dd->caps.has_authenc && !atmel_sha_authenc_is_ready()) { err = -EPROBE_DEFER; - goto iclk_unprepare; + goto err_iclk_unprepare; } #endif err = atmel_aes_buff_init(aes_dd); if (err) - goto err_aes_buff; + goto err_iclk_unprepare; err = atmel_aes_dma_init(aes_dd, pdata); if (err) - goto err_aes_dma; + goto err_buff_cleanup; spin_lock(&atmel_aes.lock); list_add_tail(&aes_dd->list, &atmel_aes.dev_list); @@ -2727,12 +2727,11 @@ static int atmel_aes_probe(struct platform_device *pdev) list_del(&aes_dd->list); spin_unlock(&atmel_aes.lock); atmel_aes_dma_cleanup(aes_dd); -err_aes_dma: +err_buff_cleanup: atmel_aes_buff_cleanup(aes_dd); -err_aes_buff: -iclk_unprepare: +err_iclk_unprepare: clk_unprepare(aes_dd->iclk); -res_err: +err_tasklet_kill: tasklet_kill(&aes_dd->done_task); tasklet_kill(&aes_dd->queue_task); diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index e85fa48e3d10..8f63a1aebd9e 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2778,7 +2778,7 @@ static int atmel_sha_probe(struct platform_device *pdev) if (!sha_res) { dev_err(dev, "no MEM resource info\n"); err = -ENODEV; - goto res_err; + goto err_tasklet_kill; } sha_dd->phys_base = sha_res->start; @@ -2786,14 +2786,14 @@ static int atmel_sha_probe(struct platform_device *pdev) sha_dd->irq = platform_get_irq(pdev, 0); if (sha_dd->irq < 0) { err = sha_dd->irq; - goto res_err; + goto err_tasklet_kill; } err = devm_request_irq(&pdev->dev, sha_dd->irq, atmel_sha_irq, IRQF_SHARED, "atmel-sha", sha_dd); if (err) { dev_err(dev, "unable to request sha irq.\n"); - goto res_err; + goto err_tasklet_kill; } /* Initializing the clock */ @@ -2801,23 +2801,23 @@ static int atmel_sha_probe(struct platform_device *pdev) if (IS_ERR(sha_dd->iclk)) { dev_err(dev, "clock initialization failed.\n"); err = PTR_ERR(sha_dd->iclk); - goto res_err; + goto err_tasklet_kill; } sha_dd->io_base = devm_ioremap_resource(&pdev->dev, sha_res); if (IS_ERR(sha_dd->io_base)) { dev_err(dev, "can't ioremap\n"); err = PTR_ERR(sha_dd->io_base); - goto res_err; + goto err_tasklet_kill; } err = clk_prepare(sha_dd->iclk); if (err) - goto res_err; + goto err_tasklet_kill; err = atmel_sha_hw_version_init(sha_dd); if (err) - goto iclk_unprepare; + goto err_iclk_unprepare; atmel_sha_get_cap(sha_dd); @@ -2828,16 +2828,16 @@ static int atmel_sha_probe(struct platform_device *pdev) if (IS_ERR(pdata)) { dev_err(&pdev->dev, "platform data not available\n"); err = PTR_ERR(pdata); - goto iclk_unprepare; + goto err_iclk_unprepare; } } if (!pdata->dma_slave) { err = -ENXIO; - goto iclk_unprepare; + goto err_iclk_unprepare; } err = atmel_sha_dma_init(sha_dd, pdata); if (err) - goto err_sha_dma; + goto err_iclk_unprepare; dev_info(dev, "using %s for DMA transfers\n", dma_chan_name(sha_dd->dma_lch_in.chan)); @@ -2863,10 +2863,9 @@ static int atmel_sha_probe(struct platform_device *pdev) spin_unlock(&atmel_sha.lock); if (sha_dd->caps.has_dma) atmel_sha_dma_cleanup(sha_dd); -err_sha_dma: -iclk_unprepare: +err_iclk_unprepare: clk_unprepare(sha_dd->iclk); -res_err: +err_tasklet_kill: tasklet_kill(&sha_dd->queue_task); tasklet_kill(&sha_dd->done_task); diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 9baae2065474..16527ef2a05b 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -1280,7 +1280,7 @@ static int atmel_tdes_probe(struct platform_device *pdev) if (!tdes_res) { dev_err(dev, "no MEM resource info\n"); err = -ENODEV; - goto res_err; + goto err_tasklet_kill; } tdes_dd->phys_base = tdes_res->start; @@ -1288,14 +1288,14 @@ static int atmel_tdes_probe(struct platform_device *pdev) tdes_dd->irq = platform_get_irq(pdev, 0); if (tdes_dd->irq < 0) { err = tdes_dd->irq; - goto res_err; + goto err_tasklet_kill; } err = devm_request_irq(&pdev->dev, tdes_dd->irq, atmel_tdes_irq, IRQF_SHARED, "atmel-tdes", tdes_dd); if (err) { dev_err(dev, "unable to request tdes irq.\n"); - goto res_err; + goto err_tasklet_kill; } /* Initializing the clock */ @@ -1303,25 +1303,25 @@ static int atmel_tdes_probe(struct platform_device *pdev) if (IS_ERR(tdes_dd->iclk)) { dev_err(dev, "clock initialization failed.\n"); err = PTR_ERR(tdes_dd->iclk); - goto res_err; + goto err_tasklet_kill; } tdes_dd->io_base = devm_ioremap_resource(&pdev->dev, tdes_res); if (IS_ERR(tdes_dd->io_base)) { dev_err(dev, "can't ioremap\n"); err = PTR_ERR(tdes_dd->io_base); - goto res_err; + goto err_tasklet_kill; } err = atmel_tdes_hw_version_init(tdes_dd); if (err) - goto res_err; + goto err_tasklet_kill; atmel_tdes_get_cap(tdes_dd); err = atmel_tdes_buff_init(tdes_dd); if (err) - goto err_tdes_buff; + goto err_tasklet_kill; if (tdes_dd->caps.has_dma) { pdata = pdev->dev.platform_data; @@ -1330,16 +1330,16 @@ static int atmel_tdes_probe(struct platform_device *pdev) if (IS_ERR(pdata)) { dev_err(&pdev->dev, "platform data not available\n"); err = PTR_ERR(pdata); - goto err_pdata; + goto err_buff_cleanup; } } if (!pdata->dma_slave) { err = -ENXIO; - goto err_pdata; + goto err_buff_cleanup; } err = atmel_tdes_dma_init(tdes_dd, pdata); if (err) - goto err_tdes_dma; + goto err_buff_cleanup; dev_info(dev, "using %s, %s for DMA transfers\n", dma_chan_name(tdes_dd->dma_lch_in.chan), @@ -1364,11 +1364,9 @@ static int atmel_tdes_probe(struct platform_device *pdev) spin_unlock(&atmel_tdes.lock); if (tdes_dd->caps.has_dma) atmel_tdes_dma_cleanup(tdes_dd); -err_tdes_dma: -err_pdata: +err_buff_cleanup: atmel_tdes_buff_cleanup(tdes_dd); -err_tdes_buff: -res_err: +err_tasklet_kill: tasklet_kill(&tdes_dd->done_task); tasklet_kill(&tdes_dd->queue_task); From patchwork Thu Dec 5 09:53:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274571 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62CAD138C for ; Thu, 5 Dec 2019 09:55:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3D1DF224F8 for ; Thu, 5 Dec 2019 09:55:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eFOYl4Nt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="owZjnhFO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D1DF224F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ck4pMYptvKoyuKUs9h/Y03LGWwbuwDM2SQ0RwVPYVG8=; b=eFOYl4NtUiOWPl drWnRu57qEJulzK6bgM/MY30RTHdxxo3UDo3Y6ed9HULid3s/nJDf3GggkX3uU1GEroJIvPMIpxYQ a1QfE3rLPTjjbLc8HX9v2bn751QOa9kEHfV26ISqIiaVoXkAb489eDIQ/xSEi9AiYdIzGPglnOjcD WasmuCV9bYGpeZkHWxn3rR37acNwhHneGmBej3SdT7T+N3gG7ajnYSGRQnl/Pb0H6zuGngEF59XZy 6Xm1JEUqOQmwMKN+eUA9xXD3MRALt0834diEFGSIy2zVUWFcuAUdsijK4bxxShvrcv8XJJL7aBiWg 8XegDfRm2XwgvufLMIlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnqu-0004Wh-Mx; Thu, 05 Dec 2019 09:55:16 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpd-0002xF-An for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:53:58 +0000 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: baXAFboOjboB0oTABbArIdgnYCkvWbuLo4f9VJDo27RKGo+yOUPHW9FJ8ucQDES1Nm3t47NJPx 3elztZRkwOJNM6Js4+zVvUyCZjRVBylG5FYF4CwMTOkOY69FaFo7Je6eAhYeeAlZCm7lkrMe/Q 104WPmzNZGaiq7zJcH9fpedC512TcryX+7vf0acmO67g66msCiuU7jmGcWTSrcG5CKwznPM62C IfFVny2btjZzaiZXOsH5BqezHGkCx23UoGgmG/bvA6znknIKbk6pgKd9d+a1vFIYMcI4Mky+xP m4c= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="58828889" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:56 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:53:59 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AQhomzsYqsQ++lV7+C7jfSJOrZmoDuVejFrs0oVlN2ISHSs94WXNoZ15C4HtaJ1+RFbIM3wWwdIEYc3KyF0lR6qLb7knP29TjiUdejEcnJVS1eO1RNxkXeaz4zaXHGV5eUYh7NUz4cslMiIGb/6Q8LnUyhg7wmgg4+Aykd81IuQR3ihDJ+y5SEzj67qf2eAXf7THHDoOQH6T0yZ5YMEvv+/nuPwO5tsXbuO5cdyGI5IgNGEMUvCu5PnOPnaMg6x5HqIFAlPnEk2PEwpKZa1FAqoSoS28efzeIIBYs5S71Pcq9vqK4M5VI7/Ti/W7aZwMBC0sgQYGTyHxMHeJmU3+LA== 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=TVRwHOldG0ynnXiqDs/bDd/P3uzW8vlGnnbfn/dGjIE=; b=V4CnYdEi8W5piShsTUBNYPGUw85rXbhZfIitp71Ks8p8vQt7tLcUYDBn2K5Hkr86sTj31Q2zRHpJ8e+xRqMj1I912fwk+1G8HZgiS9V3/aqMMSR/HhPgf4ua7H2yVFH1vfGAfuAuhCMkDy6JkruL1znT3I0pFxarnIZxoJVan0jrDqyvuMxaQrItJPx7q/HvXGpZjR5tsiRfvZgjtGQrmFq4xBKicBWN/5FDqoO6g6b8PGCUyaTsvYlBVQ5KXn1PMm7zG81iLJxClo/DfixmH5/6pcwKyavDFXJIgOS94XYuqbrfKoAoDVYg9SYUOcVNk6mcRuwVmeQ/skxfh5hdpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TVRwHOldG0ynnXiqDs/bDd/P3uzW8vlGnnbfn/dGjIE=; b=owZjnhFOqIwzya8aTqcJkSAC7L+On05kFEF6bITA93/93e8ww1wmIKbZotiOoxFJu+/8GkjJf6DeQdobk7aIrOSrv1xVRMCHri6ccK8a+VW/hzrxbOoEYZMQxrs0ppBG83d5GF09XLDZFlPCw34FNpXbgWcuexbWS8rwKHw1tAU= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB4288.namprd11.prod.outlook.com (52.135.37.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.20; Thu, 5 Dec 2019 09:53:55 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:55 +0000 From: To: Subject: [PATCH 07/16] crypto: atmel-tdes - Remove useless write in Control Register Thread-Topic: [PATCH 07/16] crypto: atmel-tdes - Remove useless write in Control Register Thread-Index: AQHVq1HoXxSWzAveyEy5pNcChjB39Q== Date: Thu, 5 Dec 2019 09:53:55 +0000 Message-ID: <20191205095326.5094-8-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d1179bd3-748c-4038-088e-08d779690a74 x-ms-traffictypediagnostic: MN2PR11MB4288: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:64; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(189003)(199004)(6506007)(1076003)(305945005)(4326008)(2616005)(86362001)(478600001)(11346002)(14444005)(102836004)(107886003)(2906002)(50226002)(5660300002)(66446008)(66946007)(66476007)(66556008)(14454004)(1730700003)(64756008)(76176011)(8936002)(4744005)(52116002)(81166006)(186003)(5640700003)(81156014)(36756003)(71200400001)(71190400001)(54906003)(6512007)(316002)(6486002)(25786009)(8676002)(26005)(6916009)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4288; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mchAHhvzKNjq7cXp4rPjktuS3poYEkxHaxntILwKDnRintEfPvXuugw+ZZ/Ju9taLb51u5eIiZW1tt5tNGIIGLPIMgT4BnyPXFptlZYuCVBdjWBLyc2TvqcwuNQjHCATNfhdOlnQZstj2PKpmvfyXUrM4Q7hrEGzz3S2WDja0U+IqUvzEgzNpJITEl17lL0G24Wd+BNSd1ylxRkD3WJ80T+qpqHSP3Ywjx5Yzpt8O2Z/sblTCuzge8XGCR1t0pePq0XRwdfXg40YSlwAQiIoEqKowN7JC/AWJzAJafxCQ4DeKppF/N9AQHR1mwCajcXmCw+OSNC1U+RE2h0xzWUfEu42iq7M8hW1/DcjvQtbFU2xckPhqsvPNAFnO8u5K4s3lkVhUNdgx1irQ3bboAHAK6byvWjYJsj2oPRuPeMAwF39+4MmWcUTuGBaAFMptRgE MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d1179bd3-748c-4038-088e-08d779690a74 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:55.2406 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8S5UBb4JSww/CI8ye3CquNsZCtHnLR4AitEmh/VjTLVUgUrG007+P0OkZLhWWORypSzb9iBg5oC85h3CJQSWSeGct39M+T9XQ3bnqTRSIec= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4288 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015357_462915_726F8A0B X-CRM114-Status: UNSURE ( 8.52 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus As claimed by the datasheet, writing 0 into the Control Register has no effect. Remove this useless register access. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-tdes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 16527ef2a05b..0b9badbd232d 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -265,7 +265,7 @@ static void atmel_tdes_dma_callback(void *data) static int atmel_tdes_write_ctrl(struct atmel_tdes_dev *dd) { int err; - u32 valcr = 0, valmr = TDES_MR_SMOD_PDC; + u32 valmr = TDES_MR_SMOD_PDC; err = atmel_tdes_hw_init(dd); @@ -307,7 +307,6 @@ static int atmel_tdes_write_ctrl(struct atmel_tdes_dev *dd) if ((dd->flags & TDES_FLAGS_ENCRYPT) || (dd->flags & TDES_FLAGS_OFB)) valmr |= TDES_MR_CYPHER_ENC; - atmel_tdes_write(dd, TDES_CR, valcr); atmel_tdes_write(dd, TDES_MR, valmr); atmel_tdes_write_n(dd, TDES_KEY1W1R, dd->ctx->key, From patchwork Thu Dec 5 09:53:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274579 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F5A9139A for ; Thu, 5 Dec 2019 09:56:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 520582464D for ; Thu, 5 Dec 2019 09:56:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZD+UmXlt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="hBYRSmua" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 520582464D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WzFvFO1DHZR7zX2hW/Xorm+AdxAQ7Kzq0GZoY8XHS/k=; b=ZD+UmXlthHq2GE wuGNmyYyf+3aj/o6DPixC//i3Y1W8YzSmgH9j5zEbLH1kpdYeD51AhwYf/aWKFWQLZrQ3CNs3XELP ILJZuAyULGjZxYIw3TdPRIL4fc8mhr6Q2fbJHGWJh1e9woNWvE/xwbN8p3iHrXkZT90ECIbkNfqsQ Oxg43xl55H9Mc8b2/ukuhnlLVruOjQcqP1ckGVLGGb2jX3nppp0tHh9uBTYp4xo2rhk30zp12t5Zc 73H7XpDGXCA556cECKzjoru4CgtN97hL81gG1Wr6g0G8DSxKFdtsSUOGxHkJS2MN9A1kJEvgqc6u8 ivl8NWiG49CvBX+9NLyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnru-0006i8-JY; Thu, 05 Dec 2019 09:56:18 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpg-0002xF-Sl for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:03 +0000 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: H9DBKcHPm/6UITtM+xTSNud3tqn877qOJJzq9SvvG9UlJWq/b5fQBm/pmMgSVX0Wd/1/WOqNfH KfJOTK4uzMBYfEfY2rmIUXWUmUf+28Kb5BngNru1AIxTUWkdMKY+GQTP2LLgDXvYZMzbKuv662 elJsfqGTmuE6r8q0EHdc+BLsw+upflSU4rtn5ITXMUeOcN0HAm6Tp+25sT7Sj2BlscwMLIpN2l XJqUkuNZS9ni806jCgF096PuCWDLfdumcoWIAg27t5ljAEKvHIwP1l/Ys55Kq2q6GySvrlW0ST QNQ= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="58828896" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:58 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:01 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:53:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HRBfOM4R8o019KChFp2fX79LxD4Gah4tOwSyJXD59v8S1syXWI1kM9aWPUjZM/kzMkYR66HZylzSVQP1xJ0Xy50hzwAtXM/9Gb80vlXs1ZUptHiTk+sMM2E/jiRbgOoJcs9iuVyVYa8UqQc22on5v9VJREEgrLvx/H3GCXm+gZxnetKvsD/mGT6Xfj3uTbm79fsqwz+FBTQ1J5F/3uTSJTSBllZhN7y+YOJOCKB+Bsl+V2nK8fuMYaTwhpDFdjfGu1q0hxEDSbTFCwAapO619WzCqNV78prwaA9iGBMG5SXMfLkLheJLFyTVeGwpuYUS9uPgK2MtCoW5z5MFuulo3Q== 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=C2yI5B4TbJuXvq8eZV2Ob4tKcjcAD4x0kTko29XWxAM=; b=G6O3P0lemTiQ435lIjqaN7Zjuelm4SgMFHx8lstblC9of6XedkeMiTY6KUUGxG8aiTySRmKuVtALweODvOBYGjLcRTYBQjISH3L+oRfqqfIvlaXVbgQrEmZPl0/zI43NvHh0mP1tOwbAgoV9dTBeRbA84fEN/RQct3PMqEy05hJH0iQTd2ZktcTUZ6b2ZZ6+b5VkObmvfY7R8qeoWFnt/0juI3wmr3yNzYYoK8c/CDnAkkIyiRpVY8YwuZz5ceLk8joZ3qoHLiiaAWvwcz9qSL/YO+j1gfDMcjIjDkDNa60WFV0rD3UEo/zb7dIOys03IJpptECXTOhzpLVjp6rcIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C2yI5B4TbJuXvq8eZV2Ob4tKcjcAD4x0kTko29XWxAM=; b=hBYRSmuaq1Wamsh5Hxg1AKjIy0Y/kZsOqkGDFXBHGbB/UaSDyko7/8o17zGLe6Wr2K9vnQH+ayfMgsjFE0iYEhY2dkjCne+El8Jg5h4aBqV6JXz/FRYdV1qRF2rrxIOudaeAlkQCNU1SzCchPssjr2WTLmZXgnpZWGMruvFiOKY= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:53:57 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:57 +0000 From: To: Subject: [PATCH 08/16] crypto: atmel-tdes - Map driver data flags to Mode Register Thread-Topic: [PATCH 08/16] crypto: atmel-tdes - Map driver data flags to Mode Register Thread-Index: AQHVq1Hp7la3PCOa8E+6QB5Iy+b5zg== Date: Thu, 5 Dec 2019 09:53:56 +0000 Message-ID: <20191205095326.5094-9-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 221e222c-ee38-417f-cb3f-08d779690b71 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:121; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8C4tysKQFVrgOOyR6gJ1bm989u1Ab2p2IyNZTwHJfsvYD3uhL2B7Ys723T9mxsQI7EtJOKkcBXC6HSsyuDekIG0kVH3wGCzSX+ATP8kNsdSzHOvJvZyCfaRtP4YtoyVMcOjNWFIGGoyVzRKIEQwzkRJ4GRqDqhm9ttZWbHcLbpz1dfGJQrrdoZzlVq31nayuYFaii97RF7gQSUckiTH15w6t6Po6IowgHeDLxlCvJYCkvgKkSrvqmjN5l3LtiS68yPOupVsXaYQLVnv6sKkE+o+elKpqjWJN138ZiABjOY4g8KtvLnbO1D42G5mVck34aDot/P+CblGh1VF4CTWW/GYIIF+lkx5u5zOfUOiZleZJiqzy3/5afsHHrUTwVG9GJIp5imGkJ8itddOta3FoBgdLqOGv/RXresMm3BEdt2IFW33yd94soPcdOKhHLAlc MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 221e222c-ee38-417f-cb3f-08d779690b71 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:56.8377 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: v2XlPvL2HApJksX/78QTzxfobO6Z8ysmu8bqUBgdwcUXSClnIeVK9JKJjV0Tobic9Cn4fyI2cVjw9FA/71UyHi4WLIq73Ygqu0wYJ68dHeE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015401_035769_ED5A6FB8 X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus Simplifies the configuration of the TDES IP. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-tdes.c | 144 ++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 73 deletions(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 0b9badbd232d..ddb211706cba 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -40,20 +40,23 @@ #define ATMEL_TDES_PRIORITY 300 /* TDES flags */ -#define TDES_FLAGS_MODE_MASK 0x00ff -#define TDES_FLAGS_ENCRYPT BIT(0) -#define TDES_FLAGS_CBC BIT(1) -#define TDES_FLAGS_CFB BIT(2) -#define TDES_FLAGS_CFB8 BIT(3) -#define TDES_FLAGS_CFB16 BIT(4) -#define TDES_FLAGS_CFB32 BIT(5) -#define TDES_FLAGS_CFB64 BIT(6) -#define TDES_FLAGS_OFB BIT(7) - -#define TDES_FLAGS_INIT BIT(16) -#define TDES_FLAGS_FAST BIT(17) -#define TDES_FLAGS_BUSY BIT(18) -#define TDES_FLAGS_DMA BIT(19) +/* Reserve bits [17:16], [13:12], [2:0] for AES Mode Register */ +#define TDES_FLAGS_ENCRYPT TDES_MR_CYPHER_ENC +#define TDES_FLAGS_OPMODE_MASK (TDES_MR_OPMOD_MASK | TDES_MR_CFBS_MASK) +#define TDES_FLAGS_ECB TDES_MR_OPMOD_ECB +#define TDES_FLAGS_CBC TDES_MR_OPMOD_CBC +#define TDES_FLAGS_OFB TDES_MR_OPMOD_OFB +#define TDES_FLAGS_CFB64 (TDES_MR_OPMOD_CFB | TDES_MR_CFBS_64b) +#define TDES_FLAGS_CFB32 (TDES_MR_OPMOD_CFB | TDES_MR_CFBS_32b) +#define TDES_FLAGS_CFB16 (TDES_MR_OPMOD_CFB | TDES_MR_CFBS_16b) +#define TDES_FLAGS_CFB8 (TDES_MR_OPMOD_CFB | TDES_MR_CFBS_8b) + +#define TDES_FLAGS_MODE_MASK (TDES_FLAGS_OPMODE_MASK | TDES_FLAGS_ENCRYPT) + +#define TDES_FLAGS_INIT BIT(3) +#define TDES_FLAGS_FAST BIT(4) +#define TDES_FLAGS_BUSY BIT(5) +#define TDES_FLAGS_DMA BIT(6) #define ATMEL_TDES_QUEUE_LENGTH 50 @@ -287,35 +290,15 @@ static int atmel_tdes_write_ctrl(struct atmel_tdes_dev *dd) valmr |= TDES_MR_TDESMOD_DES; } - if (dd->flags & TDES_FLAGS_CBC) { - valmr |= TDES_MR_OPMOD_CBC; - } else if (dd->flags & TDES_FLAGS_CFB) { - valmr |= TDES_MR_OPMOD_CFB; - - if (dd->flags & TDES_FLAGS_CFB8) - valmr |= TDES_MR_CFBS_8b; - else if (dd->flags & TDES_FLAGS_CFB16) - valmr |= TDES_MR_CFBS_16b; - else if (dd->flags & TDES_FLAGS_CFB32) - valmr |= TDES_MR_CFBS_32b; - else if (dd->flags & TDES_FLAGS_CFB64) - valmr |= TDES_MR_CFBS_64b; - } else if (dd->flags & TDES_FLAGS_OFB) { - valmr |= TDES_MR_OPMOD_OFB; - } - - if ((dd->flags & TDES_FLAGS_ENCRYPT) || (dd->flags & TDES_FLAGS_OFB)) - valmr |= TDES_MR_CYPHER_ENC; + valmr |= dd->flags & TDES_FLAGS_MODE_MASK; atmel_tdes_write(dd, TDES_MR, valmr); atmel_tdes_write_n(dd, TDES_KEY1W1R, dd->ctx->key, dd->ctx->keylen >> 2); - if (((dd->flags & TDES_FLAGS_CBC) || (dd->flags & TDES_FLAGS_CFB) || - (dd->flags & TDES_FLAGS_OFB)) && dd->req->iv) { + if (dd->req->iv && (valmr & TDES_MR_OPMOD_MASK) != TDES_MR_OPMOD_ECB) atmel_tdes_write_n(dd, TDES_IV1R, (void *)dd->req->iv, 2); - } return 0; } @@ -406,6 +389,7 @@ static int atmel_tdes_crypt_pdc(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, { struct atmel_tdes_ctx *ctx = crypto_tfm_ctx(tfm); struct atmel_tdes_dev *dd = ctx->dd; + struct atmel_tdes_reqctx *rctx = skcipher_request_ctx(dd->req); int len32; dd->dma_size = length; @@ -415,12 +399,19 @@ static int atmel_tdes_crypt_pdc(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, DMA_TO_DEVICE); } - if ((dd->flags & TDES_FLAGS_CFB) && (dd->flags & TDES_FLAGS_CFB8)) + switch (rctx->mode & TDES_FLAGS_OPMODE_MASK) { + case TDES_FLAGS_CFB8: len32 = DIV_ROUND_UP(length, sizeof(u8)); - else if ((dd->flags & TDES_FLAGS_CFB) && (dd->flags & TDES_FLAGS_CFB16)) + break; + + case TDES_FLAGS_CFB16: len32 = DIV_ROUND_UP(length, sizeof(u16)); - else + break; + + default: len32 = DIV_ROUND_UP(length, sizeof(u32)); + break; + } atmel_tdes_write(dd, TDES_PTCR, TDES_PTCR_TXTDIS|TDES_PTCR_RXTDIS); atmel_tdes_write(dd, TDES_TPR, dma_addr_in); @@ -442,8 +433,10 @@ static int atmel_tdes_crypt_dma(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, { struct atmel_tdes_ctx *ctx = crypto_tfm_ctx(tfm); struct atmel_tdes_dev *dd = ctx->dd; + struct atmel_tdes_reqctx *rctx = skcipher_request_ctx(dd->req); struct scatterlist sg[2]; struct dma_async_tx_descriptor *in_desc, *out_desc; + enum dma_slave_buswidth addr_width; dd->dma_size = length; @@ -452,23 +445,23 @@ static int atmel_tdes_crypt_dma(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, DMA_TO_DEVICE); } - if (dd->flags & TDES_FLAGS_CFB8) { - dd->dma_lch_in.dma_conf.dst_addr_width = - DMA_SLAVE_BUSWIDTH_1_BYTE; - dd->dma_lch_out.dma_conf.src_addr_width = - DMA_SLAVE_BUSWIDTH_1_BYTE; - } else if (dd->flags & TDES_FLAGS_CFB16) { - dd->dma_lch_in.dma_conf.dst_addr_width = - DMA_SLAVE_BUSWIDTH_2_BYTES; - dd->dma_lch_out.dma_conf.src_addr_width = - DMA_SLAVE_BUSWIDTH_2_BYTES; - } else { - dd->dma_lch_in.dma_conf.dst_addr_width = - DMA_SLAVE_BUSWIDTH_4_BYTES; - dd->dma_lch_out.dma_conf.src_addr_width = - DMA_SLAVE_BUSWIDTH_4_BYTES; + switch (rctx->mode & TDES_FLAGS_OPMODE_MASK) { + case TDES_FLAGS_CFB8: + addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; + break; + + case TDES_FLAGS_CFB16: + addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + break; + + default: + addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + break; } + dd->dma_lch_in.dma_conf.dst_addr_width = addr_width; + dd->dma_lch_out.dma_conf.src_addr_width = addr_width; + dmaengine_slave_config(dd->dma_lch_in.chan, &dd->dma_lch_in.dma_conf); dmaengine_slave_config(dd->dma_lch_out.chan, &dd->dma_lch_out.dma_conf); @@ -703,30 +696,38 @@ static int atmel_tdes_crypt(struct skcipher_request *req, unsigned long mode) struct atmel_tdes_ctx *ctx = crypto_skcipher_ctx(skcipher); struct atmel_tdes_reqctx *rctx = skcipher_request_ctx(req); - if (mode & TDES_FLAGS_CFB8) { + switch (mode & TDES_FLAGS_OPMODE_MASK) { + case TDES_FLAGS_CFB8: if (!IS_ALIGNED(req->cryptlen, CFB8_BLOCK_SIZE)) { pr_err("request size is not exact amount of CFB8 blocks\n"); return -EINVAL; } ctx->block_size = CFB8_BLOCK_SIZE; - } else if (mode & TDES_FLAGS_CFB16) { + break; + + case TDES_FLAGS_CFB16: if (!IS_ALIGNED(req->cryptlen, CFB16_BLOCK_SIZE)) { pr_err("request size is not exact amount of CFB16 blocks\n"); return -EINVAL; } ctx->block_size = CFB16_BLOCK_SIZE; - } else if (mode & TDES_FLAGS_CFB32) { + break; + + case TDES_FLAGS_CFB32: if (!IS_ALIGNED(req->cryptlen, CFB32_BLOCK_SIZE)) { pr_err("request size is not exact amount of CFB32 blocks\n"); return -EINVAL; } ctx->block_size = CFB32_BLOCK_SIZE; - } else { + break; + + default: if (!IS_ALIGNED(req->cryptlen, DES_BLOCK_SIZE)) { pr_err("request size is not exact amount of DES blocks\n"); return -EINVAL; } ctx->block_size = DES_BLOCK_SIZE; + break; } rctx->mode = mode; @@ -845,17 +846,17 @@ static int atmel_tdes_setkey(struct crypto_skcipher *tfm, const u8 *key, static int atmel_tdes_ecb_encrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_ENCRYPT); + return atmel_tdes_crypt(req, TDES_FLAGS_ECB | TDES_FLAGS_ENCRYPT); } static int atmel_tdes_ecb_decrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, 0); + return atmel_tdes_crypt(req, TDES_FLAGS_ECB); } static int atmel_tdes_cbc_encrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_ENCRYPT | TDES_FLAGS_CBC); + return atmel_tdes_crypt(req, TDES_FLAGS_CBC | TDES_FLAGS_ENCRYPT); } static int atmel_tdes_cbc_decrypt(struct skcipher_request *req) @@ -864,50 +865,47 @@ static int atmel_tdes_cbc_decrypt(struct skcipher_request *req) } static int atmel_tdes_cfb_encrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_ENCRYPT | TDES_FLAGS_CFB); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB64 | TDES_FLAGS_ENCRYPT); } static int atmel_tdes_cfb_decrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_CFB); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB64); } static int atmel_tdes_cfb8_encrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_ENCRYPT | TDES_FLAGS_CFB | - TDES_FLAGS_CFB8); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB8 | TDES_FLAGS_ENCRYPT); } static int atmel_tdes_cfb8_decrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_CFB | TDES_FLAGS_CFB8); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB8); } static int atmel_tdes_cfb16_encrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_ENCRYPT | TDES_FLAGS_CFB | - TDES_FLAGS_CFB16); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB16 | TDES_FLAGS_ENCRYPT); } static int atmel_tdes_cfb16_decrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_CFB | TDES_FLAGS_CFB16); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB16); } static int atmel_tdes_cfb32_encrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_ENCRYPT | TDES_FLAGS_CFB | - TDES_FLAGS_CFB32); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB32 | TDES_FLAGS_ENCRYPT); } static int atmel_tdes_cfb32_decrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_CFB | TDES_FLAGS_CFB32); + return atmel_tdes_crypt(req, TDES_FLAGS_CFB32); } static int atmel_tdes_ofb_encrypt(struct skcipher_request *req) { - return atmel_tdes_crypt(req, TDES_FLAGS_ENCRYPT | TDES_FLAGS_OFB); + return atmel_tdes_crypt(req, TDES_FLAGS_OFB | TDES_FLAGS_ENCRYPT); } static int atmel_tdes_ofb_decrypt(struct skcipher_request *req) From patchwork Thu Dec 5 09:53:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1714138C for ; Thu, 5 Dec 2019 09:55:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7D977224F8 for ; Thu, 5 Dec 2019 09:55:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eIN6gTMu"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="P8nGCDAg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D977224F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g2Wk5pr1JW+O8FZe5/3/bE+QP/+XNADIfCFy7ID+WTQ=; b=eIN6gTMuaa0ybJ 8En4gbPXBJgcin08XTE3DCSc9Ub8B1jBQ289S+c5CY2zLkGBI8Uc5EkZvRHrwWp6iEYOslUp7cEmD 1wpZkWDc9fyQzpiZdGdSeio9rXVUbmQxEnKbdtfjerqOZoTpA2S/i6+FoZyhhFW+Sv6+zE/PZYIck O0s+iUJKhnj38i+YzfGXxciycX+EkS7QgQfi2fYx6u56Qg/qXtu0Ewy6Nj4zvLJnKF3w1ImiWxikr 8GroyCTZwO8ttHQw1Gkd1jNjV6Xo0U7r/LleMnSN07HyvQKrG833J5NVG1ydbrWUfCTwIrjVYvt13 bHgQJPxNHZNRjNIMP0iQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnrO-00068Y-VH; Thu, 05 Dec 2019 09:55:46 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpg-00030k-DV for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:02 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: xWIl1TfuKLrpcpDky5uJNSw9Ov/KshyYp63cB4KYlb+OcuQ2i4HcQnLM8AdHII9MpMBbbyPA2c WyWXTcnwlVOD7pGkBGTsEnepzHCO7e72gdafj0TmB2aH7lABhwVdjyRPcjAh+s4BQqBtL+hdQW RJFJmIG+m6bWGSIYELgBWMtdR29wc7KDrDedYyPWLjfft63sUb3z6WyPWXPIPHoO7TXvnkQ1wr zKgG7vcpJGLmbCJQ0HRlimN7QZDnfp4m8V6E0kKl/9wIeP9XRICkpb4J1wjCu45WFlwm9UnSZZ hL4= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="60720966" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:53:59 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:02 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HUv0tJAqLcg1pC45jr/6i241N6bxqxshLvkQJs1OzZgyLYty5b/Sa+MsKMua7wfpyUdQf5epqudfBgfjNafm8WYolFiaVhfOx8Urn/0KtdB/LYtXsLNuwCPvSBkCrLwK9kPPmzWCjNO7CMZRNGA7ZPW/4Vg0tZ+14RxtIOIS7MPzr0AuD8NboQtMdd4jYl/eNevfPJL6JzJBewVIwv1btqEEMlq2zAtGBWNpWhczkZd/b6Iwdv0Vnj5KUZG+ejCpLDJX3eQ3cJNz0tvh0RS//J+YdFeHISrKH4P75q1GIZw+U+yKDoD1V2gE+ojffnaSSBfgQyPPG0tEvo4VsMOckQ== 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=nlLAtxYyEcImY7l8LGhn6lX5lztP7CGu2CYsGUXqgjI=; b=E/ncy1tGD6TEGvkchMVpIATVtnGiYti7IxK0FeVHMRJIiaFILdiePlEVqvfHN1QL/ltSipdu8yHqZYTHB8R+M3vxego6H7uDtj9esWO78N7ED+6CWkCjHHnIXeB/SB2AoaBX2BJxCarSTlqaFIQHQZfe7IgI5GAOiV3ao2PWUzeENFfA0OFLvzS63vE4yo/ieJwzfXzraEGYVm9lx5sFUya8daP+mxVNYIQ1j0EDrw/9Brd2hGdee7pg01MJVyPHIN9rWI5HmRbud3+eLH2nX0BqTz74JQUFthKISWuFCeX0uI0R6dQ0a2ZHsxUiSxsiaz58lDYlgew/OWjTzgIVlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nlLAtxYyEcImY7l8LGhn6lX5lztP7CGu2CYsGUXqgjI=; b=P8nGCDAglCFwmJLh2Ariuj6SfIEry8j+3MRFnWMP0s9nJUMwwLeBSPJUzIXe3/TFxVHBMFrBymSypoVJcGBPYl8MAKSOLMePZ9JSmLeoRQHeBP/XeP7XREo5LX3Nr9+VjwRbBXEBS9l5C4QTOvAWKd/ei46FZ/tNHsP/f18lRE0= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:53:58 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:53:58 +0000 From: To: Subject: [PATCH 09/16] crypto: atmel-tdes - Drop unnecessary passing of tfm Thread-Topic: [PATCH 09/16] crypto: atmel-tdes - Drop unnecessary passing of tfm Thread-Index: AQHVq1HqAp3eRVJX4kSfqtexQKotew== Date: Thu, 5 Dec 2019 09:53:58 +0000 Message-ID: <20191205095326.5094-10-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5715a154-7454-48c5-030b-08d779690c70 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5Vs5m6+A4Rd/GqlDwsjz9t3Fh3AXWo6WhjBkrUD/QoLgkws2i9fsXzvJ2Wo043VeQfIXUdFKH0AZElJKZ9zUWpF4zhKzPUvtzEhxi+krulY0DiBR+BibkLdHgS5ILV0KhQsyLKieePQdGDvINOqPh4flvFf0EF3B6QmtKVic+ZbWtSbimjuG3UN/BKbMr2d82qJ/tdxO9+APvO61rajG1ZK32Kl/um90bpeOSbsxpKZPWlUs5Ugz52KKskIckAVWlczhzwbWj1Kbi98lhOGL942sCulN1qljTNdgssg/rPmMbuHGCQiqIPtXUowO730qt3Jv2D9Ugf7G6/i2xj2J3RQ6s67faqx8MfPpeNetsJUwsychGz7v5TI/ziEUHIG9Plt/dQl+wi3k6sV5t3FRt0cuDy+rj96SzvPiLTjo2GyNZbZ/p5qe4axie/9zOfG3 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5715a154-7454-48c5-030b-08d779690c70 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:53:58.5097 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rVGQrdI65pL6ASeHiLF/6ns2sPW1dXcVcFtDsyadqOSnjAvyzd/xCe/hAfMcGPu3KSgABy672pBg14I3ckiNS+eFc14bZIOPdTOD66lt+EU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015400_511039_9B7C707A X-CRM114-Status: UNSURE ( 6.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus atmel_tdes_crypt_start() obtained a pointer to tfm from dd, passed the tfm pointer to atmel_tdes_crypt_{dma,pdc}, and in the calles we obtained dd back from the tfm. Pass pointer to dd directly. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-tdes.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index ddb211706cba..0a096f36785e 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -384,11 +384,10 @@ static void atmel_tdes_buff_cleanup(struct atmel_tdes_dev *dd) free_page((unsigned long)dd->buf_in); } -static int atmel_tdes_crypt_pdc(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, - dma_addr_t dma_addr_out, int length) +static int atmel_tdes_crypt_pdc(struct atmel_tdes_dev *dd, + dma_addr_t dma_addr_in, + dma_addr_t dma_addr_out, int length) { - struct atmel_tdes_ctx *ctx = crypto_tfm_ctx(tfm); - struct atmel_tdes_dev *dd = ctx->dd; struct atmel_tdes_reqctx *rctx = skcipher_request_ctx(dd->req); int len32; @@ -428,11 +427,10 @@ static int atmel_tdes_crypt_pdc(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, return 0; } -static int atmel_tdes_crypt_dma(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, - dma_addr_t dma_addr_out, int length) +static int atmel_tdes_crypt_dma(struct atmel_tdes_dev *dd, + dma_addr_t dma_addr_in, + dma_addr_t dma_addr_out, int length) { - struct atmel_tdes_ctx *ctx = crypto_tfm_ctx(tfm); - struct atmel_tdes_dev *dd = ctx->dd; struct atmel_tdes_reqctx *rctx = skcipher_request_ctx(dd->req); struct scatterlist sg[2]; struct dma_async_tx_descriptor *in_desc, *out_desc; @@ -501,8 +499,6 @@ static int atmel_tdes_crypt_dma(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, static int atmel_tdes_crypt_start(struct atmel_tdes_dev *dd) { - struct crypto_tfm *tfm = crypto_skcipher_tfm( - crypto_skcipher_reqtfm(dd->req)); int err, fast = 0, in, out; size_t count; dma_addr_t addr_in, addr_out; @@ -558,9 +554,9 @@ static int atmel_tdes_crypt_start(struct atmel_tdes_dev *dd) dd->total -= count; if (dd->caps.has_dma) - err = atmel_tdes_crypt_dma(tfm, addr_in, addr_out, count); + err = atmel_tdes_crypt_dma(dd, addr_in, addr_out, count); else - err = atmel_tdes_crypt_pdc(tfm, addr_in, addr_out, count); + err = atmel_tdes_crypt_pdc(dd, addr_in, addr_out, count); if (err && (dd->flags & TDES_FLAGS_FAST)) { dma_unmap_sg(dd->dev, dd->in_sg, 1, DMA_TO_DEVICE); From patchwork Thu Dec 5 09:54:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274581 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAD5B1805 for ; Thu, 5 Dec 2019 09:56:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 93FB52464D for ; Thu, 5 Dec 2019 09:56:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LqNpK5tn"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="k3R9hM2s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93FB52464D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bipHji0ukVNSQL0EfOGEIRotcqcLiSzoupuucr12bW8=; b=LqNpK5tncpFAbb Vt32EsqIK1tDz9KriA/eK2a8YaXsbdSZOeKsMARQxyXrNAbl21N9pi0s214afawh2VXQbbKS3yTnu ty1vqbPhIN2H89EpbfpiID4qKUh7pwVEq3BXjFmWsbFndD3lUU+85wjC1ZnMhX4StDoGnePzSjxlI DNIJV7PHNQJ9RDZtAFDAV2+uvQ0ynjdtOdnpJkrV7soSUFCbCnduPyUGb3oRqUkod7LyPwRPZNFUb DMdy/p3vaV0UzDReeE9ButILA41/FwnIkkIlhZPxh+LTgI3yNuItBFWeMCfE47Nuq1dIf1ExzWHUs g5F0ecrJU32DTeRe1JEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnsB-0006wH-9s; Thu, 05 Dec 2019 09:56:35 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpj-00030j-1K for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:05 +0000 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: hrATsF0QTA3/PX8Q25botiIk4vt2gud01XRJOsriLSBVR1uUhq72/Mueyrg+IMMGiUoKsWNeDV HH1CrEIGZWpfQo+hFl5p1vkX8TzfJQ4bESAa59gpEUMzTiYwilcHsUOS8f69bnEq5r6zyIlyTQ SRh0T8aD8IB6f98DDn3cTj+8JmAOCvlDlRsPrU82TvI29sjOn9ltAzOXmFrgfd98L7d2vHS4qY ohENQs8bW61DhPrhMCGUJWdgijX/gKLW7gC6xcgAmxPzjfA96p/hHDe7Td9gQAbqrwYNXjTq8L njg= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="57544870" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:54:02 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:01 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TNx05UXQp3Y/1KO85jn+JNytWZ73DVcOGbUEtbf6mMB0DupyKv697jBAixYB0NMtsNra7z6b+Q/PHOoZb3e3dbwZtXiDbSMMO4WdF8QGbtOdiWhuYbwQ2/n8sQSo9CZIGsfilmxKUo6q+pyIpTI85c+qu/CvPGxi89NnY4eC6+rp4qzXU4VsqYHJvFri8A5zHuQptOqPtYHvtz8eZ1qxf7F/7BWy3xQrM6mTPsJ8U6VrMkzW3E6c2EJBy7/1OCFwMQtnGs8r80I6iewv9ozmU+dkIo+dnpruVbUzv2VuKSUhwcA+megmOXwoCpXctNUE4Sw0SBB+rX47juKH75VFXQ== 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=KmJd25C5YBBiPPsSk7oRQ686fNVjw4Y2+m8wo4Qwea4=; b=GbOs8+B5603eWebjS7xRGExiE0zdn8LSH4DxD52RNMoMtM5zqOdEfIXeqyQO/8Ff6eYLv2jkBLVenSBHcB3t6wGNWVYcQsw3WnRCAfrw6qKgWsiBVv1GJTXERFrCIVV8CjMb/mILDcITCkToxkBGAqQtboFVmjtTu7GIGbyVTkMUWnTN9QcNp2NMmJMojHTVqsg0EauRsonv+Gmzw0bMqzDYW3kJ2+vC+Y2dcAMzhFwtkgcH0LX3SE1W2J+9yAwo5l7HvaTa2r7KKaE6+X3hfr+Mo097nJqtlw06IJtIrWoQNY/7hOKyuO1pM3Zs2owvoQFRoJ7aLStxR07giG4XTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KmJd25C5YBBiPPsSk7oRQ686fNVjw4Y2+m8wo4Qwea4=; b=k3R9hM2svTCZb/lONIgJ1PS/LFIypoyO3Ax8a8xRPZBE8xydtC5E4OsaL66fAuOv2YnObMWakk+Q/N9UHo/MMoT8bN/+yIgvRiNLjnSmUEo5VsZFlnqe8E4NGni7M6cEbBQppTjPmN00vGmvulcvB0D4GXpMX+4MD2OGG/njLsg= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:54:00 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:54:00 +0000 From: To: Subject: [PATCH 10/16] crypto: atmel-{aes,tdes} - Do not save IV for ECB mode Thread-Topic: [PATCH 10/16] crypto: atmel-{aes, tdes} - Do not save IV for ECB mode Thread-Index: AQHVq1Hr4YZFL3TcKEOdpojqCaJKbg== Date: Thu, 5 Dec 2019 09:54:00 +0000 Message-ID: <20191205095326.5094-11-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0e645a13-9262-4ad7-73ce-08d779690d66 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:247; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IIMxyLbwRM8xKsJMf+iVeFlDWEeZPu+icSxuh3/qutRwwK8Bd3JbsAWPFjHLWSypyVsKbA68xSI4FdfpKfh/+cSQCcSWyzq8AVLUWch7UiQpHtxG2UFC2JH/ERMyaZHhsqY+SheWkG0vMa4/KE3JB0tckmuB2aFqAtWRcHtvqsJP/Vooa7SDIWqlqU3lESPRxnRUQc8CVHMqn35h5/IASTmD2QX86HQsX4Z+EEXAJe/4YXBXgSSpF1BqsPxuJJQkcTLHGN3YJ3sSpPvoUHOTkfEVpAi3kCFM9rY9AefNZF+2F6KoZENscVsHvvWNKXRGEodCdT0NIAYopl9z/hDoMRSVyWeVdK6Tat26eHkLb5OS8isF7W8Qw1fB4cIltyvBu/Jmtovs3iGsAxZ+B5QZD+Tcl+BNdPV8BNgo8BPjuxBx0IjesGSATsIMWkdF7GvyZigyDry7LoYg+rG/OfGd66L+/Zqvc+LenMuVSAJAsTtHWtKopfsVeBMSnxdo9dYs MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0e645a13-9262-4ad7-73ce-08d779690d66 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:54:00.0898 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nor0RR/Q4tsjOz8sV4lroSTBnnajkCNr9qHiDyPh00EA4qUt4rO/cT0ZFXHI7lHzK9L6JPsxeUnVIpSFyMBAOj8JA9vQro1BLs3tI7DvUlY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015403_167378_D31B9217 X-CRM114-Status: UNSURE ( 8.19 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus ECB mode does not use IV. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-aes.c | 9 +++++++-- drivers/crypto/atmel-tdes.c | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 0744859ec793..d7e28ec456ff 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -516,6 +516,9 @@ static void atmel_aes_set_iv_as_last_ciphertext_block(struct atmel_aes_dev *dd) static inline int atmel_aes_complete(struct atmel_aes_dev *dd, int err) { + struct skcipher_request *req = skcipher_request_cast(dd->areq); + struct atmel_aes_reqctx *rctx = skcipher_request_ctx(req); + #if IS_ENABLED(CONFIG_CRYPTO_DEV_ATMEL_AUTHENC) if (dd->ctx->is_aead) atmel_aes_authenc_complete(dd, err); @@ -524,7 +527,8 @@ static inline int atmel_aes_complete(struct atmel_aes_dev *dd, int err) clk_disable(dd->iclk); dd->flags &= ~AES_FLAGS_BUSY; - if (!dd->ctx->is_aead) + if (!dd->ctx->is_aead && + (rctx->mode & AES_FLAGS_OPMODE_MASK) != AES_FLAGS_ECB) atmel_aes_set_iv_as_last_ciphertext_block(dd); if (dd->is_async) @@ -1131,7 +1135,8 @@ static int atmel_aes_crypt(struct skcipher_request *req, unsigned long mode) rctx = skcipher_request_ctx(req); rctx->mode = mode; - if (!(mode & AES_FLAGS_ENCRYPT) && (req->src == req->dst)) { + if ((mode & AES_FLAGS_OPMODE_MASK) != AES_FLAGS_ECB && + !(mode & AES_FLAGS_ENCRYPT) && req->src == req->dst) { unsigned int ivsize = crypto_skcipher_ivsize(skcipher); if (req->cryptlen >= ivsize) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 0a096f36785e..f44ef17420fb 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -593,12 +593,14 @@ atmel_tdes_set_iv_as_last_ciphertext_block(struct atmel_tdes_dev *dd) static void atmel_tdes_finish_req(struct atmel_tdes_dev *dd, int err) { struct skcipher_request *req = dd->req; + struct atmel_tdes_reqctx *rctx = skcipher_request_ctx(req); clk_disable_unprepare(dd->iclk); dd->flags &= ~TDES_FLAGS_BUSY; - atmel_tdes_set_iv_as_last_ciphertext_block(dd); + if ((rctx->mode & TDES_FLAGS_OPMODE_MASK) != TDES_FLAGS_ECB) + atmel_tdes_set_iv_as_last_ciphertext_block(dd); req->base.complete(&req->base, err); } @@ -728,7 +730,8 @@ static int atmel_tdes_crypt(struct skcipher_request *req, unsigned long mode) rctx->mode = mode; - if (!(mode & TDES_FLAGS_ENCRYPT) && req->src == req->dst) { + if ((mode & TDES_FLAGS_OPMODE_MASK) != TDES_FLAGS_ECB && + !(mode & TDES_FLAGS_ENCRYPT) && req->src == req->dst) { unsigned int ivsize = crypto_skcipher_ivsize(skcipher); if (req->cryptlen >= ivsize) From patchwork Thu Dec 5 09:54:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274585 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D33E21805 for ; Thu, 5 Dec 2019 09:57:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9FFB42464D for ; Thu, 5 Dec 2019 09:57:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cgFp1myb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="K1bow8IR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FFB42464D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GEpMFVMFAlzNOY3oDQQcrUF9fAf724yzWHRUuyrOUPU=; b=cgFp1mybKWbTHm o898K5d3UoNOUeVUNY2dtqkIzHSpDw8kwpSSwRdtF2iyhLDfPG6iZh6ZnN9LOOQO859MZpgHsoBVG 8DWEu4UEOSdjmOvb2222KOeidssOYdnKJnqh7Ht5yQVNKivNfDU1tKhpbhP9Z1J9YnmFpPneXhZ7W mBgHV43YnEuk54d3NnLhnDPTekn5pKX3p1vulR5UovU+FQ9ah2Uf/vmr5Rt32S1nojjaN1916xl6t z699TzwViLviOaKiXvLjbzMK7JAAfD/WwYntcQr0dPbmpQ2YjGbmq35YypY/QXAP8Es1IdFzAPbhz +aYLOoRpGx+c2KAV2gKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnss-0007Zh-Jk; Thu, 05 Dec 2019 09:57:18 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpn-0002xF-51 for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:10 +0000 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: lSZ+IrP9n24Y1eQ56aHOAd1RyzlLXB3jxiGbR1u0NZXgaPb/3xFtemyN9BScbktffbEI19Ye1l 6Tlg44uIdbNAkle/aUtZKNUJxZX16fap9Be4CCPJ0JsFuA1VUTEwTUGtbZ9dwIu281VqTbIwKL Lv4o1J27oUXU8kZly0pB0XuzFG26oqItyukHyTpsH/4lZjd8dgZJxIKL6kk6sNUJIMWB+c/jNa EPW7jLzZWEA9kJEvietvLiXzvHw9x6Od+Dgr7qOCm7k20LVoFyXnDsIjX8wErWquUD1hcdcnjN n/U= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="58828903" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:54:06 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:03 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PUWKj3z6KE0Pd9rX+VEJ9NXmGN5dFd8vNVjUERmZ/dQR/N5yyhbZQ62BpzDyrmpPQaVdEGfW4cTscfy2UzlF2MJHxvmj7APFPWT/uB0XinV78WNnTnd8Wrrjw+D8DQw8DQ0Q3gOdvg0Sw6MoIf43HhLa0O9RVXQLYANq133G6yNROnWmc1VoT/zL6clwOeobYyuFg38epTptuCRR9PqLbaSNKT6p1LxYuQWSAaGfwH/WnE74EGUzU5GgerBgk5kcTu6UDNJSyf8WjDJhJgriadB01hrqiVOiGlqy4jamKuHQAyGb3dxmZS4ViPvlgQuhMM6RCkGHvgxyYbuA4RIM4Q== 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=2tyS+CXzT6/IJlaa+dUvn2lYyE/Fm7pzodVKpWkRVRA=; b=fbBBQgqFbswsLVbK6ecIjNk226frOh6HsevHXSw39cMP0PRUy/x1JPV0SQ+wB8NaISOOJxZmPoXQ6AcUhgeV8Qp4bwVt3AoMIwB0QdHC4Yfwrwpsr/Csk7ENpgCK3MKPDoyJ5/T9O0pwczpbBYYqi8EcO9xxG6jdS3PM/aLvTg4qvsLy5yD9KtfvrJshLVL0cU5M95SV2RJ8V9T+I2qQVGKgdIrSuAn0xNryUPkJQYnKoRUTcxu7/iELVmeGA1SDzx6jekCqJvzeL/bbx6LXa1XNtAQUhdZHs2xWt+JvwzL6mtQ/dAt5ZiZFcyDOxAafvalwRpvUAFdKvtYFFrJn2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2tyS+CXzT6/IJlaa+dUvn2lYyE/Fm7pzodVKpWkRVRA=; b=K1bow8IRw35nMFjZJt0e5tF2tgQDC/pl3UqEYA5kiOtJqLbEJHgg3bKdC6zyOtx1HS/5ggk0Ihlu5Ab10uJU4ZOoNvfqFtTSP0hbswqOUyLAHbPR94XA39Li57mRyao+g2zt74oDtWN1AY+3BPVo26BzQQ3V442Vfow3vfSus68= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:54:01 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:54:01 +0000 From: To: Subject: [PATCH 11/16] crypto: atmel-aes - Fix counter overflow in CTR mode Thread-Topic: [PATCH 11/16] crypto: atmel-aes - Fix counter overflow in CTR mode Thread-Index: AQHVq1HrgNe4xzeSBkCXNcTWtRVkYQ== Date: Thu, 5 Dec 2019 09:54:01 +0000 Message-ID: <20191205095326.5094-12-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cf590f9a-521b-415d-6b93-08d779690e55 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cHd+5S4rpOlXzMKHQQmyCM7RlIVZ+kBv8zj4pzGYgvLzOAwVIb8Fo3gwYRkhkxUrBohSdousnkpk0FyWkk1zvISYv4N/XzlBSe4lfKYtL2roZeRfd8edLPlbPYPo7z0PEWHmwVOAK7UruWHVXxvKwBMZOlyJEbQJ/kkw3u6N1ZSxY4n1zLFSOix7+Qmbb2l+GkXlYI8IyrvakOvBtWl+1SpubHaQY9NRgBfw6lj9M+nxEVdPPfcExifAMBi2Hn34TlrEnl1/I+xpo+tSmYSwiH8zBRL8dZ08QClwS68duvfY3t6au40S6aRsz0sItrDpq/+GUeH8IFdUgPrsts3WKJVKG96fETFrLq97XTrZUtYMeX/2JK4kFxRsg1Vy/7gKOIokNU9ORrk58p2/9FZQ/y2PD2Pt0XXASJsauN6Lkk6LSxPHOea+/lAnrYtF6v+o MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cf590f9a-521b-415d-6b93-08d779690e55 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:54:01.6809 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ihf5VX6kY5C8P4wXKlggBf2fEzCpvIDDIfA+7GkT6yC16fG85cs2YO6oeZtW5xBQqfwzz3UCPKNBhpJLmxJ3pjuI3ZhCjiGefpLHunCSxJQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015407_269441_66365A50 X-CRM114-Status: GOOD ( 10.90 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.5 PDS_BTC_ID FP reduced Bitcoin ID X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus 32 bit counter is not supported by neither of our AES IPs, all implement a 16 bit block counter. Drop the 32 bit block counter logic. Fixes: fcac83656a3e ("crypto: atmel-aes - fix the counter overflow in CTR mode") Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-aes.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index d7e28ec456ff..cbfe6ccd2a0d 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -89,7 +89,6 @@ struct atmel_aes_caps { bool has_dualbuff; bool has_cfb64; - bool has_ctr32; bool has_gcm; bool has_xts; bool has_authenc; @@ -1019,8 +1018,9 @@ static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd) struct atmel_aes_ctr_ctx *ctx = atmel_aes_ctr_ctx_cast(dd->ctx); struct skcipher_request *req = skcipher_request_cast(dd->areq); struct scatterlist *src, *dst; - u32 ctr, blocks; size_t datalen; + u32 ctr; + u16 blocks, start, end; bool use_dma, fragmented = false; /* Check for transfer completion. */ @@ -1032,27 +1032,17 @@ static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd) datalen = req->cryptlen - ctx->offset; blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE); ctr = be32_to_cpu(ctx->iv[3]); - if (dd->caps.has_ctr32) { - /* Check 32bit counter overflow. */ - u32 start = ctr; - u32 end = start + blocks - 1; - - if (end < start) { - ctr |= 0xffffffff; - datalen = AES_BLOCK_SIZE * -start; - fragmented = true; - } - } else { - /* Check 16bit counter overflow. */ - u16 start = ctr & 0xffff; - u16 end = start + (u16)blocks - 1; - - if (blocks >> 16 || end < start) { - ctr |= 0xffff; - datalen = AES_BLOCK_SIZE * (0x10000-start); - fragmented = true; - } + + /* Check 16bit counter overflow. */ + start = ctr & 0xffff; + end = start + blocks - 1; + + if (blocks >> 16 || end < start) { + ctr |= 0xffff; + datalen = AES_BLOCK_SIZE * (0x10000 - start); + fragmented = true; } + use_dma = (datalen >= ATMEL_AES_DMA_THRESHOLD); /* Jump to offset. */ @@ -2538,7 +2528,6 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd) { dd->caps.has_dualbuff = 0; dd->caps.has_cfb64 = 0; - dd->caps.has_ctr32 = 0; dd->caps.has_gcm = 0; dd->caps.has_xts = 0; dd->caps.has_authenc = 0; @@ -2549,7 +2538,6 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd) case 0x500: dd->caps.has_dualbuff = 1; dd->caps.has_cfb64 = 1; - dd->caps.has_ctr32 = 1; dd->caps.has_gcm = 1; dd->caps.has_xts = 1; dd->caps.has_authenc = 1; @@ -2558,7 +2546,6 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd) case 0x200: dd->caps.has_dualbuff = 1; dd->caps.has_cfb64 = 1; - dd->caps.has_ctr32 = 1; dd->caps.has_gcm = 1; dd->caps.max_burst_size = 4; break; From patchwork Thu Dec 5 09:54:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9490D1805 for ; Thu, 5 Dec 2019 09:57:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5FCDB2464D for ; Thu, 5 Dec 2019 09:57:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cqgKLAf1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="Z9NRP718" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FCDB2464D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vHhTtubyKKAxc3OonEtcwxtQBNozRvnfV+W/3XXqXk4=; b=cqgKLAf1jWrCzN /Uz39WriViMpO6d4nGCBgf8p6weR1jvikWx4cCa+6fb1t1GIbV6+9pY1VVdz1BdzkhmwDil4Ftfka vJZ4OhesKx2eHoK/ryvSorXSgxJygbBLEqPeT3djAggSsKOm0hOqHZO9usFp1DL2ETJ3x+SvWi5V7 e1mdAuz2u+iZwWxQGRp+DfccDXY1leRaqtnKg68oxRiD5maNfMSjqeuk4aR3p2Aq3ucbq7Q51227r 3x1li4NeGgJ4uUm8dCbt/oLKm1CM3OawqImyijOfLQvScHdtd0d9G/E2UQfw8dM/v1YU9po9rhaGd sh1C9I4y/9INVjL6mAvQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnsf-0007K0-Ek; Thu, 05 Dec 2019 09:57:05 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpl-00035O-Qv for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:08 +0000 Received-SPF: Pass (esa3.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa3.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa3.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: DgjmBG2l3vtdj+xs72GVL7OCfKVl95bvU5/p7Mn1mpanTCej+oMoH0mgN6x9ctoxdSfq3f/0OK geUJ80MRY21i86xcnaF2iFRiM9DOSUxhnwWe1eH5JMdjIp1mm39+PrUGgrkm9iM8ihBOPddloY IHuC4xIAC2ySeKNR1eUppyRQhm/23+4+fOSHGC5oyWbYaZTKOnkR3Kl6bwZpH9F6PVikJfDvf8 bJY6pXCZiloNEjTK/S0XZGfS25sRCYym+7xd7tbHNZ6lYtTxblktREhH8E9zMxgBN7cZc4q8vi SsE= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="59347330" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:54:04 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:06 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iiZqPh0Mtnfn5K3IKItNl8wYhLPuJg/wNcuMQIPcISmEYoFRW2CgMs/8F47vDBhaRyXkfGBSxUyob2GovbYpJQ0Aj7kXnM3AcTaxMMqL2rbhL0rFWnFVFur2zhcdpBDiefn72ZE9iIrvfNae1BURO76XYOaKzSGKKdkLAv4VtlF9qHYBcLxIpNGnRZuHY5xQcrrKS7XLtEQLPTkAxs6G+oOk2krbCYmizy3XZpLjUjfFqAEHNnrV/g2LUyVr8Kr1ycRfD1XmDYXcz76TBLhzrqU0+GfHbq4ekdR8FJaRgRWwPrbl1s+oQMhaB6HTYJfrcDVAA+jf42OrlIhYzk/IVw== 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=yeLwb2XawRQuHknJR4sP/1YbNCjQLINB9ZRF9097Roo=; b=RhXCAwTIKpNFIku4+TGbE93ucoYBNg1HA8wEE0MxvbXrfoVqdKZdQ1jx5+cdbT5ExyTZVtySeYtc25n5ysDFyu9jVMOb0Sr/7pN6aKpHVg87XNKtRii33F7JVDHmcQxFKgB+GkBk8pqlRC+hCNrzhsFfMxcf07LnU2TAVSQQOMT4Qe5SyG9yPuZx55vSgIhvYwyEzhdMU+crfPdwt4GxMLFmjaD26Fm2yWF6IFRo3lCj7XGLzsL++g3Q1WWH8uFaN1grmPhW1KMlXlkBlWaJ32RLJfQj8NqF/iWQkfPBCowZVGk0LPoNohEbdyRyK8XzZFdn6OebUMey3Jaz5YQVCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yeLwb2XawRQuHknJR4sP/1YbNCjQLINB9ZRF9097Roo=; b=Z9NRP71896aU3GWqIH1R6zoQ6tFoivT+ptv3oV2uMMb/GBJ04VAD0bMCf7kq6GFerMHg81maS7TWEEcXb22zcHiZ46aa38hVN8xx7PThMhwHOse7UuOcdHPpr8KUYGdEjiTmW1TkIZph0cXNo6f6K5CGcbhbNRzBNgKITMsHd+8= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:54:03 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:54:03 +0000 From: To: Subject: [PATCH 12/16] crypto: atmel-aes - Fix saving of IV for CTR mode Thread-Topic: [PATCH 12/16] crypto: atmel-aes - Fix saving of IV for CTR mode Thread-Index: AQHVq1Hswvi5MUOxfE+TUslwNbNKZA== Date: Thu, 5 Dec 2019 09:54:03 +0000 Message-ID: <20191205095326.5094-13-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fb6c0613-5faa-4099-fee8-08d779690f4d x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VAnEREDJbbtF9P1+QNNjjMsHKtPy5dK53zQlxbhwroFmeInPcEpWhNofzKyTNCZ60vRbSOxjLpIAL9Iq0yXW1IQPXCz2d+csTMd5fKKUePKLuKqZH7q/6WxfAYozDR3SpqIu7euxcGi39vQdZvB9ulJIa40p9f2dHb6N3w19ZdfEKuPk9v4faVArYuzvYGIkdeRhE1wNJUfN7AYICsyQ8IsLimpS1LOPdkUuV9AWaV87VSMBI6+FQZim/F5oQ+e8VXSWyoyxz+JgzT//mcmewZGMkOz87U2hn+4Aaiua9wHknGMjxZmq3kDKdDDb8gs6IWh/vhOON/t903vWc4nrWWNkAiHdNySad/VQS/3uYm+J1PW73Jks965xsD5BkmKGRMbLcagByYOsVoENwbT/KYbFZUXez+cHftbKQlHfylidYcMqJO0JeV+99hXYg32L MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: fb6c0613-5faa-4099-fee8-08d779690f4d X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:54:03.3040 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mvGCXLsTO1T6T6f8+pZ9053VaC2xV6x6hZy40hE4UHl7TxvY0DY1tFbKKwu4wn+7k5hYR/J9xTCNf7MmvIVnx039FFHxABKNBNZY2P8vbVc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015406_027229_2745BB4A X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus The req->iv of the skcipher_request is expected to contain the last used IV. Update the req->iv for CTR mode. Fixes: bd3c7b5c2aba ("crypto: atmel - add Atmel AES driver") Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-aes.c | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index cbfe6ccd2a0d..60f54580d646 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -121,6 +121,7 @@ struct atmel_aes_ctr_ctx { size_t offset; struct scatterlist src[2]; struct scatterlist dst[2]; + u16 blocks; }; struct atmel_aes_gcm_ctx { @@ -513,6 +514,26 @@ static void atmel_aes_set_iv_as_last_ciphertext_block(struct atmel_aes_dev *dd) } } +static inline struct atmel_aes_ctr_ctx * +atmel_aes_ctr_ctx_cast(struct atmel_aes_base_ctx *ctx) +{ + return container_of(ctx, struct atmel_aes_ctr_ctx, base); +} + +static void atmel_aes_ctr_update_req_iv(struct atmel_aes_dev *dd) +{ + struct atmel_aes_ctr_ctx *ctx = atmel_aes_ctr_ctx_cast(dd->ctx); + struct skcipher_request *req = skcipher_request_cast(dd->areq); + struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); + unsigned int ivsize = crypto_skcipher_ivsize(skcipher); + int i; + + for (i = 0; i < ctx->blocks; i++) + crypto_inc((u8 *)ctx->iv, AES_BLOCK_SIZE); + + memcpy(req->iv, ctx->iv, ivsize); +} + static inline int atmel_aes_complete(struct atmel_aes_dev *dd, int err) { struct skcipher_request *req = skcipher_request_cast(dd->areq); @@ -527,8 +548,12 @@ static inline int atmel_aes_complete(struct atmel_aes_dev *dd, int err) dd->flags &= ~AES_FLAGS_BUSY; if (!dd->ctx->is_aead && - (rctx->mode & AES_FLAGS_OPMODE_MASK) != AES_FLAGS_ECB) - atmel_aes_set_iv_as_last_ciphertext_block(dd); + (rctx->mode & AES_FLAGS_OPMODE_MASK) != AES_FLAGS_ECB) { + if ((rctx->mode & AES_FLAGS_OPMODE_MASK) != AES_FLAGS_CTR) + atmel_aes_set_iv_as_last_ciphertext_block(dd); + else + atmel_aes_ctr_update_req_iv(dd); + } if (dd->is_async) dd->areq->complete(dd->areq, err); @@ -1007,12 +1032,6 @@ static int atmel_aes_start(struct atmel_aes_dev *dd) atmel_aes_transfer_complete); } -static inline struct atmel_aes_ctr_ctx * -atmel_aes_ctr_ctx_cast(struct atmel_aes_base_ctx *ctx) -{ - return container_of(ctx, struct atmel_aes_ctr_ctx, base); -} - static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd) { struct atmel_aes_ctr_ctx *ctx = atmel_aes_ctr_ctx_cast(dd->ctx); @@ -1020,7 +1039,7 @@ static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd) struct scatterlist *src, *dst; size_t datalen; u32 ctr; - u16 blocks, start, end; + u16 start, end; bool use_dma, fragmented = false; /* Check for transfer completion. */ @@ -1030,14 +1049,14 @@ static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd) /* Compute data length. */ datalen = req->cryptlen - ctx->offset; - blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE); + ctx->blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE); ctr = be32_to_cpu(ctx->iv[3]); /* Check 16bit counter overflow. */ start = ctr & 0xffff; - end = start + blocks - 1; + end = start + ctx->blocks - 1; - if (blocks >> 16 || end < start) { + if (ctx->blocks >> 16 || end < start) { ctr |= 0xffff; datalen = AES_BLOCK_SIZE * (0x10000 - start); fragmented = true; From patchwork Thu Dec 5 09:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCE96138C for ; Thu, 5 Dec 2019 09:57:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A779E2464D for ; Thu, 5 Dec 2019 09:57:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hqsCoZUJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="D1qexQMn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A779E2464D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z8uLFhBGrGnLZ8MCDb1ugzbm+kehECHVhqq4PZiszco=; b=hqsCoZUJhaZjWy WhsZCJIs/FGnzpMCeP/S5pXGu/49IKP1WrsseF5S/NOboHDHkfp1yh0qujDe288Z+VYAVHnxxmFOI tjrAFkMVxCIhS+UsjIp+jtnDZZ7pR3cDAoP1GSBEOZ2p4KwAECmP1hQG0okJqeVgA4P5hWbhkknOe XiPcDoSR8hzpJYzEqAHi7mwM2EPhb0ol5mW4pnWpfeLo9yLv9zTuoP60E/NejVlPOWH3E1ZsiIlOf foiOi2zhDeHbSxjcMaXGxfBO2rso1NcKN3LlFavjX88CcY82OGQLTH1PfSWkYctIW7SO31zwk4xpp BMjx4hvTzkIinL722dRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icntT-00084k-Sq; Thu, 05 Dec 2019 09:57:55 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpn-00037C-GK for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:12 +0000 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: 3yRY/RzpeZN2YvjRynj3FeTCtsfLOgf58D9QugBZOZvrSc/jDeMQkbcdCshPAGQ2RpJC1LVFfL mrOY9wUs/pCpKaONl/6G4wKQT8jJbqiB4mmuxxFJewJY1oyjb4foYFQHNsoOBCT4BSNhnY74op IOgWee1AgAuDjDtYjIRR9VMrR9ITv+bhkMXtIyrD1iHKkS1ztgVCGBE7hinHSkLRLDm+Wkm7N2 yCLWePDopuFVrriOCNcdU81/2wt5xEUphKIqdTLowTuBVigDnDIpjn9eyZRfwWaUI1w13fGoSF l3k= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="57544886" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:54:06 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:06 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZIF6GNwbHt5DPYs8ma2WKP5Gnf800zRZxqZ7+AspPn3wjHTIu1AzaRFdsdN7EHg0TKfbdekSjVZevUBRXmAG5aw/0Co5CZZbCSJGqKQyXhkE1jlcyksji3fgASCeWuyguDRI4PIK0Byu770NpOeb0xYS9vCLm62vce2sG6jTqQCJx8lGzEVxa+KvMqJ92gztahs/20L2eWioDQAXhNx7b4oziBjEE0v6OrSHLcY6LfIZH4YD+w4BGvtxJMUf1pDOO2ST8RIaaXZSvwpOMKyyJIQqWl8LxLlJ0KfCYfpp96/WMX8sQy+cfytIC5cE6/LxNe6RUTmPYj0pzYbCT05Xw== 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=ch07qqhA5sBB8KsHCOQsVghlIW3XngPUAwPyVHXLAAI=; b=DiEinIaPMubleax2PiJ+56YT+CRfpTFsBECloKAo99/xYf1InM5rby0pnz2u/lsGRRDTrQPxo/qSxuR7O+cmq0FzHgm5h7FZpNwo/4rYRpc3nWuUwx91FMkUIDf8X6vZZ9+4h+okyhPiZMzq3VXpAYpUseWMrI5/vr1yyz2TgT+mB0uu8JWt41JyhouCNoC0/xqX2L5gt7jiZiG4TsF+JZvUsweLdB4PBl3jd7BGCRSPKNaFXxyJmwd/UAQaiuji/VRrFmJionMbzlUMmXGaTWbcRtf8TcE3Ob4BtIoaHr9+MmgrPxlzO2aAzw8AVDGJr+7UNHa7vQ6jim+D+MiiKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ch07qqhA5sBB8KsHCOQsVghlIW3XngPUAwPyVHXLAAI=; b=D1qexQMnNw2LogNuiiBhVAwWyK/o5xFc2gZx6njmzYjfw/0oCgnX4Wf2JKxhVZ73Byq5mxdDEXfZJ9tGYXL+be3k60i3pEaDZImFp1qKLQvxNeU1nA05LRCaQio/lQ6Er66xHhyPgR1OoL4UcGKgJRNPaQgys1YHK7yROMshKgg= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:54:05 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:54:05 +0000 From: To: Subject: [PATCH 13/16] crypto: atmel-{sha,tdes} - Remove unused 'err' member of driver data Thread-Topic: [PATCH 13/16] crypto: atmel-{sha,tdes} - Remove unused 'err' member of driver data Thread-Index: AQHVq1HtgeqNxMaumE+ZifuT+ElSjQ== Date: Thu, 5 Dec 2019 09:54:04 +0000 Message-ID: <20191205095326.5094-14-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8f588b54-ff10-4ed3-89e1-08d779691041 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2582; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RtdDqdJTa0czJo6IIcuMqS5X6tLrglEIo7wJrQ/pbTvM1E/2EDDO2duPn5/XoIuJX5xKM//fhCzD4JVlPRNQTfvvbqmPkg6agHzMh4yYgAvskLKqB0n9hSyjYG8Old6AQ8HVgHcHJtfWBSLO0/v8+7c5iWANc2570ewj+mt+/Sv1WywyxrO/V0xSFYB2ZquhgJobwePCiyoF8e3CqZumQNBN8apeMmvdB4cbFRKzxqRydwp//DG86M3JTfL0UR+GLVOE/Gxuai8lvVULQeNw/C7zx27N4f/BJ//7O482v6NJNoNoA6q7DB6CgeowcyYq4+uFVEZ3m/iCB9b/4ffmc/gHIBqo4zTJduxW8Kf83cXNalCkBA+JBEglKH6GDBB8oj8m675ajFSxrPT7OOjoaaoGWcvTr+uW3fJgp7vcoJi4t9b/0JyiE8z68nqbaeQjNned8oa3MgJCP6ZFdvjzQU/tc3jNesGf17vPZBLk8EcVK70kw5ncawoRdKbLv1zD MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8f588b54-ff10-4ed3-89e1-08d779691041 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:54:04.8801 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: D0dRBZjy5cxiyqnwFTBbWYt9wL3TLkSL2k4WmWeI7C8KzRZoAZgxNjyoM42eXqlP+H3k48RSIpTBCcRJoiWS9UOja8yBI7e7trzsaAUMUz8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015407_616282_DA45B64E X-CRM114-Status: UNSURE ( 6.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus 'err' member was initialized to 0 but its value never changed. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-sha.c | 6 ------ drivers/crypto/atmel-tdes.c | 4 ---- 2 files changed, 10 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 8f63a1aebd9e..391a72728c2a 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -136,7 +136,6 @@ struct atmel_sha_dev { void __iomem *io_base; spinlock_t lock; - int err; struct tasklet_struct done_task; struct tasklet_struct queue_task; @@ -1027,7 +1026,6 @@ static int atmel_sha_hw_init(struct atmel_sha_dev *dd) if (!(SHA_FLAGS_INIT & dd->flags)) { atmel_sha_write(dd, SHA_CR, SHA_CR_SWRST); dd->flags |= SHA_FLAGS_INIT; - dd->err = 0; } return 0; @@ -1403,10 +1401,6 @@ static int atmel_sha_done(struct atmel_sha_dev *dd) if (SHA_FLAGS_DMA_ACTIVE & dd->flags) { dd->flags &= ~SHA_FLAGS_DMA_ACTIVE; atmel_sha_update_dma_stop(dd); - if (dd->err) { - err = dd->err; - goto finish; - } } if (SHA_FLAGS_OUTPUT_READY & dd->flags) { /* hash or semi-hash ready */ diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index f44ef17420fb..d10be95a6470 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -102,7 +102,6 @@ struct atmel_tdes_dev { int irq; unsigned long flags; - int err; spinlock_t lock; struct crypto_queue queue; @@ -228,7 +227,6 @@ static int atmel_tdes_hw_init(struct atmel_tdes_dev *dd) if (!(dd->flags & TDES_FLAGS_INIT)) { atmel_tdes_write(dd, TDES_CR, TDES_CR_SWRST); dd->flags |= TDES_FLAGS_INIT; - dd->err = 0; } return 0; @@ -1124,8 +1122,6 @@ static void atmel_tdes_done_task(unsigned long data) else err = atmel_tdes_crypt_dma_stop(dd); - err = dd->err ? : err; - if (dd->total && !err) { if (dd->flags & TDES_FLAGS_FAST) { dd->in_sg = sg_next(dd->in_sg); From patchwork Thu Dec 5 09:54:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E512014BD for ; Thu, 5 Dec 2019 09:57:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8CD4C24651 for ; Thu, 5 Dec 2019 09:57:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="t1qa4UIM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="j1XZu3XJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CD4C24651 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i4H91jIzsULlysEGm1yx8RZ/zGuNfgScOc7R+5WLq2o=; b=t1qa4UIMSws1vN vBOzIyrHcggjiWH11P2bg9zzY+ZmjvRhESVAoimtTHtfVF2nxlbqEIUOPNaBpTd6lp4VAeP0U0h6G TkCYUBi0o2xwISCdSe3CrruNRc+zmD+BeNsdy1sE9FHRhojjqF09fP59N1dB6zubks/Cfs/WH4HYq R+Xsk0kCF2VMw64SLPm5+Smoxm0GU+8LzOINYE42ibZ8v1SE5j0zl3aqZ7nyPVQtusBZGSrotIIQN 7dELcJA50WYL1T2eyY/5GST4JHJkF7KUZCxKvZgb4ILul59X6tmwcxZiOKbP8Z4ijrbs6VKBu6+a5 d7UiwCh5sPMb8Ky99HRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnt8-0007on-10; Thu, 05 Dec 2019 09:57:34 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpp-00039P-P8 for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:12 +0000 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: 89BBUmjWwvBOA59gTX/U/LyEe0N20i91lR2OMUczO/mbSxr8Dg320ouxE28xlGCvIb19GS0MKe 2Iri3tkly8ZMehSbrW3HHvMvrQcxqV8JtR0b32WAB1ZCrlo9VjVhanYux1tA+WJm793525TSqB bdGNPr9tojr6/EUwnHSN/fHj+o8YS2Wht46ZMameh6mjyyEy3lBoOjWhliujziDv6vOpo8z1Es JniGIBNqIISX+bh0y7XlMe4sen3sNkaEfXEjsqLiPtlyrHGWUqsKu6FAAoiOPJ4mB6ARgkgqGq jkU= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="57544900" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:54:08 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:08 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CrNib3qjvFvQWfcpgyUx2xEgxIBMqV8w5W9INRYG6cRbVLW2eD6Ph1fo3EMJRg2mTEW0V9aBj65ngruVxLbp6777IV3g4btqlC3dqKQZOnuklj//DZl93G0Z17k5Bktxp4kGsW8I6AOJfKa4l90133F4RRJmRpq8ObTBx5t95ZS5bPpdZ90CeH/RcA9y/x+HXAErGMdEcEjmkvwlwWhNSqEykXcVIrviEs2yC5UQC80U1LsHl1mLDurHY66D/gINFyVV2urEAGH8DIitHzpItc9f5WWTBsV6g3fGdCAXRMZEj9beCexnLUoNO6ZSKOxnuv+/stiZmCs1pN/QImYuyA== 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=EMeyqkkhOwQHzD1TZP1b7p/kc7yXc3GgOWu9Lw2uvmY=; b=BAun4E6nm4iFqaWMSD8iXGeiqHz/fvuwIRlvNE9ZoPrVpjS57vpfgjK+q5iq1DtNrAJlyyKzygAuKw9W2sbfKPXgKrRncPW0kgDUdHXxY46BujfuFqJ+U7W0IlP+omUXVp5VNEALVIBEtIh5C4J7kBPHPrrjwiR7GtfeBeMvD1nnP1Ti/kiAbBoeV1UOr2/7GR1awpM7aYiIrk7+wuEu5v89lNRAQADd/k0jOiFrZC/ETmbp9bWwUPKmtFqh342FNFpY7hxapL0hsAWHz7z7oIVRFSu1b93tmxviV7PtsdSrA88t5ph3ccYJvI76LL2TjUDsLyDB+KLMt+xGL0qgOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EMeyqkkhOwQHzD1TZP1b7p/kc7yXc3GgOWu9Lw2uvmY=; b=j1XZu3XJmumpecv4zj3hg/sLbxpYGEHp1KmYYy3m0xzkxQT9mJK+8jre6IFRossfbK0IionkYAVSy+ATrsMoPy1bCp5xOa+fCvb8Ccr1yeO+Z4mk/6kextBuX/R2kj1zZTd2wx2Aa4ICcW4Z/2QuZ9V3A2qhJtO/VtlsceqgdSk= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB3677.namprd11.prod.outlook.com (20.178.253.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 09:54:07 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:54:07 +0000 From: To: Subject: [PATCH 14/16] crypto: atmel-sha - Void return type for atmel_sha_update_dma_stop() Thread-Topic: [PATCH 14/16] crypto: atmel-sha - Void return type for atmel_sha_update_dma_stop() Thread-Index: AQHVq1HvDQITs5W+m0SHjGvsCwHDGQ== Date: Thu, 5 Dec 2019 09:54:06 +0000 Message-ID: <20191205095326.5094-15-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bee9dbf6-638f-4990-6fc9-08d779691175 x-ms-traffictypediagnostic: MN2PR11MB3677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:221; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(2616005)(66556008)(305945005)(66476007)(66446008)(102836004)(64756008)(11346002)(5660300002)(52116002)(76176011)(99286004)(36756003)(66946007)(4744005)(2906002)(54906003)(26005)(6916009)(6506007)(1076003)(8676002)(6486002)(4326008)(50226002)(1730700003)(8936002)(14454004)(81156014)(186003)(86362001)(81166006)(5640700003)(478600001)(6512007)(71200400001)(25786009)(316002)(71190400001)(14444005)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3677; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xROzuMCWirXXb8EruNr0D2VdtMX4o8shQSK56TbbDmu4DLN0NkqJPkEku5zCUWrvjonu0tfPSaoe1qS0KDJZAewjeIDZDWjK0NWEzWtL+NXa17wuFRZbuPenY8ggGigGHb5M+PPnlo+36Htj0gJcLO0Uhn0FgDn8qKZ5TO3fEUSEeY6GMxoNtuYqHQBDOvBFBsVzI2p/52M3N+ZLZFfORQwtcWWYfGfa45bsqN0d54Qbq+n8LlJb9ewN8BOaHS15oIWQdRvcR74jrrGJ9vACV2Q6le7YoREGTGlOQGfwGASfG5k6RuP4ckfKoeMvKO7/0dji4u4+yFVQsj1wODO8RcjDO4YA7P3+OAvpTBtDNyIYHuvTd333gyBN6dl5/WbeyPQPOzFKLUfxVMeurx/eYkFeffMlOj6LdIs2EbkBOhU5ss7IKHs97uXYYUHx2Wnu MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bee9dbf6-638f-4990-6fc9-08d779691175 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:54:07.0159 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uCQrLuOv9MREEM5wcBVGvf59e7TuOnwW6SbzrFrlbNo6eIvrQyKN7ViGkdYywNAKr9IAQ8dlgZ0abMuJgkBf0YD94J88i9xeLjVbZFSMGgs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3677 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015409_895158_4A5D53F4 X-CRM114-Status: UNSURE ( 8.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus No error handling, change return type to void. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-sha.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 391a72728c2a..a620a6a1cee3 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -852,7 +852,7 @@ static int atmel_sha_update_dma_start(struct atmel_sha_dev *dd) 0, final); } -static int atmel_sha_update_dma_stop(struct atmel_sha_dev *dd) +static void atmel_sha_update_dma_stop(struct atmel_sha_dev *dd) { struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req); @@ -871,8 +871,6 @@ static int atmel_sha_update_dma_stop(struct atmel_sha_dev *dd) dma_unmap_single(dd->dev, ctx->dma_addr, ctx->buflen + ctx->block_size, DMA_TO_DEVICE); } - - return 0; } static int atmel_sha_update_req(struct atmel_sha_dev *dd) From patchwork Thu Dec 5 09:54:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274591 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3C191593 for ; Thu, 5 Dec 2019 09:58:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 90D2224652 for ; Thu, 5 Dec 2019 09:58:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B0PKUvwt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="rbvmhcUM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90D2224652 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ROr+7L664pUaIdKlOiX2dpJ7lwavxMSwyBuyjxFYi+w=; b=B0PKUvwtmDxN0X doqGnoBupuJpHQKOgTGorIN8IlEGdw9ZVUAX6F4BwsNokZ9M1KqcjZQ3Qho4F+VPyRO5mUsRR3u2j 1LG8IEMQAcvo0km/qWBQ66IB1mCTKRsVF30UvOumIEFCd+PXuvpoNbz+Lkdv5KAa6NjTT8QO+hWqe ISaKheV9ntPAYuzeIJfrip5QVyq3joGuyKHrHAEHlxOdOubvX3J3YHQJHyvMrbzRXb6rDxXL4SAOi PdH3BiSdU19e4cAgMLG4psqlCloja+xOQ37N5Wei4Z+a7HMDMnfl7e4HNQe7lo8yKfpgqCiNMGMXj SN7dX1D+tZfeV8agP9oQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icntg-0008Gu-SJ; Thu, 05 Dec 2019 09:58:08 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnps-0003DX-Ct for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:14 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: BV2aU6pNUP/+0bwG3QbbBQRhLmfchapXczLp5S49HqFJk6jDnohROsWDcKHLIBOUHtOelfQpDm hTHnMBM+AV0UM0bKIXw7340y71qrXMIzzHIofdoVumiyqtYT6hVeRKS895ZqjQzHYh4OY2TDRO Wla0+cj5GgatnSvnPhgtU6MQC0eBRl60zhpnPlI/5p3tWd414mawT4FDS4CC6Kzpjp8usXzB8J NLEEzAL6tomi9+RJ67w0RL29qWhRalEWM5yiN7M4FmHQ+SMAWfyq0kAvT9UqAAcBx32Xrnhu/j MSc= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="60720975" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:54:11 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:13 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fCfQuAq7uos93T1rNrz13bSjqN/qYyAUUA6mudP81Bvqz/zGib/2djIjIfpN9PVe0lNJ0f5PP+Pu0Y3G3a5R0Tntmx0IPiA9LPW7Yv4SfjbGQGqaa6yi9RxNiAHHUGKbhi1PMzVGEXo0/WQbiUyNY+AqgWNZI6jqKq+uyD6Kjm2IEWQhokFHtXGHUrP7fHwTul3zD3YzdkWuikkbqPiZ3sucU84LdOlSee7pVYsTgAyU4/PJv4lJBovtOTWw8JUgTV9TIlLplUk3VyihX+JP5fdoDi2rEYXoP3DuzMuEiux3w/itNnjiZS7q+0rSnwQn21dfGM7x/logMvNPPwCZHA== 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=OAOWNs1s5agnr7SuVhtFNcGCj2V/kJs6rFylGY8kjLU=; b=PQHXGNl3Tm2NyVcoYYFQlZo3Gv697zneODWpj7O0nN/jSWD8Tb7MkgRBzdjj6rwjDx/70kG27xzkGkhlCjN0r9KEjab8VZjAc/P+/OxO4N7U7wu5Nh0eO5iXeONFG4YfPf8K62elvh8+Gaem5Nv6+vqKUVj4gocg1mYzfZFGdaAk2V1WjNlsFxJzC1IGbCIMq7qryvDcDfVqQ21E6VPhvSLjYJ7tq+53Oh/hwHRG18nU1BJY+93bkdvtCDMF5oZQ2OGa4HqvLSoIjcJM6XPti5ctDnSbkbO49pZzd77k6M9s2FmN6irW+K7arHpXatoR5iGvsZ0oAJeNqzCXj7hPJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OAOWNs1s5agnr7SuVhtFNcGCj2V/kJs6rFylGY8kjLU=; b=rbvmhcUMBJGeHsdXTWN/Jv0rsCkQ5cUY7oUsIg97Xk4Z7TmuMy7dFCrCQR8oPkSfM0qKEJXMBpBe/VyxpLLosLcp3WSA18uWgHwDnQbFe0OB1+pOpHZm/7hgEe+c8cZWqOWp+YJxeK137wYTZNCczZZ3wJuc1/71Oh2HElRzkTg= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB4288.namprd11.prod.outlook.com (52.135.37.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.20; Thu, 5 Dec 2019 09:54:08 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:54:08 +0000 From: To: Subject: [PATCH 15/16] crypto: atmel-aes - Use gcm helper to check authsize Thread-Topic: [PATCH 15/16] crypto: atmel-aes - Use gcm helper to check authsize Thread-Index: AQHVq1Hw4WjMrsbR9EK2AA7AYtclSQ== Date: Thu, 5 Dec 2019 09:54:08 +0000 Message-ID: <20191205095326.5094-16-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 47e624d2-3653-49f9-e6f4-08d77969128b x-ms-traffictypediagnostic: MN2PR11MB4288: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:404; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(189003)(199004)(6506007)(1076003)(305945005)(4326008)(2616005)(86362001)(478600001)(11346002)(14444005)(102836004)(107886003)(2906002)(50226002)(5660300002)(66446008)(66946007)(66476007)(66556008)(14454004)(1730700003)(64756008)(76176011)(8936002)(4744005)(52116002)(81166006)(186003)(5640700003)(81156014)(36756003)(71200400001)(71190400001)(54906003)(6512007)(316002)(6486002)(25786009)(8676002)(26005)(6916009)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4288; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zC03FiKmMEsbHSAAqagsf8JqoZkZY+J6IlwJXsW0vpYE/Bqy3yHM1cR00XyiuhYT0DVPNkvPiHBNzTjtlTZtKGfd4FQstXfw1gHODiutfW4kQUg+rsRryXBdIYGQSFTKtnIpRtTkgicX25wvyPwXcBoIY6WzAOnj7fRDrK5fkiMfcxf6wCqd/D7B4Ah/ARhFZO9PqTaetqP7C4LnRSiS14dsKLcpl3RNoFkcqMVjhLRXFUlybokOybH/MwZrDPQ+INfXofgROflr6Jf2a7nEHylAlFK+bUpn/8Puo9nOdsdyyGe5cWI8sMbZBVICZ5VMM7YNDcDMSuELdsDasKisosC0HmchQMSUGKgFYV3eHIkyF/P49ALE45dR7jWN5Hh12mxuYsbyGUelsCgpVWHFGRMo2cMeTXx1zQfkUm+02DOWl+VBlX576R85mKEGhaC7 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 47e624d2-3653-49f9-e6f4-08d77969128b X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:54:08.8208 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IQXUIhG9qk+xKMZzw16GLSghsks/Gyrb8c8OFbSXoHAxHFVQ7JAZLm1abNoDOr5hV9TnjkdKNIO0Yk4x3G1fDYZeGsjdoH9O5nuDsaRenqM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4288 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015412_492324_F1D5A154 X-CRM114-Status: UNSURE ( 7.73 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus Use core helper functions. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-aes.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 60f54580d646..18802c977291 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -1790,21 +1790,7 @@ static int atmel_aes_gcm_setkey(struct crypto_aead *tfm, const u8 *key, static int atmel_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) { - /* Same as crypto_gcm_authsize() from crypto/gcm.c */ - switch (authsize) { - case 4: - case 8: - case 12: - case 13: - case 14: - case 15: - case 16: - break; - default: - return -EINVAL; - } - - return 0; + return crypto_gcm_check_authsize(authsize); } static int atmel_aes_gcm_encrypt(struct aead_request *req) From patchwork Thu Dec 5 09:54:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 11274593 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBCF31593 for ; Thu, 5 Dec 2019 09:58:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8ED832464D for ; Thu, 5 Dec 2019 09:58:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lj7qN0jq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="eqTD8tZ/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8ED832464D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QVee1N//ukNRA5bfvDAfxX161bx9Sb5e9g6YBqDBbSk=; b=lj7qN0jqfngFUv YzR+hmZPMpdCze2gn2AizJ92RR+LlI1R5KQ6+R6vV8BTzf+LLNJ+JraIgO6cI4jyEgkj0ouIOFawW A1BTe+3KFFk9dfs9Tn1oFx+XTTZ5EsA8c4KTAO9GkTM4onppWQEGgsrIPwzcnE7wIEI/OzPSpKVPO 423oGN8e3+zzWH97cgCI+tk7f4ZOaIu8VI10gceeSbeKgkdIxUfilQz2zGcLZSzTSvTOO/Y8XyTrp EEmsQc3IPXDUFiUZuPZDxGh0u4LVfeagva1jyJqOXXBfVC8TpgRaoFIytO8tQU8SvH/Mu/OEmH+OY YWe2oORicCSE9V0UMf2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnuA-0000BO-I4; Thu, 05 Dec 2019 09:58:38 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnpu-0003JP-KO for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2019 09:54:17 +0000 Received-SPF: Pass (esa5.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa5.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa5.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: u/9sCziHZgaGjJ7pTSFsQb4Oo5wmAlpeDCDTtTAKpn+fdyy7YElT/NsKNBweS0oUUg+E/xz0fU 7yFsc3+/LfYU/bsSoc1CJFIvpYyWxMf4oVJKVZUYfhMqNQIh+FTGC2DHbA/bOXVLmd72rSO8mZ fq0TThSisNbXscHb6HI9GFYSSDxQVVRpCAoS/hIMnqnSgxzJsbbJ/lBdAwNllfHoPCpNnVrBmb d7iP9w6+AwNQS78Nj43TORSRBaoJA+tZgxP2WdyPtWhXQHQMf5HCM18eE4pmhiRP7QCz8ri4i+ vVg= X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="57907214" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2019 02:54:13 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 02:54:14 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 02:54:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N3k7ckOmBk8vSVy52zmGtwnjA/NXrNW//VtVrMtHjYtlgJmaFQeuHOMd+xpqMQQPZIPLymx5KQvuiaQxN3iyUVoXQquYf+m3kWhSdV2H1+4K5ycHm32n5Hzxa381pOua5GBvWcx6d+RpZq1ZIZ8xv+6eMYh7csnukYDKDmBuMtSLYtOxeU+VqD4EQUXZfQ2/mFPSmeNzyqWsALJ0XK3Ezztp7sRe3027qFvUeVlUvLDQFdkzkBQVhdfOXt14wS/sZYel1azkC9ekLu8nAgbZ4pV7XYFNGAiqFW4n27sHmzjzuVwT9BAJCuAIV0Pxi4i0pBaHeIf0U0jQw8Mirw9lAw== 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=31S7h+yxA9Ut53hiDOgLJ4EBGdjNO7I5oNVRxf+NHNU=; b=V151UDtLBli7RX0mhqYuvP+1WFDO106KSM3MCKNIgwojENpBM76lZoR2Ah0UEzvyu7KgDcEp/+zWQexGonuab9tP9v+WSc1fbDrt2A9c2gBm2tHLaKioTbLALPJa1Y12hgnfaNyX4Gco94QHuW2oapi7cr22ytSAwLaIyJRy2B/6FUW44FdPLGbdNqNfKk5n72U9k/OgXhdC8IUlEoDErpVUG1aApwSXX9X1LM8qXd2U7XJ8npvgPuOhoVL0UdVoNvubW66OS9GUTtCy7DWEVFr+RZ4y0po0LZVWeRRh2CNEvJuVXftcD6A8/ziHw23dfXb/Ciqiqe2LFmdAtEURaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=31S7h+yxA9Ut53hiDOgLJ4EBGdjNO7I5oNVRxf+NHNU=; b=eqTD8tZ/owL5oc7uwnozCrUMq6tBf9MBbbe0u173of4paD+eMwgwKHD6aUceGBAUwqjNEgfywPx7HPbUqWOQ0NevOpOW90lFAkAqyNmR/kdEcvEDH/9ldoEHTjwAzNJw0LFd3FcwCHzNSKgo16JuNQI3Rww7ZvvW7KrJflOUmR4= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB4288.namprd11.prod.outlook.com (52.135.37.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.20; Thu, 5 Dec 2019 09:54:10 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::84c:6e75:22df:cbc9%5]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 09:54:10 +0000 From: To: Subject: [PATCH 16/16] crypto: atmel-{aes,sha,tdes} - Group common alg type init in dedicated methods Thread-Topic: [PATCH 16/16] crypto: atmel-{aes,sha,tdes} - Group common alg type init in dedicated methods Thread-Index: AQHVq1HxV08z2q1qzUizBwqVxO+JTQ== Date: Thu, 5 Dec 2019 09:54:10 +0000 Message-ID: <20191205095326.5094-17-tudor.ambarus@microchip.com> References: <20191205095326.5094-1-tudor.ambarus@microchip.com> In-Reply-To: <20191205095326.5094-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a3ae047b-b0c2-4fe1-233d-08d779691388 x-ms-traffictypediagnostic: MN2PR11MB4288: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:843; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(189003)(199004)(6506007)(1076003)(305945005)(4326008)(2616005)(86362001)(478600001)(11346002)(102836004)(107886003)(2906002)(50226002)(5660300002)(66446008)(66946007)(66476007)(66556008)(14454004)(1730700003)(64756008)(76176011)(8936002)(52116002)(81166006)(186003)(5640700003)(81156014)(36756003)(71200400001)(71190400001)(54906003)(6512007)(316002)(6486002)(30864003)(25786009)(8676002)(26005)(6916009)(99286004)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4288; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3lxjIcR3YaVcgmf2KIN+EbJUCqsf0KnybRkphJskb24FOQ2PpPd9fjyPkydzeV5MQfDtCXI0Iz7vyaEXw+4YDQ2XMe6HIGKPSlHQNo/HzrcePc3wu8rJ2JVU14xaNTJqUa1xBxz3E+Qu9MVW3awF53PUFAOOkUWNA2hsoi+InbJYQUNe0LEM8+DrmT88uqpcqHncYyVUftsvR4PHhsZdNSlxLqWHe1yG3R5YHxnIn62PIob+MyZhpoN0AN+b9Lp1vE3FdfNwXKywTrYaXflQU1wLs8pME687/gCzn22TzuF00eqhY4dkzcP30nvYZmnE3sFJC2zn/CDA4fDJSzYJTUr1WURraCTBO+ZK/p+bGvnrJ02BI7JSm5DR2OwK+CzuuFXQBE3ES3IQAWRpmf9UyeDREH1ZtKDXvMksyYhZ/QuXzgYRfjnLSloMFJ1sTDr5y0C9xEGmzENIqSIFYtWMQ+1UXev7Vr21wyJ31VIXmB0T0ceACJBWCiwWWZH9uTnu MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a3ae047b-b0c2-4fe1-233d-08d779691388 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 09:54:10.4149 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eXyCPXQ24UVe2QQT4uk2wlWfLBcHZnZ+eRZjK7ge0eT8K4h+a/y6XnHHCDzOqN56+K7LbzsYm0YjrXpIEncbVYEReOL428deydm3A/JsUSI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4288 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_015414_780584_CA686D92 X-CRM114-Status: UNSURE ( 6.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor.Ambarus@microchip.com, linux-kernel@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tudor Ambarus Move common alg type init to dedicated methods. Signed-off-by: Tudor Ambarus --- drivers/crypto/atmel-aes.c | 82 ++++++++++----------------------------------- drivers/crypto/atmel-sha.c | 45 +++++++++---------------- drivers/crypto/atmel-tdes.c | 39 +++++---------------- 3 files changed, 42 insertions(+), 124 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 18802c977291..d96759357d03 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -1289,12 +1289,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "ecb(aes)", .base.cra_driver_name = "atmel-ecb-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = AES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1306,12 +1302,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "cbc(aes)", .base.cra_driver_name = "atmel-cbc-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = AES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1324,12 +1316,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "ofb(aes)", .base.cra_driver_name = "atmel-ofb-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = AES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1342,12 +1330,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "cfb(aes)", .base.cra_driver_name = "atmel-cfb-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = AES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1360,12 +1344,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "cfb32(aes)", .base.cra_driver_name = "atmel-cfb32-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB32_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1378,12 +1358,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "cfb16(aes)", .base.cra_driver_name = "atmel-cfb16-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB16_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1396,12 +1372,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "cfb8(aes)", .base.cra_driver_name = "atmel-cfb8-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB8_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1414,12 +1386,8 @@ static struct skcipher_alg aes_algs[] = { { .base.cra_name = "ctr(aes)", .base.cra_driver_name = "atmel-ctr-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = 1, .base.cra_ctxsize = sizeof(struct atmel_aes_ctr_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_ctr_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1434,12 +1402,8 @@ static struct skcipher_alg aes_algs[] = { static struct skcipher_alg aes_cfb64_alg = { .base.cra_name = "cfb64(aes)", .base.cra_driver_name = "atmel-cfb64-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB64_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .init = atmel_aes_init_tfm, .min_keysize = AES_MIN_KEY_SIZE, @@ -1825,12 +1789,8 @@ static struct aead_alg aes_gcm_alg = { .base = { .cra_name = "gcm(aes)", .cra_driver_name = "atmel-gcm-aes", - .cra_priority = ATMEL_AES_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = 1, .cra_ctxsize = sizeof(struct atmel_aes_gcm_ctx), - .cra_alignmask = 0xf, - .cra_module = THIS_MODULE, }, }; @@ -1947,12 +1907,8 @@ static int atmel_aes_xts_init_tfm(struct crypto_skcipher *tfm) static struct skcipher_alg aes_xts_alg = { .base.cra_name = "xts(aes)", .base.cra_driver_name = "atmel-xts-aes", - .base.cra_priority = ATMEL_AES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = AES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_aes_xts_ctx), - .base.cra_alignmask = 0xf, - .base.cra_module = THIS_MODULE, .min_keysize = 2 * AES_MIN_KEY_SIZE, .max_keysize = 2 * AES_MAX_KEY_SIZE, @@ -2252,12 +2208,8 @@ static struct aead_alg aes_authenc_algs[] = { .base = { .cra_name = "authenc(hmac(sha1),cbc(aes))", .cra_driver_name = "atmel-authenc-hmac-sha1-cbc-aes", - .cra_priority = ATMEL_AES_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_aes_authenc_ctx), - .cra_alignmask = 0xf, - .cra_module = THIS_MODULE, }, }, { @@ -2272,12 +2224,8 @@ static struct aead_alg aes_authenc_algs[] = { .base = { .cra_name = "authenc(hmac(sha224),cbc(aes))", .cra_driver_name = "atmel-authenc-hmac-sha224-cbc-aes", - .cra_priority = ATMEL_AES_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_aes_authenc_ctx), - .cra_alignmask = 0xf, - .cra_module = THIS_MODULE, }, }, { @@ -2292,12 +2240,8 @@ static struct aead_alg aes_authenc_algs[] = { .base = { .cra_name = "authenc(hmac(sha256),cbc(aes))", .cra_driver_name = "atmel-authenc-hmac-sha256-cbc-aes", - .cra_priority = ATMEL_AES_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_aes_authenc_ctx), - .cra_alignmask = 0xf, - .cra_module = THIS_MODULE, }, }, { @@ -2312,12 +2256,8 @@ static struct aead_alg aes_authenc_algs[] = { .base = { .cra_name = "authenc(hmac(sha384),cbc(aes))", .cra_driver_name = "atmel-authenc-hmac-sha384-cbc-aes", - .cra_priority = ATMEL_AES_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_aes_authenc_ctx), - .cra_alignmask = 0xf, - .cra_module = THIS_MODULE, }, }, { @@ -2332,12 +2272,8 @@ static struct aead_alg aes_authenc_algs[] = { .base = { .cra_name = "authenc(hmac(sha512),cbc(aes))", .cra_driver_name = "atmel-authenc-hmac-sha512-cbc-aes", - .cra_priority = ATMEL_AES_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_aes_authenc_ctx), - .cra_alignmask = 0xf, - .cra_module = THIS_MODULE, }, }, }; @@ -2469,29 +2405,45 @@ static void atmel_aes_unregister_algs(struct atmel_aes_dev *dd) crypto_unregister_skcipher(&aes_algs[i]); } +static void atmel_aes_crypto_alg_init(struct crypto_alg *alg) +{ + alg->cra_flags = CRYPTO_ALG_ASYNC; + alg->cra_alignmask = 0xf; + alg->cra_priority = ATMEL_AES_PRIORITY; + alg->cra_module = THIS_MODULE; +} + static int atmel_aes_register_algs(struct atmel_aes_dev *dd) { int err, i, j; for (i = 0; i < ARRAY_SIZE(aes_algs); i++) { + atmel_aes_crypto_alg_init(&aes_algs[i].base); + err = crypto_register_skcipher(&aes_algs[i]); if (err) goto err_aes_algs; } if (dd->caps.has_cfb64) { + atmel_aes_crypto_alg_init(&aes_cfb64_alg.base); + err = crypto_register_skcipher(&aes_cfb64_alg); if (err) goto err_aes_cfb64_alg; } if (dd->caps.has_gcm) { + atmel_aes_crypto_alg_init(&aes_gcm_alg.base); + err = crypto_register_aead(&aes_gcm_alg); if (err) goto err_aes_gcm_alg; } if (dd->caps.has_xts) { + atmel_aes_crypto_alg_init(&aes_xts_alg.base); + err = crypto_register_skcipher(&aes_xts_alg); if (err) goto err_aes_xts_alg; @@ -2500,6 +2452,8 @@ static int atmel_aes_register_algs(struct atmel_aes_dev *dd) #if IS_ENABLED(CONFIG_CRYPTO_DEV_ATMEL_AUTHENC) if (dd->caps.has_authenc) { for (i = 0; i < ARRAY_SIZE(aes_authenc_algs); i++) { + atmel_aes_crypto_alg_init(&aes_authenc_algs[i].base); + err = crypto_register_aead(&aes_authenc_algs[i]); if (err) goto err_aes_authenc_alg; diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index a620a6a1cee3..a91612c94755 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -1267,12 +1267,9 @@ static struct ahash_alg sha_1_256_algs[] = { .base = { .cra_name = "sha1", .cra_driver_name = "atmel-sha1", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA1_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), .cra_alignmask = 0, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_cra_init, } } @@ -1291,12 +1288,9 @@ static struct ahash_alg sha_1_256_algs[] = { .base = { .cra_name = "sha256", .cra_driver_name = "atmel-sha256", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), .cra_alignmask = 0, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_cra_init, } } @@ -1317,12 +1311,9 @@ static struct ahash_alg sha_224_alg = { .base = { .cra_name = "sha224", .cra_driver_name = "atmel-sha224", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA224_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), .cra_alignmask = 0, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_cra_init, } } @@ -1343,12 +1334,9 @@ static struct ahash_alg sha_384_512_algs[] = { .base = { .cra_name = "sha384", .cra_driver_name = "atmel-sha384", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA384_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), .cra_alignmask = 0x3, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_cra_init, } } @@ -1367,12 +1355,9 @@ static struct ahash_alg sha_384_512_algs[] = { .base = { .cra_name = "sha512", .cra_driver_name = "atmel-sha512", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA512_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_ctx), .cra_alignmask = 0x3, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_cra_init, } } @@ -2099,12 +2084,9 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha1)", .cra_driver_name = "atmel-hmac-sha1", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA1_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), .cra_alignmask = 0, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_hmac_cra_init, .cra_exit = atmel_sha_hmac_cra_exit, } @@ -2124,12 +2106,9 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha224)", .cra_driver_name = "atmel-hmac-sha224", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA224_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), .cra_alignmask = 0, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_hmac_cra_init, .cra_exit = atmel_sha_hmac_cra_exit, } @@ -2149,11 +2128,8 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha256)", .cra_driver_name = "atmel-hmac-sha256", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), - .cra_alignmask = 0, .cra_module = THIS_MODULE, .cra_init = atmel_sha_hmac_cra_init, .cra_exit = atmel_sha_hmac_cra_exit, @@ -2174,12 +2150,9 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha384)", .cra_driver_name = "atmel-hmac-sha384", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA384_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), .cra_alignmask = 0, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_hmac_cra_init, .cra_exit = atmel_sha_hmac_cra_exit, } @@ -2199,12 +2172,9 @@ static struct ahash_alg sha_hmac_algs[] = { .base = { .cra_name = "hmac(sha512)", .cra_driver_name = "atmel-hmac-sha512", - .cra_priority = ATMEL_SHA_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = SHA512_BLOCK_SIZE, .cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx), .cra_alignmask = 0, - .cra_module = THIS_MODULE, .cra_init = atmel_sha_hmac_cra_init, .cra_exit = atmel_sha_hmac_cra_exit, } @@ -2556,17 +2526,28 @@ static void atmel_sha_unregister_algs(struct atmel_sha_dev *dd) } } +static void atmel_sha_ahash_alg_init(struct ahash_alg *alg) +{ + alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC; + alg->halg.base.cra_priority = ATMEL_SHA_PRIORITY; + alg->halg.base.cra_module = THIS_MODULE; +} + static int atmel_sha_register_algs(struct atmel_sha_dev *dd) { int err, i, j; for (i = 0; i < ARRAY_SIZE(sha_1_256_algs); i++) { + atmel_sha_ahash_alg_init(&sha_1_256_algs[i]); + err = crypto_register_ahash(&sha_1_256_algs[i]); if (err) goto err_sha_1_256_algs; } if (dd->caps.has_sha224) { + atmel_sha_ahash_alg_init(&sha_224_alg); + err = crypto_register_ahash(&sha_224_alg); if (err) goto err_sha_224_algs; @@ -2574,6 +2555,8 @@ static int atmel_sha_register_algs(struct atmel_sha_dev *dd) if (dd->caps.has_sha_384_512) { for (i = 0; i < ARRAY_SIZE(sha_384_512_algs); i++) { + atmel_sha_ahash_alg_init(&sha_384_512_algs[i]); + err = crypto_register_ahash(&sha_384_512_algs[i]); if (err) goto err_sha_384_512_algs; @@ -2582,6 +2565,8 @@ static int atmel_sha_register_algs(struct atmel_sha_dev *dd) if (dd->caps.has_hmac) { for (i = 0; i < ARRAY_SIZE(sha_hmac_algs); i++) { + atmel_sha_ahash_alg_init(&sha_hmac_algs[i]); + err = crypto_register_ahash(&sha_hmac_algs[i]); if (err) goto err_sha_hmac_algs; diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index d10be95a6470..6bb9d48379a2 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -928,12 +928,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ecb(des)", .base.cra_driver_name = "atmel-ecb-des", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x7, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES_KEY_SIZE, @@ -945,12 +942,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cbc(des)", .base.cra_driver_name = "atmel-cbc-des", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x7, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES_KEY_SIZE, @@ -963,12 +957,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb(des)", .base.cra_driver_name = "atmel-cfb-des", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x7, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES_KEY_SIZE, @@ -981,12 +972,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb8(des)", .base.cra_driver_name = "atmel-cfb8-des", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB8_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES_KEY_SIZE, @@ -999,12 +987,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb16(des)", .base.cra_driver_name = "atmel-cfb16-des", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB16_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x1, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES_KEY_SIZE, @@ -1017,12 +1002,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cfb32(des)", .base.cra_driver_name = "atmel-cfb32-des", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = CFB32_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x3, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES_KEY_SIZE, @@ -1035,12 +1017,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ofb(des)", .base.cra_driver_name = "atmel-ofb-des", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x7, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES_KEY_SIZE, @@ -1053,12 +1032,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ecb(des3_ede)", .base.cra_driver_name = "atmel-ecb-tdes", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x7, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES3_EDE_KEY_SIZE, @@ -1070,12 +1046,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "cbc(des3_ede)", .base.cra_driver_name = "atmel-cbc-tdes", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x7, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES3_EDE_KEY_SIZE, @@ -1088,12 +1061,9 @@ static struct skcipher_alg tdes_algs[] = { { .base.cra_name = "ofb(des3_ede)", .base.cra_driver_name = "atmel-ofb-tdes", - .base.cra_priority = ATMEL_TDES_PRIORITY, - .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = DES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct atmel_tdes_ctx), .base.cra_alignmask = 0x7, - .base.cra_module = THIS_MODULE, .init = atmel_tdes_init_tfm, .min_keysize = DES3_EDE_KEY_SIZE, @@ -1165,11 +1135,20 @@ static void atmel_tdes_unregister_algs(struct atmel_tdes_dev *dd) crypto_unregister_skcipher(&tdes_algs[i]); } +static void atmel_tdes_skcipher_alg_init(struct skcipher_alg *alg) +{ + alg->base.cra_flags = CRYPTO_ALG_ASYNC; + alg->base.cra_priority = ATMEL_TDES_PRIORITY; + alg->base.cra_module = THIS_MODULE; +} + static int atmel_tdes_register_algs(struct atmel_tdes_dev *dd) { int err, i, j; for (i = 0; i < ARRAY_SIZE(tdes_algs); i++) { + atmel_tdes_skcipher_alg_init(&tdes_algs[i]); + err = crypto_register_skcipher(&tdes_algs[i]); if (err) goto err_tdes_algs;