From: Alexander Holler <holler@ahsoftware.de>
To: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
Grant Likely <grant.likely@linaro.org>,
Jon Hunter <jgchunter@gmail.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Tony Lindgren <tony@atomide.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>,
Balaji T K <balajitk@ti.com>
Subject: Re: [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT
Date: Mon, 29 Jul 2013 07:24:30 +0200 [thread overview]
Message-ID: <51F5FC8E.9010007@ahsoftware.de> (raw)
In-Reply-To: <CAAwP0s0q6U6MDYBHiA=u3N_3bJ7CXTPKX_A_wwTrWrqj17mH0w@mail.gmail.com>
Am 28.07.2013 20:50, schrieb Javier Martinez Canillas:
> On Sun, Jul 28, 2013 at 8:06 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Sun, Jul 28, 2013 at 6:45 PM, Alexander Holler <holler@ahsoftware.de> wrote:
>>> Am 28.07.2013 18:25, schrieb Linus Walleij:
>>>> On Sun, Jul 28, 2013 at 4:25 PM, Alexander Holler <holler@ahsoftware.de> wrote:
>>>>
>>>>> By the way, if someone decides to touch omap_hsmmc, the driver wrongly
>>>>> assumes that 0 is not a valid IRQ number and it doesn't check if
>>>>> gpio_to_irq() returns a negative value. ;)
>>>>
>>>> Zero *is* *not* a valid IRQ number.
>>>
>>> Where is that mentioned?
>>
>> This has been a major debate in the kernel in recent months, and we are
>> agreed to remove 0 as a valid Linux IRQ number. The fact that up until
>> two years ago the ARM kernel allowed it is a historical artifact.
>>
>> Please see this article for background:
>> http://lwn.net/Articles/470820/
>>
>> Which falls back to this posting from Torvalds:
>> http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-11/7628.html
>>
>>> gpio.txt states:
>>>
>>> ----
>>> Non-error values returned from gpio_to_irq() can be passed to request_irq()
>>> or free_irq(). They will often be stored into IRQ resources for platform
>>
>> While IRQ 0 is not an error, it means that this particular GPIO line
>> does not have an IRQ, or cannot be translated into an IRQ, and
>> should not be passed to request_irq().
>>
>> Patches to the documentation is welcome.
>>
>>> With the new patches gpio_to_irq() returns 0.
>>
>> This is not good. Under which circumstances does that happen?
>>
>>> Documentation/IRQ-domain.txt:
>>> ----
>>> The legacy map should only be used if fixed IRQ mappings must be
>>> supported. For example, ISA controllers would use the legacy map for
>>> mapping Linux IRQs 0-15 so that existing ISA drivers get the correct IRQ
>>> numbers.
>>> ----
>>>
>>> You see the 0 too?
>>
>> Is OMAP still using the legacy map? I don't think that works
>> on any system utilizing the GIC driver. It is called legacy because
>> it is not supposed to be used :-/
>>
>
> Not anymore, it was changed recently to use the linear domain mapping
> instead in commit ede4d7a5 ("gpio/omap: convert gpio irq domain to
> linear mapping").
>
I don't really care which mapping is in place. I just care if zero is a
valid IRQ number for the IRQ and related APIs. And I have to assume that
those APIs don't switch their internal handling because of the irq
mapping in place.
Of course, having zero as an invalid IRQ number is a handy thing, but I
just didn't find a place where this is written down. And the usually
numbering in IT (starting at zero) makes it very likely that zero could
be valid IRQ number.
> The commit message says Reported-by: Linus Walleij
> <linus.walleij@linaro.org> ;-)
>
>>> Of ourse, I might be wrong, but you just stated that 0 isn't valid, and
>>> I would be happy to find a source for your statement.
>>
>> See above.
Yeah, as usual, some mail, discussion, thread, article or similiar in
the small internet everyone has memorized in full. ;)
Once, a maintainer refered me to a discussion and commit which happend
10 years ago and it sounded like I'm a morron because I didn't know that. ;)
Thanks a lot for the article about NO_IRQ, it describes the pit I fell
into too, very good.
Maybe it might be worth to suggest using/returning NO_IRQ in (new)
patches instead of zero. That would make it very clear that the value 0
isn't to be used later.
Regards,
Alexander Holler
next prev parent reply other threads:[~2013-07-29 5:26 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
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 [this message]
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=51F5FC8E.9010007@ahsoftware.de \
--to=holler@ahsoftware.de \
--cc=aaro.koskinen@iki.fi \
--cc=balajitk@ti.com \
--cc=eballetbo@gmail.com \
--cc=florian.vaussard@epfl.ch \
--cc=grant.likely@linaro.org \
--cc=javier.martinez@collabora.co.uk \
--cc=jgchunter@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-omap@vger.kernel.org \
--cc=martinez.javier@gmail.com \
--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 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.