Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-10-21 Thread Laurent Pinchart
Hi Stephen, On Sunday 20 October 2013 22:35:04 Stephen Warren wrote: On 10/20/2013 01:41 PM, Laurent Pinchart wrote: On Tuesday 17 September 2013 17:36:32 Grant Likely wrote: On Thu, 12 Sep 2013 17:57:00 +0200, Alexander Holler wrote: Am 12.09.2013 17:19, schrieb Stephen Warren: IRQs,

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-10-20 Thread Laurent Pinchart
Hi Grant, On Tuesday 17 September 2013 17:36:32 Grant Likely wrote: On Thu, 12 Sep 2013 17:57:00 +0200, Alexander Holler wrote: Am 12.09.2013 17:19, schrieb Stephen Warren: IRQs, DMA channels, and GPIOs are all different things. Their bindings are defined independently. While it's good

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-10-20 Thread Tony Lindgren
* Laurent Pinchart laurent.pinch...@ideasonboard.com [131020 05:41]: Hi Grant, On Tuesday 17 September 2013 17:36:32 Grant Likely wrote: On Thu, 12 Sep 2013 17:57:00 +0200, Alexander Holler wrote: Am 12.09.2013 17:19, schrieb Stephen Warren: IRQs, DMA channels, and GPIOs are all

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-10-20 Thread Stephen Warren
On 10/20/2013 01:41 PM, Laurent Pinchart wrote: Hi Grant, On Tuesday 17 September 2013 17:36:32 Grant Likely wrote: On Thu, 12 Sep 2013 17:57:00 +0200, Alexander Holler wrote: Am 12.09.2013 17:19, schrieb Stephen Warren: IRQs, DMA channels, and GPIOs are all different things. Their bindings

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-18 Thread Grant Likely
On Thu, 12 Sep 2013 17:57:00 +0200, Alexander Holler hol...@ahsoftware.de wrote: Am 12.09.2013 17:19, schrieb Stephen Warren: IRQs, DMA channels, and GPIOs are all different things. Their bindings are defined independently. While it's good to define new types of bindings consistently

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Alexander Holler
Am 11.09.2013 19:42, schrieb Alexander Holler: Am 11.09.2013 18:14, schrieb Javier Martinez Canillas: So for example in an OMAP board DT you can define something like this: ethernet@5,0 { compatible = smsc,lan9221, smsc,lan9115; interrupt-parent = gpio6;

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Javier Martinez Canillas
On 09/12/2013 10:55 AM, Alexander Holler wrote: Am 11.09.2013 19:42, schrieb Alexander Holler: Am 11.09.2013 18:14, schrieb Javier Martinez Canillas: So for example in an OMAP board DT you can define something like this: ethernet@5,0 { compatible = smsc,lan9221, smsc,lan9115;

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Alexander Holler
Am 12.09.2013 12:11, schrieb Javier Martinez Canillas: On 09/12/2013 10:55 AM, Alexander Holler wrote: ... By the way, how do you define two GPIOs/IRQs from different gpio-banks/irq-controllers wuth that scheme? That is indeed a very good question and I don't have a definite answer.

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Alexander Holler
Am 12.09.2013 12:28, schrieb Alexander Holler: Am 12.09.2013 12:11, schrieb Javier Martinez Canillas: On 09/12/2013 10:55 AM, Alexander Holler wrote: ... By the way, how do you define two GPIOs/IRQs from different gpio-banks/irq-controllers wuth that scheme? That is indeed a very good

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Alexander Holler
Am 12.09.2013 13:09, schrieb Alexander Holler: Am 12.09.2013 12:28, schrieb Alexander Holler: Am 12.09.2013 12:11, schrieb Javier Martinez Canillas: On 09/12/2013 10:55 AM, Alexander Holler wrote: ... By the way, how do you define two GPIOs/IRQs from different gpio-banks/irq-controllers

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Alexander Holler
Am 12.09.2013 13:26, schrieb Alexander Holler: Am 12.09.2013 13:09, schrieb Alexander Holler: Am 12.09.2013 12:28, schrieb Alexander Holler: Am 12.09.2013 12:11, schrieb Javier Martinez Canillas: On 09/12/2013 10:55 AM, Alexander Holler wrote: ... So, if I understood the code correctly

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Stephen Warren
On 09/12/2013 05:37 AM, Alexander Holler wrote: Am 12.09.2013 13:26, schrieb Alexander Holler: Am 12.09.2013 13:09, schrieb Alexander Holler: Am 12.09.2013 12:28, schrieb Alexander Holler: Am 12.09.2013 12:11, schrieb Javier Martinez Canillas: On 09/12/2013 10:55 AM, Alexander Holler wrote:

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-12 Thread Alexander Holler
Am 12.09.2013 17:19, schrieb Stephen Warren: IRQs, DMA channels, and GPIOs are all different things. Their bindings are defined independently. While it's good to define new types of bindings consistently with other bindings, this hasn't always happened, so you can make zero assumptions about

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-11 Thread Alexander Holler
Am 10.09.2013 17:00, schrieb Joel Fernandes: I think your initial patch is much better than fixing up DT but then I may be missing other problems with your patch that Linus's patch addresses. The initial patch had the problem that it not only did introduce irq-mappings for only those gpios

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-11 Thread Alexander Holler
Am 11.09.2013 09:05, schrieb Alexander Holler: Am 10.09.2013 17:00, schrieb Joel Fernandes: I think your initial patch is much better than fixing up DT but then I may be missing other problems with your patch that Linus's patch addresses. The initial patch had the problem that it not only

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-11 Thread Alexander Holler
And another small update. ;) Am 11.09.2013 09:16, schrieb Alexander Holler: To summarize what happens if a driver uses a gpio as irq: gpio_request() // This works only if the gpio was not requested before gpio_direction_input() gpio_to_irq() // This needs an irq-mapping request_threaded_irq()

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-11 Thread Alexander Holler
Am 11.09.2013 09:30, schrieb Alexander Holler: And another small update. ;) Am 11.09.2013 09:16, schrieb Alexander Holler: To summarize what happens if a driver uses a gpio as irq: gpio_request() // This works only if the gpio was not requested before gpio_direction_input() gpio_to_irq() //

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-11 Thread Alexander Holler
Am 22.08.2013 00:02, schrieb Linus Walleij: On Tue, Aug 20, 2013 at 12:04 AM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: On Wednesday 31 July 2013 01:44:53 Linus Walleij wrote: I don't see how sharing works here, or how another user, i.e. another one than the user wanting to

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-11 Thread Javier Martinez Canillas
On 09/11/2013 05:30 PM, Alexander Holler wrote: Am 22.08.2013 00:02, schrieb Linus Walleij: On Tue, Aug 20, 2013 at 12:04 AM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: On Wednesday 31 July 2013 01:44:53 Linus Walleij wrote: I don't see how sharing works here, or how another

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-11 Thread Alexander Holler
Am 11.09.2013 18:14, schrieb Javier Martinez Canillas: On 09/11/2013 05:30 PM, Alexander Holler wrote: Am 22.08.2013 00:02, schrieb Linus Walleij: On Tue, Aug 20, 2013 at 12:04 AM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: On Wednesday 31 July 2013 01:44:53 Linus Walleij

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-10 Thread Joel Fernandes
On 07/31/2013 03:35 AM, Javier Martinez Canillas wrote: On 07/31/2013 01:44 AM, Linus Walleij wrote: On Tue, Jul 30, 2013 at 6:30 AM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jul 29, 2013 at 6:36 AM, Linus Walleij linus.wall...@linaro.org wrote: To solve this dilemma, perform an

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-10 Thread Javier Martinez Canillas
On 09/10/2013 09:00 AM, Joel Fernandes wrote: On 07/31/2013 03:35 AM, Javier Martinez Canillas wrote: On 07/31/2013 01:44 AM, Linus Walleij wrote: On Tue, Jul 30, 2013 at 6:30 AM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jul 29, 2013 at 6:36 AM, Linus Walleij

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-10 Thread Joel Fernandes
On 09/10/2013 08:17 AM, Javier Martinez Canillas wrote: On 09/10/2013 09:00 AM, Joel Fernandes wrote: On 07/31/2013 03:35 AM, Javier Martinez Canillas wrote: On 07/31/2013 01:44 AM, Linus Walleij wrote: On Tue, Jul 30, 2013 at 6:30 AM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jul

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-10 Thread Javier Martinez Canillas
On 09/10/2013 05:00 PM, Joel Fernandes wrote: On 09/10/2013 08:17 AM, Javier Martinez Canillas wrote: On 09/10/2013 09:00 AM, Joel Fernandes wrote: On 07/31/2013 03:35 AM, Javier Martinez Canillas wrote: On 07/31/2013 01:44 AM, Linus Walleij wrote: On Tue, Jul 30, 2013 at 6:30 AM, Grant

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-10 Thread Joel Fernandes
On 09/10/2013 10:48 AM, Javier Martinez Canillas wrote: On 09/10/2013 05:00 PM, Joel Fernandes wrote: On 09/10/2013 08:17 AM, Javier Martinez Canillas wrote: On 09/10/2013 09:00 AM, Joel Fernandes wrote: On 07/31/2013 03:35 AM, Javier Martinez Canillas wrote: On 07/31/2013 01:44 AM, Linus

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-09-06 Thread Laurent Pinchart
Hi Linus, Sorry for the late reply. On Thursday 22 August 2013 00:02:39 Linus Walleij wrote: On Tue, Aug 20, 2013 at 12:04 AM, Laurent Pinchart wrote: On Wednesday 31 July 2013 01:44:53 Linus Walleij wrote: I don't see how sharing works here, or how another user, i.e. another one than the

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Linus Walleij
On Tue, Aug 20, 2013 at 12:04 AM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: On Wednesday 31 July 2013 01:44:53 Linus Walleij wrote: I don't see how sharing works here, or how another user, i.e. another one than the user wanting to recieve the IRQ, can validly request such a

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-08-19 Thread Laurent Pinchart
Hi Linus, On Wednesday 31 July 2013 01:44:53 Linus Walleij wrote: On Tue, Jul 30, 2013 at 6:30 AM, Grant Likely wrote: On Mon, Jul 29, 2013 at 6:36 AM, Linus Walleij wrote: To solve this dilemma, perform an interrupt consistency check when adding a GPIO chip: if the chip is both

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-08-13 Thread Lars Poeschel
Am Mittwoch, 31. Juli 2013, 01:44:53 schrieb Linus Walleij: On Tue, Jul 30, 2013 at 6:30 AM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jul 29, 2013 at 6:36 AM, Linus Walleij linus.wall...@linaro.org wrote: To solve this dilemma, perform an interrupt consistency check when adding

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-08-03 Thread Alexander Holler
Am 02.08.2013 17:35, schrieb Alexander Holler: Am 02.08.2013 11:57, schrieb Alexander Holler: There must have been a bug in the patch too. I've also added that iinterrupt-parent stuff (with the same flags as used by the driver) and just have let the driver call

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-08-02 Thread Alexander Holler
Am 31.07.2013 10:35, schrieb Javier Martinez Canillas: The problem is that board files and drivers that has not not been completed migrated to DT assumes (at least for OMAP) that *every* GPIO line is mapped as an IRQ and they just do: gpio_request(gpio,...); gpio_direction_input()

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-08-02 Thread Alexander Holler
Am 02.08.2013 11:57, schrieb Alexander Holler: There must have been a bug in the patch too. I've also added that iinterrupt-parent stuff (with the same flags as used by the driver) and just have let the driver call request_threaded_irq(gpio_to_irq(gpio), flags); without the

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-07-31 Thread Javier Martinez Canillas
On 07/31/2013 01:44 AM, Linus Walleij wrote: On Tue, Jul 30, 2013 at 6:30 AM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jul 29, 2013 at 6:36 AM, Linus Walleij linus.wall...@linaro.org wrote: To solve this dilemma, perform an interrupt consistency check when adding a GPIO chip: if

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-07-30 Thread Linus Walleij
On Tue, Jul 30, 2013 at 6:30 AM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jul 29, 2013 at 6:36 AM, Linus Walleij linus.wall...@linaro.org wrote: To solve this dilemma, perform an interrupt consistency check when adding a GPIO chip: if the chip is both gpio-controller and

[PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-07-29 Thread Linus Walleij
NOTE: THIS PATCH IS UNFINISHED AND UNTESTED AND THE ONLY INTENTION IS TO SHOWCASE MY DESIRED APPROACH, IT WILL NOT TRAVERSE THE DT INTERRUPTS PROPERLY AS OF NOW. PLEASE LET US JUST DISCUSS THIS APPROACH. Currently the kernel are ambigously treating GPIOs and interrupts from a GPIO controller:

Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs

2013-07-29 Thread Grant Likely
On Mon, Jul 29, 2013 at 6:36 AM, Linus Walleij linus.wall...@linaro.org wrote: To solve this dilemma, perform an interrupt consistency check when adding a GPIO chip: if the chip is both gpio-controller and interrupt-controller, walk all children of the device tree, check if these in turn