lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 24 Mar 2013 15:37:05 +0100
From:	Lubomir Rintel <lkundrak@...sk>
To:	Stephen Warren <swarren@...dotorg.org>
Cc:	linux-kernel@...r.kernel.org, Matt Mackall <mpm@...enic.com>,
	linux-rpi-kernel@...ts.infradead.org
Subject: Re: [PATCH] hw_random: Add Broadcom BCM2835 RNG Driver

On Fri, 2013-03-22 at 20:44 -0600, Stephen Warren wrote:

Thank you for your response!

> On 03/22/2013 06:55 AM, Lubomir Rintel wrote:
> > Signed-off-by: Lubomir Rintel <lkundrak at v3.sk>
> 
> A commit description would be useful.
> 
> >  arch/arm/boot/dts/bcm2835.dtsi       |    5 +
> >  arch/arm/configs/bcm2835_defconfig   |    3 +-
> >  drivers/char/hw_random/Kconfig       |   12 +++
> >  drivers/char/hw_random/Makefile      |    1 +
> >  drivers/char/hw_random/bcm2835-rng.c |  137 ++++++++++++++++++++++++++++++++++
> 
> This should be split into 3 separate patches: (1) The driver itself, (2)
> the change to bcm2835.dtsi, and (3) the change to bcm2835_defconfig.
> 
> Since you're adding a new device to device tree for the first time, you
> should write a binding document for it; most likely
> Documentation/devicetree/bindings/rng/brcm,bcm2835.txt (or perhaps
> /random/ rather than /rng/?)

Okay. I'm tempted to stick to "rng" instead of "random" as it seems more 
consistent to me, but I don't have a strong reason to back it with. What would 
be a good reason for using "random"?

> Is this driver based on the downstream Raspberry Pi kernel's driver? If
> so, some mention of that fact would be appropriate in the commit
> description, or even the git author field. I note that in the downstream
> kernel, the commit which adds the RNG driver isn't signed off at all.
> This probably means you need to get Dom to add his signed-off-by line
> for that commit before basing your work on it. See
> Documentation/SubmittingPatches for more details.

Ok, will try to.

I'll still follow up with an updated patch, so that it can be reviewed.

> > diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
> 
> > + * Redistribution and use in source and binary forms, with or without
> ...
> > + * ALTERNATIVELY, this software may be distributed under the terms of the
> > + * GNU General Public License ("GPL") version 2, as published by the Free
> > + * Software Foundation.
> 
> I am not a lawyer, but I'd be tempted to exercise that right, and
> distribute this patch solely under the terms of the GPLv2, and hence
> remove the other license. It's not a big deal, but it'd simplify the
> licensing in the upstream kernel.

Will do.

> > +static int bcm2835_rng_read(struct hwrng *rng, void *buf, size_t max,
> > +			       bool wait)
> 
> > +	while ((__raw_readl(rng_base + RNG_STATUS)>>24) == 0) {
> 
> You'd usually put spaces around the >>.

Will be fixed.

> > +static int bcm2835_rng_probe(struct platform_device *op)
> 
> "pdev" is a more typical name than "op".

Will be adjusted.

> > +{
> > +	struct device *dev = &op->dev;
> > +	struct device_node *np = dev->of_node;
> > +	void __iomem *rng_base;
> > +	int err;
> > +
> > +	/* map peripheral */
> > +	rng_base = of_iomap(np, 0);
> > +	if (WARN(!rng_base, "failed to remap rng regs"))
> > +		return -ENODEV;
> 
> The WARN() doesn't seem necessary. dev_err() inside the if{} would be
> more appropriate,

Makes sense, will be adjusted.

> > +static struct platform_driver bcm2835_rng_driver = {
> ...
> > +};
> > +
> > +module_platform_driver(bcm2835_rng_driver);
> 
> Typically, no blank line there.

Ok

> > +MODULE_AUTHOR("Lubomir Rintel <lkundrak at v3.sk>");
> > +MODULE_DESCRIPTION("BCM2835 Random Number Generator (RNG) driver");
> > +MODULE_LICENSE("GPL and additional rights");
> 
> I think that should be "GPLv2 and ...".

Ok

-- 
Lubomir Rintel <lkundrak@...sk>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists