Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp156492iog; Wed, 29 Jun 2022 20:42:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sH/EetfUEjwjCMExZXJSEwCGRO1enNrkahjm1hkWGxvBy/B1gt7QnzwbR8DvzAnrU0JMvE X-Received: by 2002:a17:906:51db:b0:722:ea9b:ff9e with SMTP id v27-20020a17090651db00b00722ea9bff9emr6784640ejk.16.1656560552057; Wed, 29 Jun 2022 20:42:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656560552; cv=pass; d=google.com; s=arc-20160816; b=wUAXs7HvMXFlgdsp2+lgHRHOg0X2s/Sjh0e4NDGFfdOpSQKzgnkkioPKCOLTH5gUZG AmCnDWs036jAPS2bbfXh3Ot5GspotDJXYm7NxbJmVAp4UmFjZkruZjmd9M39mrHcXJHu 2pneBOdb9UWPNFczqg/G3ZfXEOSlwyi5djrhvgUDZJgQpT+86IOlm9Njy20jjT4Q9jbO rtyKSSAC/4CQW6SBl+WKU6lEGRwaVT6dlaJ69fKMVfxqeuCFvSs+ZEv1HSfclBtjb+ka y4/ifrwFKloFYjoqsQSInETnetTADYb9a6McLIoadpVONij9k8DuAMDEntgkJiKxkrCm pmnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=pYbz24zNXymM/92xBJSvZDm00omWxHA5DIbQVHCmkCA=; b=lrplROv4RHR6G23lARLJP4ghDTr1IKMFkEDBqC2oONlC8KUh/2YPOilmYKdK/AbkHf FTgXOq1JTzUVJsuxs9PBUG/3bYo1QBpdUvXjLvJzG+f52WWL9w9+KW/vez66MfJ1KMCW 3yIESkMrblrHwyJVXTMtfaiPrNtjB+HCrAYS3kLu8IeXwAgbGFxOXF4J5y0zyptaG3IE /oV4j9QoPWsOt1C9VKnweEsGphjLvzuw1j5+hZzKKHzHZHF6UVN+1s9VyK8Gv1nN5A4S 0fnodzszl0dgzhAj8zcQ46jA6JpwR2UhuDF4UlrCtn392OrJcVy3fOFZk8z7zeVLzOHv fsrw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b="TyE/twKK"; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a50d794000000b004355e63f6a3si21532980edi.530.2022.06.29.20.42.04; Wed, 29 Jun 2022 20:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b="TyE/twKK"; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbiF3DmD (ORCPT + 99 others); Wed, 29 Jun 2022 23:42:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiF3DmC (ORCPT ); Wed, 29 Jun 2022 23:42:02 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2100.outbound.protection.outlook.com [40.107.215.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80DB21E3D0; Wed, 29 Jun 2022 20:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AUJUhDCl8rai0W5w+gGPvLmEC5EHsUdWxrkAPD2acB9SqGOtF7di2KXFmC3CKv+OY3kfbaco7Sno7+xxqnnmT5hzX1qwGUPGEVlSY4tX/wB9eOxXD6LrsxTa9FvHE/w4VxCI5hRqmPHl04aCww4pKdkMZ9uU5iKdF8c7H/21cT7hxVX2bK/0Zk3bmy2YiZJS3vc0AlphjDf7Fwdiyb9ecbEmXHDyFjlK8C5yhWBV1Q+az3TRw3zJ4tu5IjREYfX0AkP4UpCo343/NbOhWFsX8D6GQNI6o62UIpLPPlS8jjDvw8dLIDJGijla4CrSdjEOEp3Oow6/1BsYj9ZacJyrgw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pYbz24zNXymM/92xBJSvZDm00omWxHA5DIbQVHCmkCA=; b=ZFGZ5gK7Zm8MwWGG7xFy3EQGMa5XUXcLX9bw2h4d2v2zhJOf4V2tajAw6aWBuQN4gjy9axdXs/Z6UYOTGb1UO/5t52vduSk0b0nZ23jEJOvBuFEp5bZvJV1oqQ9kT5bOCwz9XDi6usBa4AHkT2NXvRL76nifKQF7jwVr0buaJxBFuiH58xmsZcj3LIpvvlLE0bCt0kt8UkJOdZx8EjZVvnNTl3elu3qVfXn5W7FSOjhoK2WGqsgd6Sn5xO8cf6f+upNSYYGQuoMpFyBHNfofJdMEAvFZ6jsmgtF24azH37TjFgfMHsolE0LMKs4U4IHAQmfb71HzpyMyan091UM6lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pYbz24zNXymM/92xBJSvZDm00omWxHA5DIbQVHCmkCA=; b=TyE/twKKqRmEvZK2Mv3kcFpGeS8ZMJRPg0xIAaWaTz+1WdDwQZ8uW2/VaQzUCfC4t3/OXjrTrbD/rDpHhmpjgp1Fpvzseh6iE2LT/RVXtX6yu3hl60TOieTo4X2OTdKnmfsNv+G8OgHulevr4boqEUI8EXhBlQB2qMuRTysp3ICZAxnID8XpP7RLiRHBKQyrmY7dxItnjZRnkjNJgxmSOnrLpOGilbVB43qJoDl//cHLFpuBTcTlTzf6Vb+WEC6nnHnGAtaeCTCLAHoWbQrPuMtMPTf4ta3iYHI3EjuKr4FERHbYQSxID5BnzWSNIt+ul1AomX7B1J99iAmsSOc4lw== Received: from HK0PR06MB3202.apcprd06.prod.outlook.com (2603:1096:203:87::17) by PS2PR06MB3480.apcprd06.prod.outlook.com (2603:1096:300:5f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Thu, 30 Jun 2022 03:41:52 +0000 Received: from HK0PR06MB3202.apcprd06.prod.outlook.com ([fe80::46d:a7a:f047:e9bf]) by HK0PR06MB3202.apcprd06.prod.outlook.com ([fe80::46d:a7a:f047:e9bf%5]) with mapi id 15.20.5373.018; Thu, 30 Jun 2022 03:41:52 +0000 From: Neal Liu To: Corentin Labbe CC: Christophe JAILLET , Randy Dunlap , Herbert Xu , "David S . Miller" , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Dhananjay Phadke , Johnny Huang , "linux-aspeed@lists.ozlabs.org" , "linux-crypto@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , BMC-SW Subject: RE: [PATCH v6 1/5] crypto: aspeed: Add HACE hash driver Thread-Topic: [PATCH v6 1/5] crypto: aspeed: Add HACE hash driver Thread-Index: AQHYi5zYXJWayYu9tEOgJTXDveSSAa1mUnEAgAD7PSA= Date: Thu, 30 Jun 2022 03:41:52 +0000 Message-ID: References: <20220629094426.1930589-1-neal_liu@aspeedtech.com> <20220629094426.1930589-2-neal_liu@aspeedtech.com> In-Reply-To: Accept-Language: en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e52e0802-4509-4c59-c346-08da5a4a78d0 x-ms-traffictypediagnostic: PS2PR06MB3480:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i0AfZFUXG1DhuQU6KI3gn5fv000bqYWNK5QtZ01W/57JjhsrZyaQNObPmz3EE0oR8gwTUUuB8qWxL1+/n+4jDjP8eYdCL1JU6Blj5AUo4I1zNMVuSXN4ASSwrqTgZnWVPhatyMRDm8IGZ7UIQc9DhNK+mdviz+8dWrKMP+qbs/GqmvVL0aMtp+xq/2ByzVgBE/O7HRvLnRb4jW+5rRCIzqVzqTTrb1GN/0r4aDY6wD3vxdIGnTI4DOJXaJBKzje+Z4R3M3f1gM4woOGIrcgWtsFFx+Nloze1b23IovNchsW0++byKuuoD0mJizwceQ96CdyumJpvq8JNoKEdCg/rTKCi8dfIy4paTzz+UJGGc++OORUDx2Rlaz5JJ/cA0+ZtOFwBFIEdImUal84g4PyP1ZlrTJjUUCz3QKpDSxRzhoPqrLAiFq9x8vRNmQ9oomfYXTgA/sWaf0+QubiX0zLvkwOmOzfzkkjHWhL3t/YFxoalreHkK6lwYO6oHWZfed7dbs2wc23A08vWtYM/VKxJ0WQbSw0iWwtIikmX0JUHHu19ZXFxrc/cS39/fsN3iGffBsOOfQ90WQJX3edWOGChjxFJoUbRrg97632a8pITluqjoOjp83DyrOauvRneYnTFvzp53SQY2xZZkXCgFd4bOdU42e1nKeXHQo714DVsBFXgy5Le5BmvvRAbDpxiSiAVV34L7AHC8nm4YRyz3fRCloobwegwJU9oSm9Gxx1t0FLfnZx5sXXmja19BmABd3EyPQ0sJWV5+404Nwsv9qce0wf1zU78Niw+n9Gw8+efTfocMT8f58sD5tNRC6SVC6fV x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HK0PR06MB3202.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39840400004)(346002)(366004)(136003)(396003)(376002)(66446008)(186003)(71200400001)(8676002)(4326008)(41300700001)(66574015)(64756008)(66556008)(66946007)(9686003)(76116006)(107886003)(66476007)(26005)(6916009)(54906003)(7416002)(38100700002)(5660300002)(83380400001)(478600001)(33656002)(53546011)(86362001)(6506007)(55016003)(316002)(122000001)(7696005)(2906002)(38070700005)(52536014)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?iG6ID0hiH2y87Bg/tFX1Afgn9gv1s2zU38z+5kndrXoaQHxgdRB5PhAisd?= =?iso-8859-1?Q?YUG/ANHurhgfiCy430fG5YIduq1KKk35IJ7x2lOHo+2sKNcbHW3tOtb64y?= =?iso-8859-1?Q?9/sCmoOM3Rw7qNYTVP4/UyYd18RrLOOwlUpCvCrymh5AxNWLvARfmjKn3Y?= =?iso-8859-1?Q?w5orWiJrnCSQxFR5kiUEmjVe60W5Y9ROuZsU7JNuiyySDQFRZ2Wa/oeuIx?= =?iso-8859-1?Q?UG8Hmy0Dgn8aeTg3l7jW7eg3pWynaBGtXibYdTrRmPpzv460QBw3TLzgv2?= =?iso-8859-1?Q?8/CAUzIUOB7pNjVppJj1YC5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G?= =?iso-8859-1?Q?0ay7wV5gYv7jxrIpjkTTzPPpRo9kWpI67XpKMuUuuiL6qJXTeNOtyoctge?= =?iso-8859-1?Q?2fS3+38DUk6I725VWGPm3RHl8ut4SFIhIUcNSe/SgW6QgAevmU7K+UyPrw?= =?iso-8859-1?Q?bgYZ62JO0DCB3dvej5uXdFQYZMmpYiBx+Zf1rJ+VEeok4L/HxdXYS+e6sp?= =?iso-8859-1?Q?evGA3vArQDh0SbEsAMF2VXVFCgLTCMNTusTM9uRJxnJCdDcFC4YMsaESjI?= =?iso-8859-1?Q?Ju88n3aMyMc2Ms8j3adGddKFcL/avo6cX6NXXmF7bAE7RfGLgSzgNxHwDg?= =?iso-8859-1?Q?7qrnvxPJfChXhuwgQsu6Hh9fAfiMz/ymwZNnJmntUsvku0mISzzQh/hxKp?= =?iso-8859-1?Q?tvTCANyNccJAlU4Z+OSmRf5Vj/GrhHUalVB3zfez3bBEjdc1HWlQ1Lz9uZ?= =?iso-8859-1?Q?pzGXPAgE72IesNS5tVD3i6ZxT3GK8h5OlN?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: HK0PR06MB3202.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e52e0802-4509-4c59-c346-08da5a4a78d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jun 2022 03:41:52.6748 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: I3i3GcsxSrbtOKNqvgB1U556vdbOvW60EfVtFkL7DkqsBZtu7lKI8/+7f2IxcNUuP9e6ghArqbN2dknaowpYtg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS2PR06MB3480 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org > -----Original Message----- > From: Corentin Labbe > Sent: Wednesday, June 29, 2022 8:36 PM > To: Neal Liu > Cc: Christophe JAILLET ; Randy Dunlap > ; Herbert Xu ; David > S . Miller ; Rob Herring ; > Krzysztof Kozlowski ; Joel Stanley > ; Andrew Jeffery ; Dhananjay Phadke > ; Johnny Huang > ; linux-aspeed@lists.ozlabs.org; > linux-crypto@vger.kernel.org; devicetree@vger.kernel.org; > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; BMC-S= W > > Subject: Re: [PATCH v6 1/5] crypto: aspeed: Add HACE hash driver >=20 > Le Wed, Jun 29, 2022 at 05:44:22PM +0800, Neal Liu a =E9crit : > > Hash and Crypto Engine (HACE) is designed to accelerate the throughput > > of hash data digest, encryption, and decryption. > > > > Basically, HACE can be divided into two independently engines > > - Hash Engine and Crypto Engine. This patch aims to add HACE hash > > engine driver for hash accelerator. > > > > Signed-off-by: Neal Liu > > Signed-off-by: Johnny Huang > > --- >=20 > Hello >=20 > I have some minor comments below. >=20 > > +++ b/drivers/crypto/aspeed/aspeed-hace-hash.c > > @@ -0,0 +1,1428 @@ > > +// SPDX-License-Identifier: GPL-2.0+ > > +/* > > + * Copyright (c) 2021 Aspeed Technology Inc. > > + */ > > + > > +#include "aspeed-hace.h" > > + > > +#ifdef ASPEED_AHASH_DEBUG > > +#define AHASH_DBG(h, fmt, ...) \ > > + dev_dbg((h)->dev, "%s() " fmt, __func__, ##__VA_ARGS__) #else > > +#define AHASH_DBG(h, fmt, ...) \ > > + ((void)(h)) > > +#endif >=20 > Hello why not direclty use dev_dbg ? > You will still need something to do to enable dev_dbg, so why force to ad= d the > need to re-compile it with ASPEED_AHASH_DEBUG ? My purpose is to control its own debug logs independently. Maybe below define is more reasonable. #ifdef ASPEED_AHASH_DEBUG #define AHASH_DBG dev_info()... #else #define AHASH_DBG dev_dbg()... #endif Do you agree with this? >=20 >=20 > [...] >=20 > > + if (dma_mapping_error(hace_dev->dev, rctx->digest_dma_addr)) { > > + dev_warn(hace_dev->dev, "dma_map() rctx digest error\n"); > > + return -ENOMEM; > > + } >=20 > An error displayed as warning. >=20 > [...] > > + if (!sg_len) { > > + dev_warn(hace_dev->dev, "dma_map_sg() src error\n"); >=20 > Same here. In fact you have lot of error displayed as warning in the driv= er. I think both of them are fine. Would you prefer dev_err() instead? >=20 > [...] > > +/* Weak function for HACE hash */ > > +void __weak aspeed_register_hace_hash_algs(struct aspeed_hace_dev > > +*hace_dev) { > > + pr_warn("%s: Not supported yet\n", __func__); } > > + > > +void __weak aspeed_unregister_hace_hash_algs(struct aspeed_hace_dev > > +*hace_dev) { > > + pr_warn("%s: Not supported yet\n", __func__); } >=20 > Why not use dev_warn ? dev_warn() is better, I'll revise it in next patch. >=20 >=20 > [...] >=20 > > +struct aspeed_sg_list { > > + u32 len; > > + u32 phy_addr; > > +}; >=20 > Since it is a descriptor where all member are written with cpu_to_le32(),= it > should be __le32. Sure! I'll revise it in next patch. Thanks.