lkml.org 
[lkml]   [2009]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCHv2 2/2] PCAP regulator driver (for 2.6.32)
From
Date
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2009-06-27 04:17    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site