Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp545159iog; Wed, 29 Jun 2022 05:39:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vVcpCwB9MYq8jUwNnWS7GiaASGYh4Iscl3ug+bdw3gPAUFNxskAEyEYLBnP4qN6qyZHolk X-Received: by 2002:aa7:c38c:0:b0:435:8013:41e7 with SMTP id k12-20020aa7c38c000000b00435801341e7mr4009564edq.206.1656506372355; Wed, 29 Jun 2022 05:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656506372; cv=none; d=google.com; s=arc-20160816; b=haS97uhoX7hu+k6v1fZaH3FyPf3IY5UIPcztfZw2VUTVmHYovlcoQ5qr4YTZVOwTx1 14G2CeAstHDA50XJH3Y/8ypGeg4y2QKN1x7wLYilOepJDqSuHsKb9TzhgXOHt2/iMbL2 objAsD9rce6s9iUxczQgSc/QwOFuBpeD+YRnVUmuXnJvWVypJsX4mwOtwQ9S42hOeWSf YonnAn36eF4fAZFa6TAVCqHVOhPRCJTm4+JI86MtYi9xDKEjNiEx+u+4Nh80z0soWduu tauDjEcZsFwju0a3Mzw4Kj03NWDabVTTxLLBP4sSozn0vdAIBaAqD+OT9BhUPZcFC9H1 D2fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DT+Hg4MXkKGN3iF9yrZOwKd7X9E+dCZfidIy8wnPVhs=; b=AiCmhP/HVOOBRuMUk8yzmNuNMqmLGT1LmkDsv4pJ/uPFrmd7zKXrzzgWWo3/4//eSD U1CSyv04ufaPg1WLNMsB8RRTXnJk9xtz943croBOMQJoxS+bhQGgX+EQUKuFDZJ/BqBU QsleJ9eKo7MWUgsrCUaXeUYyxogI3uroBl1G4chbGxm9lIOp7iC2sMoFc5Wnn35I0fD1 DM/ZVarpL4s4mTOXyqdkNEUP7RvkQUNzwGBduufZ1f5fez5qzJRfaSs8GHSril4BNMUq x/bFFPXjnM8s9p19rnZI+32TtfQwi4xNMK0/eqT2FZFQIp8jv3lC1TVRYd5s2NCAx9lI ppVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=F8o1gvCH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr30-20020a1709073f9e00b0072402ea9647si3369792ejc.891.2022.06.29.05.38.57; Wed, 29 Jun 2022 05:39: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=@gmail.com header.s=20210112 header.b=F8o1gvCH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232464AbiF2Mg0 (ORCPT + 99 others); Wed, 29 Jun 2022 08:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231887AbiF2MgZ (ORCPT ); Wed, 29 Jun 2022 08:36:25 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1C4928714; Wed, 29 Jun 2022 05:36:24 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id i205-20020a1c3bd6000000b003a03567d5e9so112274wma.1; Wed, 29 Jun 2022 05:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=DT+Hg4MXkKGN3iF9yrZOwKd7X9E+dCZfidIy8wnPVhs=; b=F8o1gvCHUO0AaSUw95FBfODVx1rKjGucblSlLnK9kzaYfE4z45hG7/Q/0KjOurXk7k Z70esZYM27OhUOpxpekDkWnIItmpXDhFpQWwzMoeE0IBXwAC9ybEhCSq8q93QYitDjWK zgR4KYeevxyii1mwwruDTmr820y2WMFmVm43a6vTqkK1gI+CHQR0yidq+jmyqYIuY7nz 8cRigmOgNQB5dVOh5+9QQPMh60cfzuHbfmuguEKDD5O8fBQ7MrH/cWNHZsYfGhbh3owv bEtgGvWqCJDRDrN2FskGip5MmzN9dyyDEw8ezYCegOSw94JvExbdz76QyIJ+Dbr2kKkA jneA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=DT+Hg4MXkKGN3iF9yrZOwKd7X9E+dCZfidIy8wnPVhs=; b=Br3tCtxtUcLj53gRoQLh9UYTjaZcv56TsRBCsl6eX2b9IVhLWK6TfCQ/PYO39WAYn4 b7GBRnid+5OdS7EMKor2XFtKyvbhdgdrTBZ0l9IA2wu+3K4xnIfEZNC01acm1QOI65qr 8EIXikUGUfqplGRB0ePy6onoPTisk8RDyMMvV04QuAyi7qkLIEOG8bDb9oBqVES8tu7L ki/WFEdk1p3cvyieu0KE7pefEffUGf75CMdYy+MDfsCzbdTVj5HscsX6tdiPK1vGyH5x xOCG2PHEH8oaU7c0xSSftAYcWJ5gr13ftUZt2D8bAyGVP8pSThdE1xLWAC7RqfiW9Hrw yrNQ== X-Gm-Message-State: AJIora+CWEnzLwYasI8V9I/l11qyOt3BxmEjZux+HsdJs2IDIZXFb/3I uxiA9w8eI24P/+oMEJSj7iQ= X-Received: by 2002:a7b:c003:0:b0:39c:5642:e415 with SMTP id c3-20020a7bc003000000b0039c5642e415mr5312894wmb.111.1656506183225; Wed, 29 Jun 2022 05:36:23 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id e9-20020a5d4e89000000b0021a3a87fda9sm16658872wru.47.2022.06.29.05.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 05:36:22 -0700 (PDT) Date: Wed, 29 Jun 2022 14:36:20 +0200 From: Corentin Labbe 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-SW@aspeedtech.com Subject: Re: [PATCH v6 1/5] crypto: aspeed: Add HACE hash driver Message-ID: References: <20220629094426.1930589-1-neal_liu@aspeedtech.com> <20220629094426.1930589-2-neal_liu@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220629094426.1930589-2-neal_liu@aspeedtech.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Le Wed, Jun 29, 2022 at 05:44:22PM +0800, Neal Liu a ?crit : > 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 > --- Hello I have some minor comments below. > +++ 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 Hello why not direclty use dev_dbg ? You will still need something to do to enable dev_dbg, so why force to add the need to re-compile it with ASPEED_AHASH_DEBUG ? [...] > + if (dma_mapping_error(hace_dev->dev, rctx->digest_dma_addr)) { > + dev_warn(hace_dev->dev, "dma_map() rctx digest error\n"); > + return -ENOMEM; > + } An error displayed as warning. [...] > + if (!sg_len) { > + dev_warn(hace_dev->dev, "dma_map_sg() src error\n"); Same here. In fact you have lot of error displayed as warning in the driver. [...] > +/* 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__); > +} Why not use dev_warn ? [...] > +struct aspeed_sg_list { > + u32 len; > + u32 phy_addr; > +}; Since it is a descriptor where all member are written with cpu_to_le32(), it should be __le32. Regards