Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3980697pxv; Mon, 26 Jul 2021 17:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj/LUfDn06wa/wNupI3+HzNl6UWf28OVLORfr0R/1PKF+kQEw58k0LibaU82w94tLkV++l X-Received: by 2002:a05:6602:2099:: with SMTP id a25mr16857301ioa.143.1627345939711; Mon, 26 Jul 2021 17:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627345939; cv=none; d=google.com; s=arc-20160816; b=Qi5rJRecx4tU5Sru9k9QFWvvJCemHfhGWnbX2k0Vbf2FCzZW4wuR5HpGyFZcG8bVqI lQituoEybKFZQ5zH0AFfrm+seEjKEsg4uuuq4ztjgoPbWrttA5BBOvAZgUn0mMUhX+YR QCdWZtTJ3QdVd9ddMnKntsqcZ/3/movSGx5Gx3z6xUiU0VoTcFjwsch82sJ6pQQyzZzK +wwJ9BkMiXvuKx2kWzvmJ7Eva+kq/o/AwmmObdH/1Ngnt3MTcK/YNBVUFm82FkpDREo6 Qfr0RmnGo4ir4kmedIYpTKXdFxFNo9fiKSK9WyrPTSKZxzURQ68KcKeRycseZPtMhwoP uhxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=QWpFRdGr7QDr/yX4a2lapJj7PH/zhsLfXrFth9gtfz0=; b=CRgQiKHjqrO0Ue+dF5fCS8SO4cng2lELgO5u9EBcHqrBHNrpYffibIkiBO1SwtHUXH iweLbgt+Egh72db4GUzalm5RSxKBXyPKRFSVsHLohqYegdcEd4/5teObJn0+LTM8JIF/ uAeA6eLdAxwjc3QNIYibG/BBqxEH8AU0AahL7HDWsD3TB4uyNsbDK0uTSMDxex0Hry57 16odyZhGsKBapWitIuXy6PE2EawZdz0iaByYJRxPMjepTJ9LLAgzUTwvAux0pqWxD7n8 sdruE103BOyCHEyuupJcOAVgGZYTdkcbMAe7mWA3sDfy6vduUWozcNn2yhVTG0c7bXAN RPGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t18si1526669ilf.96.2021.07.26.17.31.55; Mon, 26 Jul 2021 17:32:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234415AbhGZXu1 (ORCPT + 99 others); Mon, 26 Jul 2021 19:50:27 -0400 Received: from foss.arm.com ([217.140.110.172]:60690 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233843AbhGZXuZ (ORCPT ); Mon, 26 Jul 2021 19:50:25 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7BBD61FB; Mon, 26 Jul 2021 17:30:53 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 991933F73D; Mon, 26 Jul 2021 17:30:51 -0700 (PDT) Date: Tue, 27 Jul 2021 01:30:04 +0100 From: Andre Przywara To: Mark Brown Cc: Matt Mackall , Herbert Xu , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Ard Biesheuvel , Will Deacon , Ali Saidi , Jon Nettleton Subject: Re: [PATCH v3 2/2] hwrng: Add Arm SMCCC TRNG based driver Message-ID: <20210727013004.4caca28f@slackpad.fritz.box> In-Reply-To: <20210726223738.GM4670@sirena.org.uk> References: <20210726175610.3311-1-andre.przywara@arm.com> <20210726175610.3311-3-andre.przywara@arm.com> <20210726223738.GM4670@sirena.org.uk> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, 26 Jul 2021 23:37:38 +0100 Mark Brown wrote: > On Mon, Jul 26, 2021 at 06:56:10PM +0100, Andre Przywara wrote: > > > +static int smccc_trng_init(struct hwrng *rng) > > +{ > > + return 0; > > +} > > If this can be empty (looking at the core it seems like it can) then > best just remove it. Ah, you are right! Actually this is explicitly mentioned in the struct hwrng comments. Thanks for the heads up. > > > + platform_set_drvdata(pdev, trng); > > + ret = devm_hwrng_register(&pdev->dev, trng); > > + if (!ret) > > + dev_info(&pdev->dev, > > + "ARM SMCCC TRNG firmware random number generator\n"); > > Is the log message needed given that we're not announcing any version > information here or anything? A brief sampling of other drivers > suggests it's not a standard thing for the subsystem. Yeah, that was indeed more a leftover of the version print. I thought about querying the version again explicitly, but this would have brought back the SMCCC calls that I could so nicely delete. Plus, the hwrng driver is just a (secondary) user of this interface, I think announcing the version should be done in smccc.c. Which is probably beyond the scope of this patch. Now thinking about this, there would probably be some value in making the TRNG UUID somehow available, as this can be used to identify flawed implementations (general problems in the hardware or backend bugs). But this should be some query-able interface, rather than some line in dmesg. Any ideas? Might be beyond the scope of this series, though... Cheers, Andre