mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: "Mike Frysinger" <vapier.adi@gmail.com>
Cc: "Bryan Wu" <bryan.wu@analog.com>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org,
	"Michael Hennerich" <michael.hennerich@analog.com>
Subject: Re: [PATCH 02/12] Blackfin arch: Add label to call new GPIO API
Date: Fri, 17 Aug 2007 13:09:25 -0700	[thread overview]
Message-ID: <200708171309.25529.david-b@pacbell.net> (raw)
In-Reply-To: <8bd0f97a0708171245j74e856e0uce009de16c00f517@mail.gmail.com>

On Friday 17 August 2007, Mike Frysinger wrote:
> On 8/17/07, David Brownell <david-b@pacbell.net> wrote:
> > ...
> > Just for the record, this is an unusual way to use these calls.
> >
> > Other platforms completely decouple these issues from the
> > IRQ infrastructure ... doing the pinmux and gpio claiming
> > separately from the request_irq()/free_irq() paths, mostly
> > as part of board setup.  Doing all of that "early":
> >
> >  - keeps those error returns from causing hard-to-track-down
> >    runtime bugs;
> >
> >  - works always, even on platforms where a given IRQ may
> >    appear on any of several pins/balls;
> >
> >  - makes it easier to cross-check against board schematics,
> >    by keeping most board-specific setup in one source file;
> >
> >  - shrinks the kernel's runtime footprint;
> >
> >  - allows the label to be more descriptive ... describeing
> >    exactly *which* IRQ, so that using the labels for better
> >    diagnostics actually gives better diagnostics.
> >
> > Again, not "wrong"; but probably sub-optimal.  You might
> > want to move towards earlier binding now, while Linux is
> > still young on Blackfin and you don't have legacy code to
> > worry about.
> 
> in the Blackfin port, if you want to use a pin as an IRQ rather than
> GPIO, you use the normal request_irq/free_irq API ... those functions
> will call back into the proper GPIO/PORTMUX code so that the pin is
> setup properly.  this is done so that code isnt duplicated across
> files and so that we can easily detect if someone does something
> incorrect like try to take the same pin and use it as
> irq/gpio/whatever at the same time ...
> 
> are you saying that other ports dont unify the backend code paths at all ?

Some platforms try to "unify" the pin setup in the boot loader.
Most of them cope with bogus bootloaders by doing it in the board
setup code.

I don't know of any who try to do it "late" as you summarized.

See above why "late" unification is not necessarily as good as
"early" unification.

And then there's the OMAP1 example, where for example you might
know that you want MPUIO-0 but that's insufficient to tell whether
you must mux ball F18 or R13 ... so it's impossible to do the kind
of "late" unification done here, and pinmux *MUST* be separate from
IRQ setup.

- Dave



  reply	other threads:[~2007-08-17 20:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08  3:35 [PATCH 00/12] Blackfin arch GPIO updating Bryan Wu
2007-08-08  3:35 ` [PATCH 01/12] Blackfin arch: add peripheral resource allocation support Bryan Wu
2007-08-17 18:12   ` David Brownell
2007-08-08  3:35 ` [PATCH 02/12] Blackfin arch: Add label to call new GPIO API Bryan Wu
2007-08-17 18:24   ` David Brownell
2007-08-17 19:45     ` Mike Frysinger
2007-08-17 20:09       ` David Brownell [this message]
2007-08-17 20:19         ` Mike Frysinger
2007-08-17 20:21           ` Mike Frysinger
2007-08-17 21:15           ` David Brownell
2007-08-17 21:53     ` Robin Getz
2007-08-17 22:34       ` David Brownell
2007-08-18 19:07         ` Robin Getz
2007-08-19 21:54           ` David Brownell
2007-08-20  1:55             ` Robin Getz
2007-08-20  3:41               ` David Brownell
2007-08-08  3:35 ` [PATCH 03/12] Blackfin arch: fix PORT_J BUG for BF537/6 EMAC driver Bryan Wu
2007-08-08  3:35 ` [PATCH 04/12] Blackfin arch: Finalize the generic gpio support - add gpio_to_irq and irq_to_gpio Bryan Wu
2007-08-08  3:35 ` [PATCH 05/12] Blackfin arch: Advertise GENERIC_GPIO and remove duplicated GENERIC_CALIBRATE_DELAY Bryan Wu
2007-08-08  3:35 ` [PATCH 06/12] Blackfin arch: Add PORT_J.High (needed for BF548-EZkit Touchscreen interrupts) - remove PORT_C.H Bryan Wu
2007-08-08  3:35 ` [PATCH 07/12] Blackfin arch: bug fixing, add missing BF533_FAMILY GPIO_PFx definition Bryan Wu
2007-08-08  3:35 ` [PATCH 08/12] Blackfin arch: add missing gpio error handling to make sure we roll back requests in case one fails Bryan Wu
2007-08-08  3:35 ` [PATCH 09/12] Blackfin arch: scrub remaining ASSEMBLY usage since the switch to __ASSEMBLY__ Bryan Wu
2007-08-08  3:35 ` [PATCH 10/12] Blackfin arch: update platform driver resource information to the ezkitBF548 board file Bryan Wu
2007-08-08  3:35 ` [PATCH 11/12] Blackfin arch: after removing fs.h from mm.h, fix the broken on Blackfin arch Bryan Wu
2007-08-08  3:35 ` [PATCH 12/12] Blackfin serial driver: use new GPIO API Bryan Wu
2007-08-17 17:29   ` David Brownell
2007-08-17 20:25 [PATCH 02/12] Blackfin arch: Add label to call " Hennerich, Michael
2007-08-17 21:29 ` David Brownell
2007-08-17 22:02 Hennerich, Michael

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=200708171309.25529.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@linux-foundation.org \
    --cc=bryan.wu@analog.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vapier.adi@gmail.com \
    /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

Powered by JetHome