All of lore.kernel.org
 help / color / mirror / Atom feed
From: Torben Hohn <torbenh@linutronix.de>
To: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	tglx@linutronix.de, bigeasy@linutronix.de,
	linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: RT and omap-gpio irqchip with DeviceTree
Date: Tue, 2 Jul 2013 16:31:30 +0200	[thread overview]
Message-ID: <20130702143130.GC27329@localhost.localdomain> (raw)
In-Reply-To: <CAAwP0s2KUCowe5scWJtiZ8hZb-5EMbmef_WO_03cY3H7DqxSOQ@mail.gmail.com>

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

On Tue, Jul 02, 2013 at 02:15:46PM +0200, Javier Martinez Canillas wrote:
> + Grant, Linus W and Jean-Christophe.
> 
> On Tue, Jul 2, 2013 at 1:44 PM, Torben Hohn <torbenh@linutronix.de> wrote:
> >
> > Hi..
> >
> > I am running into Problems with a network adapter IRQ connected to an
> > omap-gpio pin.
> >
> > omap-gpio expects gpio-request() to be called before i can use the pin.
> > But this is abstracted via the DeviceTree bindings.
> >
> > I see 8d4c277e185c31359cf70573d8b0351fb7dd0dfe in mainline.
> > This one just puts a warning into the exact place, i am dealing with.
> > But i need to make this work, instead of bailing out.
> >
> 
> This has been discussed extensively on the linux-omap mailing list and
> the agreement is that it has to be handled by the IRQ core. So when a
> GPIO line is mapped in the IRQ domain with irq_create_of_mapping(),
> the core has to take care to request the GPIO and configure it as
> input.

Can you give me a pointer to this discussion please ?
Because i fail to understand why you just dont save the irq_type in some
private data structure, and then use chip->irq_enable() or something.


> 
>  But until we have this general solution we have to do it on a per irq
> chip driver basis and the less hack-ish solution is to have a custom
> .map function handler that request the GPIO used as IRQ.
> 
> There is already a patch [1] queued in Linus Walleij linux-gpio tree
> [2] for-next branch that implements this for OMAP GPIO. It would be
> great if you can test it and give feedback.

Thanks for the pointer.
The kernel i am working on is based on 3.8.x (this is before the
irq_domain change to linear)

First i only backported: [1] and [2]

With these i see big streams like these:
[    1.554809] omap_gpio gpio.9: Could not request GPIO-256
[    1.560394] omap_gpio gpio.9: Could not request GPIO-255
[    1.566009] omap_gpio gpio.9: Could not request GPIO-254
[    1.571594] omap_gpio gpio.9: Could not request GPIO-253
[    1.577178] omap_gpio gpio.9: Could not request GPIO-252
[    1.582794] omap_gpio gpio.9: Could not request GPIO-251

This is basically coming from irq_domain_add_legacy() which calls
ops->map(domain, irq, hwirq) before the gpio chip is actually added.

I fixed it by also taking [3].

However, OMAP1 is still calling irq_domain_add_legacy(). This would
probably break with DeviceTree. 
But since omap1 doesnt use DeviceTree, this is probably a non-issue.

[1] https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=570c4bb53366157fa076922d0fc7e7adfd81cf42
[2] https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=50fc1d067d9f4b6c99717b91c1aaaa618075f859
[3] https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=ede4d7a5b9835510fd1f724367f68d2fa4128453


-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 421 5650 2310 ; Fax.: +49 7556 919 886
mailto: torbenh@linutronix.de
Firmensitz / Registered Office: D-88690 Uhldingen, Auf dem Berg 3
Registergericht / Local District Court: Freiburg i. Br., HRB Nr. / Trade
register no.: 700 806;

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2013-07-02 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 11:44 RT and omap-gpio irqchip with DeviceTree Torben Hohn
2013-07-02 12:15 ` Javier Martinez Canillas
2013-07-02 14:31   ` Torben Hohn [this message]
2013-07-02 15:51     ` Javier Martinez Canillas

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=20130702143130.GC27329@localhost.localdomain \
    --to=torbenh@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=martinez.javier@gmail.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=tglx@linutronix.de \
    /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.