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

2013-11-12 Thread Linus Walleij
On Mon, Nov 11, 2013 at 8:33 PM, Stephen Warren wrote: > On 11/11/2013 12:17 PM, Gerlando Falauto wrote: >> Thanks for your answer. So it should be the parent driver to proactively >> configure the GPIO as input, active high etc..., when an IRQ for its >> GPIOs is requested, right? > > That was

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

2013-11-12 Thread Linus Walleij
On Mon, Nov 11, 2013 at 8:33 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 11/11/2013 12:17 PM, Gerlando Falauto wrote: Thanks for your answer. So it should be the parent driver to proactively configure the GPIO as input, active high etc..., when an IRQ for its GPIOs is requested, right?

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

2013-11-11 Thread Tomasz Figa
On Monday 11 of November 2013 12:33:20 Stephen Warren wrote: > On 11/11/2013 12:17 PM, Gerlando Falauto wrote: > > Hi Stephan, > > > > On 11/11/2013 07:53 PM, Stephen Warren wrote: > >> On 11/11/2013 11:28 AM, Gerlando Falauto wrote: > >>> Hi everyone, > >>> > >>> [jumping in on an old

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

2013-11-11 Thread Stephen Warren
On 11/11/2013 12:17 PM, Gerlando Falauto wrote: > Hi Stephan, > > On 11/11/2013 07:53 PM, Stephen Warren wrote: >> On 11/11/2013 11:28 AM, Gerlando Falauto wrote: >>> Hi everyone, >>> >>> [jumping in on an old discussion] >>> >>> On 09/09/2013 06:19 PM, Mark Brown wrote: On Wed, Sep 04, 2013

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

2013-11-11 Thread Gerlando Falauto
Hi Stephan, On 11/11/2013 07:53 PM, Stephen Warren wrote: On 11/11/2013 11:28 AM, Gerlando Falauto wrote: Hi everyone, [jumping in on an old discussion] On 09/09/2013 06:19 PM, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars

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

2013-11-11 Thread Stephen Warren
On 11/11/2013 11:28 AM, Gerlando Falauto wrote: > Hi everyone, > > [jumping in on an old discussion] > > On 09/09/2013 06:19 PM, Mark Brown wrote: >> On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: >>> On 09/04/2013 03:05 AM, Lars Poeschel wrote: >> The driver that tries to

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

2013-11-11 Thread Gerlando Falauto
Hi everyone, [jumping in on an old discussion] On 09/09/2013 06:19 PM, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO requested by this patch before HAS to fail. This is

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

2013-11-11 Thread Gerlando Falauto
Hi everyone, [jumping in on an old discussion] On 09/09/2013 06:19 PM, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO requested by this patch before HAS to fail. This is

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

2013-11-11 Thread Stephen Warren
On 11/11/2013 11:28 AM, Gerlando Falauto wrote: Hi everyone, [jumping in on an old discussion] On 09/09/2013 06:19 PM, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO

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

2013-11-11 Thread Gerlando Falauto
Hi Stephan, On 11/11/2013 07:53 PM, Stephen Warren wrote: On 11/11/2013 11:28 AM, Gerlando Falauto wrote: Hi everyone, [jumping in on an old discussion] On 09/09/2013 06:19 PM, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars

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

2013-11-11 Thread Stephen Warren
On 11/11/2013 12:17 PM, Gerlando Falauto wrote: Hi Stephan, On 11/11/2013 07:53 PM, Stephen Warren wrote: On 11/11/2013 11:28 AM, Gerlando Falauto wrote: Hi everyone, [jumping in on an old discussion] On 09/09/2013 06:19 PM, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600,

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

2013-11-11 Thread Tomasz Figa
On Monday 11 of November 2013 12:33:20 Stephen Warren wrote: On 11/11/2013 12:17 PM, Gerlando Falauto wrote: Hi Stephan, On 11/11/2013 07:53 PM, Stephen Warren wrote: On 11/11/2013 11:28 AM, Gerlando Falauto wrote: Hi everyone, [jumping in on an old discussion] On 09/09/2013

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

2013-10-11 Thread Linus Walleij
On Tue, Sep 24, 2013 at 6:59 PM, Stephen Warren wrote: > On 09/24/2013 02:31 AM, Linus Walleij wrote: >> On Mon, Sep 23, 2013 at 10:21 PM, Stephen Warren >> wrote: > ... >>> Perhaps rather than having the gpio_chip/irq_chip drivers physically >>> implement a function which calls this common

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

2013-10-11 Thread Linus Walleij
On Tue, Sep 24, 2013 at 6:59 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 09/24/2013 02:31 AM, Linus Walleij wrote: On Mon, Sep 23, 2013 at 10:21 PM, Stephen Warren swar...@wwwdotorg.org wrote: ... Perhaps rather than having the gpio_chip/irq_chip drivers physically implement a

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

2013-09-24 Thread Stephen Warren
On 09/24/2013 02:31 AM, Linus Walleij wrote: > On Mon, Sep 23, 2013 at 10:21 PM, Stephen Warren > wrote: ... >> Perhaps rather than having the gpio_chip/irq_chip drivers physically >> implement a function which calls this common code, they could set some >> flags/data/... in the struct

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

2013-09-24 Thread Stephen Warren
On 09/24/2013 02:26 AM, Linus Walleij wrote: > On Mon, Sep 23, 2013 at 10:12 PM, Stephen Warren > wrote: >> On 09/23/2013 01:53 PM, Linus Walleij wrote: > >>> I think the kernel should prevent such things. >> >> It might be nice if it could do that. >> >> However, that is 100% unrelated to the

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

2013-09-24 Thread Linus Walleij
On Mon, Sep 23, 2013 at 10:21 PM, Stephen Warren wrote: > On 09/23/2013 02:01 PM, Linus Walleij wrote: >> And how to you block the same line from being gpio_request()ed >> and set as output? > > To be honest, I really don't think this problem is terribly likely to > occur, so I'm really not

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

2013-09-24 Thread Linus Walleij
On Mon, Sep 23, 2013 at 10:12 PM, Stephen Warren wrote: > On 09/23/2013 01:53 PM, Linus Walleij wrote: >> I think the kernel should prevent such things. > > It might be nice if it could do that. > > However, that is 100% unrelated to the problem at hand. I don't think it is unrelated when the

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

2013-09-24 Thread Linus Walleij
On Mon, Sep 23, 2013 at 10:12 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 09/23/2013 01:53 PM, Linus Walleij wrote: I think the kernel should prevent such things. It might be nice if it could do that. However, that is 100% unrelated to the problem at hand. I don't think it is

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

2013-09-24 Thread Linus Walleij
On Mon, Sep 23, 2013 at 10:21 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 09/23/2013 02:01 PM, Linus Walleij wrote: And how to you block the same line from being gpio_request()ed and set as output? To be honest, I really don't think this problem is terribly likely to occur, so I'm

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

2013-09-24 Thread Stephen Warren
On 09/24/2013 02:26 AM, Linus Walleij wrote: On Mon, Sep 23, 2013 at 10:12 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 09/23/2013 01:53 PM, Linus Walleij wrote: I think the kernel should prevent such things. It might be nice if it could do that. However, that is 100% unrelated to

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

2013-09-24 Thread Stephen Warren
On 09/24/2013 02:31 AM, Linus Walleij wrote: On Mon, Sep 23, 2013 at 10:21 PM, Stephen Warren swar...@wwwdotorg.org wrote: ... Perhaps rather than having the gpio_chip/irq_chip drivers physically implement a function which calls this common code, they could set some flags/data/... in the

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

2013-09-23 Thread Stephen Warren
On 09/23/2013 02:01 PM, Linus Walleij wrote: > On Mon, Sep 16, 2013 at 7:09 PM, Stephen Warren wrote: > >> Put another way, I don't believe >> there's any rule when writing DT bindings that states that bindings must >> not describe the same pin as both a GPIO and an IRQ, although admittedly >>

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

2013-09-23 Thread Stephen Warren
On 09/23/2013 01:53 PM, Linus Walleij wrote: > On Wed, Sep 11, 2013 at 9:43 PM, Stephen Warren wrote: > >> I believe this situation is exactly what cause the original patch to the >> OMAP driver to be reverted; that patch should have touched the HW >> directly to solve the problem when the IRQ

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

2013-09-23 Thread Linus Walleij
On Mon, Sep 16, 2013 at 7:09 PM, Stephen Warren wrote: > Put another way, I don't believe > there's any rule when writing DT bindings that states that bindings must > not describe the same pin as both a GPIO and an IRQ, although admittedly > that may be unusual. Actually I think you've won me

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

2013-09-23 Thread Linus Walleij
On Wed, Sep 11, 2013 at 9:43 PM, Stephen Warren wrote: > I believe this situation is exactly what cause the original patch to the > OMAP driver to be reverted; that patch should have touched the HW > directly to solve the problem when the IRQ was requested, rather than > calling into the GPIO

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

2013-09-23 Thread Linus Walleij
On Wed, Sep 11, 2013 at 9:43 PM, Stephen Warren wrote: > On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: >> I'm a bit confused now. Doesn't the fact that gpio_request() prevents >> double-requests mean that the use-case that you say that have not been >> covered >> by this patch can't

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

2013-09-23 Thread Linus Walleij
On Wed, Sep 11, 2013 at 9:43 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: I'm a bit confused now. Doesn't the fact that gpio_request() prevents double-requests mean that the use-case that you say that have not been covered by this

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

2013-09-23 Thread Linus Walleij
On Wed, Sep 11, 2013 at 9:43 PM, Stephen Warren swar...@wwwdotorg.org wrote: I believe this situation is exactly what cause the original patch to the OMAP driver to be reverted; that patch should have touched the HW directly to solve the problem when the IRQ was requested, rather than calling

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

2013-09-23 Thread Linus Walleij
On Mon, Sep 16, 2013 at 7:09 PM, Stephen Warren swar...@wwwdotorg.org wrote: Put another way, I don't believe there's any rule when writing DT bindings that states that bindings must not describe the same pin as both a GPIO and an IRQ, although admittedly that may be unusual. Actually I

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

2013-09-23 Thread Stephen Warren
On 09/23/2013 01:53 PM, Linus Walleij wrote: On Wed, Sep 11, 2013 at 9:43 PM, Stephen Warren swar...@wwwdotorg.org wrote: I believe this situation is exactly what cause the original patch to the OMAP driver to be reverted; that patch should have touched the HW directly to solve the problem

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

2013-09-23 Thread Stephen Warren
On 09/23/2013 02:01 PM, Linus Walleij wrote: On Mon, Sep 16, 2013 at 7:09 PM, Stephen Warren swar...@wwwdotorg.org wrote: Put another way, I don't believe there's any rule when writing DT bindings that states that bindings must not describe the same pin as both a GPIO and an IRQ, although

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

2013-09-22 Thread Javier Martinez Canillas
On 09/16/2013 07:09 PM, Stephen Warren wrote: > On 09/16/2013 10:03 AM, Lars Poeschel wrote: >> On Monday 16 September 2013 13:43:50, Stephen Warren wrote: >>> On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: On 09/11/2013 12:34 AM, Stephen Warren wrote: > On 09/10/2013 03:37 PM,

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

2013-09-22 Thread Javier Martinez Canillas
On 09/16/2013 07:09 PM, Stephen Warren wrote: On 09/16/2013 10:03 AM, Lars Poeschel wrote: On Monday 16 September 2013 13:43:50, Stephen Warren wrote: On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: On 09/11/2013 12:34 AM, Stephen Warren wrote: On 09/10/2013 03:37 PM, Mark Brown

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

2013-09-16 Thread Stephen Warren
On 09/16/2013 10:03 AM, Lars Poeschel wrote: > On Monday 16 September 2013 13:43:50, Stephen Warren wrote: >> On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: >>> On 09/11/2013 12:34 AM, Stephen Warren wrote: On 09/10/2013 03:37 PM, Mark Brown wrote: > On Tue, Sep 10, 2013 at

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

2013-09-16 Thread Lars Poeschel
On Monday 16 September 2013 13:43:50, Stephen Warren wrote: > On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: > > On 09/11/2013 12:34 AM, Stephen Warren wrote: > >> On 09/10/2013 03:37 PM, Mark Brown wrote: > >>> On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: >

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

2013-09-16 Thread Lars Poeschel
On Monday 16 September 2013 13:43:50, Stephen Warren wrote: On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: On 09/11/2013 12:34 AM, Stephen Warren wrote: On 09/10/2013 03:37 PM, Mark Brown wrote: On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: Doesn't this patch

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

2013-09-16 Thread Stephen Warren
On 09/16/2013 10:03 AM, Lars Poeschel wrote: On Monday 16 September 2013 13:43:50, Stephen Warren wrote: On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: On 09/11/2013 12:34 AM, Stephen Warren wrote: On 09/10/2013 03:37 PM, Mark Brown wrote: On Tue, Sep 10, 2013 at 01:53:47PM -0600,

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

2013-09-11 Thread Stephen Warren
On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: > On 09/11/2013 12:34 AM, Stephen Warren wrote: >> On 09/10/2013 03:37 PM, Mark Brown wrote: >>> On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: >>> Doesn't this patch call gpio_request() on the GPIO first, and hence

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

2013-09-11 Thread Stephen Warren
On 09/10/2013 06:52 PM, Javier Martinez Canillas wrote: On 09/11/2013 12:34 AM, Stephen Warren wrote: On 09/10/2013 03:37 PM, Mark Brown wrote: On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: Doesn't this patch call gpio_request() on the GPIO first, and hence prevent the

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

2013-09-10 Thread Joel Fernandes
On 09/10/2013 04:23 PM, Javier Martinez Canillas wrote: > On 09/10/2013 09:52 PM, Stephen Warren wrote: >> On 09/10/2013 07:56 AM, Javier Martinez Canillas wrote: >> ... >>> The only thing that this patch tries to solve is when a driver expect to >>> request >>> a IRQ and it doesn't care if is a

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

2013-09-10 Thread Javier Martinez Canillas
On 09/11/2013 12:34 AM, Stephen Warren wrote: > On 09/10/2013 03:37 PM, Mark Brown wrote: >> On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: >> >>> Doesn't this patch call gpio_request() on the GPIO first, and >>> hence prevent the driver's own gpio_request() from succeeding, >>>

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

2013-09-10 Thread Stephen Warren
On 09/10/2013 03:37 PM, Mark Brown wrote: > On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: > >> Doesn't this patch call gpio_request() on the GPIO first, and >> hence prevent the driver's own gpio_request() from succeeding, >> since the GPIO is already requested? If this is not a

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

2013-09-10 Thread Mark Brown
On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: > Doesn't this patch call gpio_request() on the GPIO first, and hence > prevent the driver's own gpio_request() from succeeding, since the GPIO > is already requested? If this is not a problem, it sounds like a bug in >

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

2013-09-10 Thread Javier Martinez Canillas
On 09/10/2013 09:52 PM, Stephen Warren wrote: > On 09/10/2013 07:56 AM, Javier Martinez Canillas wrote: > ... >> The only thing that this patch tries to solve is when a driver expect to >> request >> a IRQ and it doesn't care if is a real IRQ line from an interrupt controller >> or >> a GPIO pin

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

2013-09-10 Thread Stephen Warren
On 09/10/2013 02:47 AM, Lars Poeschel wrote: > On Tuesday 10 September 2013 17:19:24, Mark Brown wrote: >> On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: >>> On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO requested by this patch before HAS

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

2013-09-10 Thread Stephen Warren
On 09/10/2013 07:56 AM, Javier Martinez Canillas wrote: ... > The only thing that this patch tries to solve is when a driver expect to > request > a IRQ and it doesn't care if is a real IRQ line from an interrupt controller > or > a GPIO pin mapped as an IRQ. That can be solved in the interrupt

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

2013-09-10 Thread Javier Martinez Canillas
On 09/10/2013 10:47 AM, Lars Poeschel wrote: > On Tuesday 10 September 2013 17:19:24, Mark Brown wrote: >> On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: >> > On 09/04/2013 03:05 AM, Lars Poeschel wrote: >> > > The driver that tries to use the GPIO requested by this patch before

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

2013-09-10 Thread Lars Poeschel
On Tuesday 10 September 2013 17:19:24, Mark Brown wrote: > On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: > > On 09/04/2013 03:05 AM, Lars Poeschel wrote: > > > The driver that tries to use the GPIO requested by this patch before HAS > > > to > > > fail. This is exactly the

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

2013-09-10 Thread Lars Poeschel
On Tuesday 10 September 2013 17:19:24, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO requested by this patch before HAS to fail. This is exactly the intention of this

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

2013-09-10 Thread Javier Martinez Canillas
On 09/10/2013 10:47 AM, Lars Poeschel wrote: On Tuesday 10 September 2013 17:19:24, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO requested by this patch before HAS to

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

2013-09-10 Thread Stephen Warren
On 09/10/2013 02:47 AM, Lars Poeschel wrote: On Tuesday 10 September 2013 17:19:24, Mark Brown wrote: On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO requested by this patch before HAS to fail.

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

2013-09-10 Thread Stephen Warren
On 09/10/2013 07:56 AM, Javier Martinez Canillas wrote: ... The only thing that this patch tries to solve is when a driver expect to request a IRQ and it doesn't care if is a real IRQ line from an interrupt controller or a GPIO pin mapped as an IRQ. That can be solved in the interrupt chip

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

2013-09-10 Thread Javier Martinez Canillas
On 09/10/2013 09:52 PM, Stephen Warren wrote: On 09/10/2013 07:56 AM, Javier Martinez Canillas wrote: ... The only thing that this patch tries to solve is when a driver expect to request a IRQ and it doesn't care if is a real IRQ line from an interrupt controller or a GPIO pin mapped as

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

2013-09-10 Thread Mark Brown
On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: Doesn't this patch call gpio_request() on the GPIO first, and hence prevent the driver's own gpio_request() from succeeding, since the GPIO is already requested? If this is not a problem, it sounds like a bug in gpio_request()

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

2013-09-10 Thread Stephen Warren
On 09/10/2013 03:37 PM, Mark Brown wrote: On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: Doesn't this patch call gpio_request() on the GPIO first, and hence prevent the driver's own gpio_request() from succeeding, since the GPIO is already requested? If this is not a

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

2013-09-10 Thread Javier Martinez Canillas
On 09/11/2013 12:34 AM, Stephen Warren wrote: On 09/10/2013 03:37 PM, Mark Brown wrote: On Tue, Sep 10, 2013 at 01:53:47PM -0600, Stephen Warren wrote: Doesn't this patch call gpio_request() on the GPIO first, and hence prevent the driver's own gpio_request() from succeeding, since the GPIO

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

2013-09-10 Thread Joel Fernandes
On 09/10/2013 04:23 PM, Javier Martinez Canillas wrote: On 09/10/2013 09:52 PM, Stephen Warren wrote: On 09/10/2013 07:56 AM, Javier Martinez Canillas wrote: ... The only thing that this patch tries to solve is when a driver expect to request a IRQ and it doesn't care if is a real IRQ line

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

2013-09-09 Thread Mark Brown
On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: > On 09/04/2013 03:05 AM, Lars Poeschel wrote: > > The driver that tries to use the GPIO requested by this patch before HAS to > > fail. This is exactly the intention of this patch. We don't want the GPIO > > to > > be requested

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

2013-09-09 Thread Mark Brown
On Wed, Sep 04, 2013 at 02:16:36PM -0600, Stephen Warren wrote: On 09/04/2013 03:05 AM, Lars Poeschel wrote: The driver that tries to use the GPIO requested by this patch before HAS to fail. This is exactly the intention of this patch. We don't want the GPIO to be requested any more,

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

2013-09-04 Thread Stephen Warren
On 09/04/2013 03:21 AM, Lars Poeschel wrote: > On Wednesday 04 September 2013 11:29:00, Stephen Warren wrote: >> On 09/02/2013 03:38 AM, Lars Poeschel wrote: >>> Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: >> ... >> Yet the current patch only addresses a limited set of

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

2013-09-04 Thread Stephen Warren
On 09/04/2013 03:05 AM, Lars Poeschel wrote: > On Wednesday 04 September 2013 11:27:12, Stephen Warren wrote: >> On 09/02/2013 03:25 AM, Lars Poeschel wrote: >>> Some leagcy drivers currently do this: >>> >>> request_gpio(gpio); >>> gpio_direction_input(gpio); >>> request_irq(gpio_to_irq(gpio));

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

2013-09-04 Thread Stephen Warren
On 09/04/2013 02:35 AM, Lars Poeschel wrote: > On Wednesday 04 September 2013 11:29:47, Stephen Warren wrote: >> On 09/03/2013 06:35 AM, Linus Walleij wrote: >>> On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren > wrote: I still haven't seen an answer to why we really care about this; how

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

2013-09-04 Thread Lars Poeschel
On Wednesday 04 September 2013 11:29:00, Stephen Warren wrote: > On 09/02/2013 03:38 AM, Lars Poeschel wrote: > > Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: > ... > > >> Yet the current patch only addresses a limited set of cases, since it > >> doesn't hook the APIs but rather

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

2013-09-04 Thread Lars Poeschel
On Wednesday 04 September 2013 11:27:12, Stephen Warren wrote: > On 09/02/2013 03:25 AM, Lars Poeschel wrote: > > Some leagcy drivers currently do this: > > > > request_gpio(gpio); > > gpio_direction_input(gpio); > > request_irq(gpio_to_irq(gpio)); > > > > In that case request_irq should not

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

2013-09-04 Thread Lars Poeschel
On Wednesday 04 September 2013 11:29:47, Stephen Warren wrote: > On 09/03/2013 06:35 AM, Linus Walleij wrote: > > On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren wrote: > >> I still haven't seen an answer to why we really care about this; how > >> many times has code actually allocated the same

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

2013-09-04 Thread Lars Poeschel
On Wednesday 04 September 2013 11:29:47, Stephen Warren wrote: On 09/03/2013 06:35 AM, Linus Walleij wrote: On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren swar...@wwwdotorg.org wrote: I still haven't seen an answer to why we really care about this; how many times has code actually

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

2013-09-04 Thread Lars Poeschel
On Wednesday 04 September 2013 11:27:12, Stephen Warren wrote: On 09/02/2013 03:25 AM, Lars Poeschel wrote: Some leagcy drivers currently do this: request_gpio(gpio); gpio_direction_input(gpio); request_irq(gpio_to_irq(gpio)); In that case request_irq should not fail because the

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

2013-09-04 Thread Lars Poeschel
On Wednesday 04 September 2013 11:29:00, Stephen Warren wrote: On 09/02/2013 03:38 AM, Lars Poeschel wrote: Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: ... Yet the current patch only addresses a limited set of cases, since it doesn't hook the APIs but rather parses the

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

2013-09-04 Thread Stephen Warren
On 09/04/2013 02:35 AM, Lars Poeschel wrote: On Wednesday 04 September 2013 11:29:47, Stephen Warren wrote: On 09/03/2013 06:35 AM, Linus Walleij wrote: On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren swar...@wwwdotorg.org wrote: I still haven't seen an answer to why we really care about

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

2013-09-04 Thread Stephen Warren
On 09/04/2013 03:05 AM, Lars Poeschel wrote: On Wednesday 04 September 2013 11:27:12, Stephen Warren wrote: On 09/02/2013 03:25 AM, Lars Poeschel wrote: Some leagcy drivers currently do this: request_gpio(gpio); gpio_direction_input(gpio); request_irq(gpio_to_irq(gpio)); In that case

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

2013-09-04 Thread Stephen Warren
On 09/04/2013 03:21 AM, Lars Poeschel wrote: On Wednesday 04 September 2013 11:29:00, Stephen Warren wrote: On 09/02/2013 03:38 AM, Lars Poeschel wrote: Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: ... Yet the current patch only addresses a limited set of cases, since it

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

2013-09-03 Thread Stephen Warren
On 09/03/2013 06:35 AM, Linus Walleij wrote: > On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren wrote: > >> I still haven't seen an answer to why we really care about this; how >> many times has code actually allocated the same GPIO/IRQ when it >> shouldn't, in a way that it wasn't detectable by

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

2013-09-03 Thread Stephen Warren
On 09/03/2013 06:43 AM, Linus Walleij wrote: > On Fri, Aug 30, 2013 at 9:55 PM, Stephen Warren wrote: >> On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: >> ... >>> We have been trying to solve this issue for a few months by now and Linus' >>> approach seems to be the most sensible

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

2013-09-03 Thread Stephen Warren
On 09/02/2013 03:38 AM, Lars Poeschel wrote: > Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: ... >> Yet the current patch only addresses a limited set of cases, since it >> doesn't hook the APIs but rather parses the DT. It doesn't cover the >> non-DT case. It should if the feature

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

2013-09-03 Thread Stephen Warren
On 09/02/2013 03:25 AM, Lars Poeschel wrote: > Am Freitag, 30. August 2013, 13:55:26 schrieb Stephen Warren: >> On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: >> ... >> >>> We have been trying to solve this issue for a few months by now and Linus' >>> approach seems to be the most

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

2013-09-03 Thread Stephen Warren
On 08/31/2013 09:32 AM, anish singh wrote: > On Sat, Aug 31, 2013 at 1:23 AM, Stephen Warren > wrote: > I still haven't seen an answer to why we really care about this; how > many times has code actually allocated the same GPIO/IRQ when it > shouldn't,

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

2013-09-03 Thread Linus Walleij
On Fri, Aug 30, 2013 at 9:55 PM, Stephen Warren wrote: > On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: > ... >> We have been trying to solve this issue for a few months by now and Linus' >> approach seems to be the most sensible solution to me. >> >> Drivers that request an IRQ and

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

2013-09-03 Thread Linus Walleij
On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren wrote: > I still haven't seen an answer to why we really care about this; how > many times has code actually allocated the same GPIO/IRQ when it > shouldn't, in a way that it wasn't detectable by some other mechanism, > i.e. the feature just not

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

2013-09-03 Thread Stephen Warren
On 08/31/2013 09:32 AM, anish singh wrote: On Sat, Aug 31, 2013 at 1:23 AM, Stephen Warren swar...@wwwdotorg.org mailto:swar...@wwwdotorg.org wrote: I still haven't seen an answer to why we really care about this; how many times has code actually allocated the same GPIO/IRQ when it

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

2013-09-03 Thread Stephen Warren
On 09/02/2013 03:25 AM, Lars Poeschel wrote: Am Freitag, 30. August 2013, 13:55:26 schrieb Stephen Warren: On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: ... We have been trying to solve this issue for a few months by now and Linus' approach seems to be the most sensible solution to

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

2013-09-03 Thread Stephen Warren
On 09/02/2013 03:38 AM, Lars Poeschel wrote: Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: ... Yet the current patch only addresses a limited set of cases, since it doesn't hook the APIs but rather parses the DT. It doesn't cover the non-DT case. It should if the feature is

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

2013-09-03 Thread Stephen Warren
On 09/03/2013 06:43 AM, Linus Walleij wrote: On Fri, Aug 30, 2013 at 9:55 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: ... We have been trying to solve this issue for a few months by now and Linus' approach seems to be the most

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

2013-09-03 Thread Stephen Warren
On 09/03/2013 06:35 AM, Linus Walleij wrote: On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren swar...@wwwdotorg.org wrote: I still haven't seen an answer to why we really care about this; how many times has code actually allocated the same GPIO/IRQ when it shouldn't, in a way that it wasn't

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

2013-09-03 Thread Linus Walleij
On Fri, Aug 30, 2013 at 9:53 PM, Stephen Warren swar...@wwwdotorg.org wrote: I still haven't seen an answer to why we really care about this; how many times has code actually allocated the same GPIO/IRQ when it shouldn't, in a way that it wasn't detectable by some other mechanism, i.e. the

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

2013-09-03 Thread Linus Walleij
On Fri, Aug 30, 2013 at 9:55 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: ... We have been trying to solve this issue for a few months by now and Linus' approach seems to be the most sensible solution to me. Drivers that request an

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

2013-09-02 Thread Lars Poeschel
Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: > On 08/29/2013 01:26 PM, Linus Walleij wrote: > > On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren wrote: > >> On 08/26/2013 08:07 AM, Lars Poeschel wrote: > >>> Currently the kernel is ambigously treating GPIOs and interrupts > >>>

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

2013-09-02 Thread Lars Poeschel
Am Freitag, 30. August 2013, 13:55:26 schrieb Stephen Warren: > On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: > ... > > > We have been trying to solve this issue for a few months by now and Linus' > > approach seems to be the most sensible solution to me. > > > > Drivers that request

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

2013-09-02 Thread Lars Poeschel
Am Freitag, 30. August 2013, 13:55:26 schrieb Stephen Warren: On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: ... We have been trying to solve this issue for a few months by now and Linus' approach seems to be the most sensible solution to me. Drivers that request an IRQ and

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

2013-09-02 Thread Lars Poeschel
Am Freitag, 30. August 2013, 13:53:45 schrieb Stephen Warren: On 08/29/2013 01:26 PM, Linus Walleij wrote: On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/26/2013 08:07 AM, Lars Poeschel wrote: Currently the kernel is ambigously treating GPIOs and

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

2013-08-30 Thread Stephen Warren
On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: ... > We have been trying to solve this issue for a few months by now and Linus' > approach seems to be the most sensible solution to me. > > Drivers that request an IRQ and assume that platform code will request and > setup > the GPIO have

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

2013-08-30 Thread Stephen Warren
On 08/29/2013 01:26 PM, Linus Walleij wrote: > On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren > wrote: >> On 08/26/2013 08:07 AM, Lars Poeschel wrote: >>> >>> Currently the kernel is ambigously treating GPIOs and interrupts >>> from a GPIO controller: GPIOs and interrupts are treated as >>>

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

2013-08-30 Thread Stephen Warren
On 08/29/2013 01:26 PM, Linus Walleij wrote: On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/26/2013 08:07 AM, Lars Poeschel wrote: Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated

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

2013-08-30 Thread Stephen Warren
On 08/29/2013 06:24 PM, Javier Martinez Canillas wrote: ... We have been trying to solve this issue for a few months by now and Linus' approach seems to be the most sensible solution to me. Drivers that request an IRQ and assume that platform code will request and setup the GPIO have been

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

2013-08-29 Thread Javier Martinez Canillas
On 08/29/2013 09:26 PM, Linus Walleij wrote: > On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren > wrote: >> On 08/26/2013 08:07 AM, Lars Poeschel wrote: >>> >>> Currently the kernel is ambigously treating GPIOs and interrupts >>> from a GPIO controller: GPIOs and interrupts are treated as >>>

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

2013-08-29 Thread Linus Walleij
On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren wrote: > On 08/26/2013 08:07 AM, Lars Poeschel wrote: >> >> Currently the kernel is ambigously treating GPIOs and interrupts >> from a GPIO controller: GPIOs and interrupts are treated as >> orthogonal. This unfortunately makes it unclear how to

RE: [PATCH v3] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-29 Thread Strashko, Grygorii
Hi Lars, Linus, I've few comments regarding this patch and problem in general. On 08/26/2013 05:07 PM, Lars Poeschel wrote: > From: Linus Walleij > > Currently the kernel is ambigously treating GPIOs and interrupts > from a GPIO controller: GPIOs and interrupts are treated as > orthogonal. This

RE: [PATCH v3] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-29 Thread Strashko, Grygorii
Hi Lars, Linus, I've few comments regarding this patch and problem in general. On 08/26/2013 05:07 PM, Lars Poeschel wrote: From: Linus Walleij linus.wall...@linaro.org Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated

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

2013-08-29 Thread Linus Walleij
On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/26/2013 08:07 AM, Lars Poeschel wrote: Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated as orthogonal. This unfortunately makes it

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

2013-08-29 Thread Javier Martinez Canillas
On 08/29/2013 09:26 PM, Linus Walleij wrote: On Tue, Aug 27, 2013 at 10:17 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/26/2013 08:07 AM, Lars Poeschel wrote: Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated

  1   2   >