[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1246068883.10360.367.camel@brutus>
Date: Fri, 26 Jun 2009 23:14:43 -0300
From: Daniel Ribeiro <drwyrm@...il.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@...mlogic.co.uk>,
linux-kernel <linux-kernel@...r.kernel.org>,
Eric Miao <eric.y.miao@...il.com>,
David Brownell <david-b@...bell.net>,
Pierre Ossman <pierre@...man.eu>,
openezx-devel <openezx-devel@...ts.openezx.org>,
linux-arm-kernel <linux-arm-kernel@...ts.arm.linux.org.uk>
Subject: Re: [PATCHv2 2/2] PCAP regulator driver (for 2.6.32)
Em Sáb, 2009-06-27 às 02:04 +0100, Mark Brown escreveu:
> > + if (vreg->n_voltages == 1)
> > + return -EINVAL;
>
> It'd be a little more friendly to check if the supported voltage is in
> the requested range. However, that'd only be an issue if constraints
> allowed voltage changes which is obviously broken so a comment to that
> effect would be enough. I wouldn't have mentioned it but...
Ok, I will add a comment.
> > + ezx_pcap_read(pcap, vreg->reg, &tmp);
> > + tmp |= (1 << vreg->en);
> > + ezx_pcap_write(pcap, vreg->reg, tmp);
>
> This read/modify/write cycle is racy; the individual regulator is locked
> by the core but this register is shared between all regulators on the
> chip so if two are being updated at once things will go wrong. Most of
> the MFDs have a set_bits() function that does an atomic read/modify/write
> cycle for cases like this.
Good point, thanks! :)
--
Daniel Ribeiro
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists