linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <martinez.javier@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Shilimkar, Santosh" <santosh.shilimkar@ti.com>,
	Alexander Holler <holler@ahsoftware.de>,
	ext Tony Lindgren <tony@atomide.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Kevin Hilman <khilman@linaro.org>,
	Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
	Jon Hunter <jgchunter@gmail.com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Enric Balletbo Serra <eballetbo@gmail.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	Florian Vaussard <florian.vaussard@epfl.ch>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	"Krishnamoorthy, Balaji T" <balajitk@ti.com>
Subject: Re: [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT
Date: Sun, 28 Jul 2013 19:33:08 +0200	[thread overview]
Message-ID: <CAAwP0s18ouM7wMm=dGCbWzukf-ikpB+yarNO5d2OZLjuQei8eA@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdbqpQ81o9b-wswNKxcDznL+o7pZy9n-8fFr67Kkrkm+1g@mail.gmail.com>

Hello,

Being the author of these patches I'm ashamed that they are causing a
regression. I did my best to make sure that it would work on OMAP1 and
OMAP2+ platforms booting with both legacy board files and DT.

Also, I didn't come with this solution in a vacuum. This was deeply
discussed with Jon Hunter, Grant Likely, Jean-Christophe
PLAGNIOL-VILLARD and others on a 90+ emails linux-omap thread [1] and
over IRC in #linaro-kernel channel.

The final agreement was that 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.

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.

Now, this assumes that irq_create_of_mapping() will always be called
for all GPIO lines that are going to be used as an IRQ. But this
doesn't seem to be true for the omap_hsmmc driver when the "cd-gpios"
mmc property is used in the omap-mmc device node.

I'm ok if you decide to revert these patches but I think we should do
it with care and be sure that the assumption that a IRQ-GPIO mapping
can happen without an explicit call to irq_create_of_mapping() is
actually true and this is not and issue in the omap_hsmmc driver or
its DT bindings.

According to Documentation/devicetree/bindings/mmc/mmc.txt:

cd-gpios: Specify GPIOs for card detection, see gpio binding

So it just says that it is a GPIO for card detection and not an IRQ so
this assumption comes from either the omap_hsmmc driver or Alexander'
DTS is missing something like:

                interrupt-parent = <&gpio6>;
                interrupts = <16 8>;

which will call irq_create_of_mapping() and the mapping for the
GPIO-IRQ will be created, thus making

irq = gpio_to_irq(gpio);
request[_threaded]_irq(irq, ...);

to succeed.

On Sun, Jul 28, 2013 at 6:29 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Sun, Jul 28, 2013 at 4:37 PM, Shilimkar, Santosh
> <santosh.shilimkar@ti.com> wrote:
>
>> I think the default OMAP DT files will continue to work with
>>  these patches applied and mostly doesn't break anything
>> in default configuration.
>
> What does "mostly" mean? Hm hm. OK I feel a little
> bit better about this now...
>

I think Santosh meant that

$ grep cd-gpios arch/arm/boot/dts/omap*

doesn't find any usage of the cd-gpios property so that's why this
issue was not found on my tests.

>> Ofcourse with the DT modification as done
>> by Alexander will expose the issue.
>
> So this is all caused by non-upstream code or
> non-upstream DTS files?
>

It seems so, I'm not familiar with the omap_hsmmc so I'm not sure if
this issue is with Alexander DTS, the omap_hsmmc driver or my
assumption that irq_create_of_mapping() will always be called for GPIO
mapped as IRQ is wrong.

>> I really wanted to have the auto request GPIO supported
>> when used as IRQ line but surely not at expense of
>> breaking the client drivers.
>
> If things are working for the default DTS files in the
> kernel then I am OK with it.
>

It's working with the default DTS afaict. At least I didn't find any
regression with my tests using an OMAP3 and OMAP4 boards and neither
did Enric whose tested-by I have in the patches.

> However moving forward to support the cases that
> Alexander is highlighting, I really really thin we need
> to put the information about taken GPIOs "input-hogs"
> into the gpio DT node.
>

I do agree with you that this information should be added to the DT to
prevent this kind of issues.

> Yours,
> Linus Walleij
> --

Hope this helps...

Thanks a lot and best regards,
Javier

  parent reply	other threads:[~2013-07-28 17:33 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 15:27 [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT Javier Martinez Canillas
2013-06-28 15:27 ` [PATCH v4 2/2] gpio/omap: auto request GPIO as input if used as IRQ via DT Javier Martinez Canillas
2013-06-28 15:32   ` Santosh Shilimkar
2013-06-28 15:28 ` [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT Santosh Shilimkar
2013-06-29 23:44 ` Linus Walleij
2013-06-30  0:25   ` Javier Martinez Canillas
2013-07-01  8:04     ` Linus Walleij
2013-07-01 11:01       ` Javier Martinez Canillas
2013-07-01 12:35         ` Linus Walleij
2013-07-01 12:49       ` Grant Likely
2013-07-01 13:23         ` Linus Walleij
2013-07-28 10:58 ` Alexander Holler
2013-07-28 11:14   ` Linus Walleij
2013-07-28 12:59     ` Alexander Holler
2013-07-28 14:11       ` Linus Walleij
2013-07-28 14:37         ` Shilimkar, Santosh
2013-07-28 16:29           ` Linus Walleij
2013-07-28 17:13             ` Alexander Holler
2013-07-28 18:10               ` Linus Walleij
2013-07-28 17:33             ` Javier Martinez Canillas [this message]
2013-07-28 17:36               ` Javier Martinez Canillas
2013-07-28 18:22               ` Linus Walleij
2013-07-28 19:06                 ` Javier Martinez Canillas
2013-07-29  6:41                   ` Alexander Holler
2013-07-29  8:17                     ` Javier Martinez Canillas
2013-07-29  9:13                       ` Linus Walleij
2013-07-29 10:27                       ` Alexander Holler
2013-07-29 11:11                         ` Javier Martinez Canillas
2013-07-29 11:30                           ` Alexander Holler
2013-07-29 11:33                             ` Alexander Holler
2013-07-29 11:48                           ` Linus Walleij
2013-07-29 11:53                       ` Balaji T K
2013-07-28 19:30                 ` Javier Martinez Canillas
2013-07-29  6:54                   ` Alexander Holler
2013-07-28 14:25   ` Alexander Holler
2013-07-28 16:25     ` Linus Walleij
2013-07-28 16:45       ` Alexander Holler
2013-07-28 17:47         ` Javier Martinez Canillas
2013-07-28 18:06         ` Linus Walleij
2013-07-28 18:50           ` Javier Martinez Canillas
2013-07-29  5:24             ` Alexander Holler
2013-07-29  9:05               ` Linus Walleij
2013-07-29 10:48                 ` Alexander Holler

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='CAAwP0s18ouM7wMm=dGCbWzukf-ikpB+yarNO5d2OZLjuQei8eA@mail.gmail.com' \
    --to=martinez.javier@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=balajitk@ti.com \
    --cc=eballetbo@gmail.com \
    --cc=florian.vaussard@epfl.ch \
    --cc=grant.likely@secretlab.ca \
    --cc=holler@ahsoftware.de \
    --cc=javier.martinez@collabora.co.uk \
    --cc=jgchunter@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).