All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: David Brownell <david-b@pacbell.net>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpiolib: implement dynamic base allocation
Date: Thu, 6 Mar 2008 04:02:24 +0300	[thread overview]
Message-ID: <20080306010224.GA25717@zarina> (raw)
In-Reply-To: <200803051540.57499.david-b@pacbell.net>

On Wed, Mar 05, 2008 at 03:40:57PM -0800, David Brownell wrote:
> On Wednesday 05 March 2008, Andrew Morton wrote:
> > On Tue, 4 Mar 2008 20:03:07 +0300
> > Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> > 
> > > If gpio_chip->base is negative during registration, gpiolib requests
> > > dynamic base allocation. This is useful for devices being registered
> > > at run-time (in contrast to platform devices).
> > > 
> > > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > > ---
> > >  drivers/gpio/gpiolib.c |   42 ++++++++++++++++++++++++++++++++++++------
> > >  1 files changed, 36 insertions(+), 6 deletions(-)
> > > 
> > 
> > This conflicts in non-trivial ways with gpio-define-gpio_is_valid.patch. 
> > Could you please redo and retest against 2.6.25-rc3-mm1?

No problem, will rebase.

> And when you do that, could you make it assign GPIO numbers from
> the biggest number on down, instead of from the smallest on up?
> 
> Platforms normally assign those numbers from the bottom up ... so
> dynamic assignment should try to avoid reusing any numbers that may
> have been explicitly assigned, but not yet registered.  (Of course,
> if you can come up with a cleaner solution than that, it'd be great.
> Maybe platforms should also be able to mark ranges as "in use" as
> they start up, or something.)

Well, it is also trivial to implement gpiochip_reserve(start, end)
function that will mark reserved gpio->chip as ERR_PTR(-EACCESS),
and these ranges will be unavailable for the dynamic allocation.

Then, platforms could do gpiochip_reserve(0, GPIO_ARCH_END).
I think This is good solution from all and every POV, but this
needs a bit of platform code assistance.

What would you choice?

> And please add a pr_debug level message reporting dynamically
> assigned ranges.  That way, when problems crop up it'll be that
> much easier to notice what went wrong.

Will do.

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

      reply	other threads:[~2008-03-06  1:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 17:03 [PATCH] gpiolib: implement dynamic base allocation Anton Vorontsov
2008-03-05 23:24 ` Andrew Morton
2008-03-05 23:40   ` David Brownell
2008-03-06  1:02     ` Anton Vorontsov [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=20080306010224.GA25717@zarina \
    --to=cbouatmailru@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=avorontsov@ru.mvista.com \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    /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.