All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Ribeiro <drwyrm@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Eric Miao <eric.y.miao@gmail.com>,
	David Brownell <david-b@pacbell.net>,
	Pierre Ossman <pierre@ossman.eu>,
	openezx-devel <openezx-devel@lists.openezx.org>,
	linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: [PATCHv2 2/2] PCAP regulator driver (for 2.6.32)
Date: Fri, 26 Jun 2009 23:14:43 -0300	[thread overview]
Message-ID: <1246068883.10360.367.camel@brutus> (raw)
In-Reply-To: <20090627010434.GC4379@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

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

[-- Attachment #2: Esta é uma parte de mensagem assinada digitalmente --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

      reply	other threads:[~2009-06-27  2:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26 23:08 [PATCHv2 2/2] PCAP regulator driver (for 2.6.32) Daniel Ribeiro
2009-06-27  1:04 ` Mark Brown
2009-06-27  2:14   ` Daniel Ribeiro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1246068883.10360.367.camel@brutus \
    --to=drwyrm@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=david-b@pacbell.net \
    --cc=eric.y.miao@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=openezx-devel@lists.openezx.org \
    --cc=pierre@ossman.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.