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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 7 Jul 2015 14:32:33 +0200
From:	Boris Brezillon <boris.brezillon@...e-electrons.com>
To:	Mark Brown <broonie@...nel.org>
Cc:	Lee Jones <lee.jones@...aro.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] mfd: atmel-hlcdc: implement write synchronization

Hi Mark,

On Tue, 7 Jul 2015 13:22:58 +0100
Mark Brown <broonie@...nel.org> wrote:

> On Wed, Jun 24, 2015 at 03:12:33PM +0100, Lee Jones wrote:
> > Mark,
> > 
> > Can you take a look at this please?
> > 
> > Does it subvert any of the neat regmap functionality that you'd get
> > otherwise?
> 
> Please don't ask questions like this off list unless there is a great
> reason to, doing that means that other people can't help and that people
> with the same people won't be able to search the list for the answer.
> 
> > > Some HLCDC registers cannot be written until the previous write access has
> > > been synchronized with the hardware. If they are written while a
> > > synchronization is in progress, the new value (and the associated
> > > configuration) might be silently ignored, resulting in unpredictable
> > > behavior.
> 
> > > Hide the write synchronization stuff in a regmap implementation and use
> > > this implementation instead of the generic mmio one.
> 
> The above makes it sound like we're just waiting for the write to be
> posted (usually forced by doing a read or something) but...

Does that mean I should reword the description ...

> 
> > > +static int regmap_atmel_hlcdc_reg_write(void *context, unsigned int reg,
> > > +					unsigned int val)
> > > +{
> > > +	void __iomem *regs = context;
> > > +
> > > +	if (reg <= ATMEL_HLCDC_DIS) {
> > > +		u32 status;
> > > +
> > > +		readl_poll_timeout(regs + ATMEL_HLCDC_SR, status,
> > > +				   !(status & ATMEL_HLCDC_SIP), 1, 100);
> > > +	}
> > > +
> > > +	writel(val, regs + reg);
> 
> ...this is polling for some bit to be set.  That's not very common at
> all and not something that the framework supports.

... and keep the implementation as proposed here ?
Or should I had this kind of behavior to the core infrastructure ?

Best Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ