[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <412a4da61063b8c8a72729f03c06480c5f1374fb.camel@pengutronix.de>
Date: Mon, 23 Mar 2020 15:56:19 +0100
From: Rouven Czerwinski <r.czerwinski@...gutronix.de>
To: Hadar Gat <hadar.gat@....com>, Matt Mackall <mpm@...enic.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Alexander Sverdlin <alexander.sverdlin@...ia.com>,
Thomas Gleixner <tglx@...utronix.de>,
Tomer Maimon <tmaimon77@...il.com>,
Randy Dunlap <rdunlap@...radead.org>,
Zaibo Xu <xuzaibo@...wei.com>,
Daniel Thompson <daniel.thompson@...aro.org>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: linux-crypto@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Gilad Ben-Yossef <gilad@...yossef.com>,
Ofir Drang <ofir.drang@....com>
Subject: Re: [PATCH v5 2/3] hw_random: cctrng: introduce Arm CryptoCell
driver
Hello Hadar,
On Sun, 2020-03-22 at 17:31 +0200, Hadar Gat wrote:
> Introduce low level Arm CryptoCell TRNG HW support.
>
> Signed-off-by: Hadar Gat <hadar.gat@....com>
> ---
> drivers/char/hw_random/Kconfig | 12 +
> drivers/char/hw_random/Makefile | 1 +
> drivers/char/hw_random/cctrng.c | 735
> ++++++++++++++++++++++++++++++++++++++++
> drivers/char/hw_random/cctrng.h | 69 ++++
> 4 files changed, 817 insertions(+)
> create mode 100644 drivers/char/hw_random/cctrng.c
> create mode 100644 drivers/char/hw_random/cctrng.h
>
> [...]
> +static int cctrng_probe(struct platform_device *pdev)
> +{
> + struct resource *req_mem_cc_regs = NULL;
> + struct cctrng_drvdata *drvdata;
> + struct device *dev = &pdev->dev;
> + int rc = 0;
> + u32 val;
> + int irq;
> +
> + drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
> + if (!drvdata)
> + return -ENOMEM;
> +
> + drvdata->rng.name = devm_kstrdup(dev, dev_name(dev),
> GFP_KERNEL);
> + if (!drvdata->rng.name)
> + return -ENOMEM;
> +
> + drvdata->rng.read = cctrng_read;
> + drvdata->rng.priv = (unsigned long)drvdata;
You are not initializing drvdata->rng.quality to a default value, which
results in the TRNG not being used by the kernel by default. If its a
perfect TRNG this should be set to 1024, i.e. 1024 bits of entropy per
1024 bits of input.
Regards,
Rouven Czerwinski
Powered by blists - more mailing lists