linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@sirena.org.uk>
To: David Brownell <david-b@pacbell.net>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
	lkml <linux-kernel@vger.kernel.org>,
	OMAP <linux-omap@vger.kernel.org>
Subject: Re: [patch 2.6.29-rc7 regulator-next] regulator: refcount fixes
Date: Fri, 13 Mar 2009 01:38:15 +0000	[thread overview]
Message-ID: <20090313013813.GK24376@sirena.org.uk> (raw)
In-Reply-To: <200903121602.55570.david-b@pacbell.net>

On Thu, Mar 12, 2009 at 03:02:55PM -0800, David Brownell wrote:
> On Thursday 12 March 2009, Mark Brown wrote:

> > Previously the per-consumer reference count would've meant that they
> > couldn't interfere with other consumers - they could set their own
> > state but not reverse an enable something else had done.

> They still can't ... *unless* they're already buggy.

As previously noted they could've worked happily via bouncing their
state to match the physical state first; it's not nice or a good idea
(which is why I am happy with your patch) but, well, not everyone pays
attention to warnings and errors :(

> And, as a new thing not currently addressed well in code, you
> are talking about "non-shared" handles.

You are missing my point here; this is mostly about documentation.  The
exclusive access issue is with devices that can't tolerate any
arbitration and need the regulator to go into the state they're
requesting - if the consumer is finding itself doing something like turn
off a regulator which it did not enable itself then it's clearly not
able to play nicely with other drivers sharing the same resource without
extra communication.  This may be because the driver is doing things
that aren't really appropriate and perhaps ought to be done via
constraints if at all; it may also be because the hardware that's being
controlled demands it.

If everyone is nice and careful about what they're doing it'll not make
any difference at all either way.  Especially in the hardware
requirements case I'd hope it never even comes up that it'd make a
difference.

> One could as easily have "handle" and "regulator" be the
> same ... so the get/put idioms could work like they do
> elsewhere in the kernel.

I really don't see that there is any meaningful difference here; from
the point of view of the consumer the fact that the thing it gets back
is a handle to a structure the core uses to keep track of the consumer
rather than the underlying hardware object is an implementation detail
that shouldn't make any difference to them.  In terms of the programming
model it seems like a layering violation to know the difference between
one opaque structure and another.

> See above.  Currently constraints are hidden for "consumers",
> behind functional accessors like regulator_set_voltage().
> There are no explicit constraint objects, as there are for
> the machines.

The current interface has been driven by the needs of the users: the
majority of consumers want to do one operation on a regular basis -
normally that's enable/disable, most devices are just powering
themselves up and down, though for some things voltage changes are much
more common (DVFS being the prime example).  Overall it's been fairly
similar to the clock API in terms of usage pattern.

In terms of looking at redesigning the API I feel we're getting ahead of
ourselves here and should be working more for stability until we run
into problems that force us to make big changes.  Right now it seems
better to focus on improving the support for real systems in mainline
and addressing any issues that they see so that we've got something to
learn from when doing any redesign and can minimise the amount of
integration churn that is created.

  reply	other threads:[~2009-03-13  1:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12  0:43 [patch 2.6.29-rc7 regulator-next] regulator: refcount fixes David Brownell
2009-03-12  2:32 ` [patch 2.6.29-rc7 regulator-next] regulator: init fixes David Brownell
2009-03-12 12:01   ` Mark Brown
2009-03-15  0:25     ` [patch 2.6.29-rc8 regulator-next] regulator: init fixes (v4) David Brownell
2009-03-15  0:37       ` Mark Brown
2009-03-15  4:05         ` David Brownell
2009-03-16 21:54           ` Mark Brown
2009-03-17 18:15             ` David Brownell
2009-03-17 20:08               ` Mark Brown
2009-03-18 19:25                 ` David Brownell
2009-03-18 20:33                   ` Mark Brown
2009-03-18 21:02                     ` David Brownell
2009-03-19 19:27                       ` Mark Brown
2009-03-18 21:14                     ` David Brownell
2009-03-19 16:59                       ` Mark Brown
2009-03-15  4:16     ` [patch 2.6.29-rc7 regulator-next] regulator: init fixes David Brownell
2009-03-12 10:37 ` [patch 2.6.29-rc7 regulator-next] regulator: refcount fixes Mark Brown
2009-03-12 20:35   ` David Brownell
2009-03-12 21:05     ` Mark Brown
2009-03-12 23:02       ` David Brownell
2009-03-13  1:38         ` Mark Brown [this message]
2009-03-14 21:29           ` David Brownell
2009-03-15  0:30             ` Mark Brown
2009-03-15  4:27               ` David Brownell
2009-03-12 10:56 ` Liam Girdwood

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=20090313013813.GK24376@sirena.org.uk \
    --to=broonie@sirena.org.uk \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).