Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-20 Thread Marc Zyngier
On Tue, 19 May 2015 22:45:26 +0100 Feng Kan wrote: > On Tue, May 19, 2015 at 3:01 AM, Marc Zyngier wrote: > > On Tue, 19 May 2015 09:40:21 +0100 > > Linus Walleij wrote: > > > >> On Thu, May 14, 2015 at 10:14 PM, Feng Kan wrote: > >> > On Thu, May 14, 2015 at 3:32 AM, Linus Walleij > >> > wr

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-19 Thread Feng Kan
On Tue, May 19, 2015 at 3:01 AM, Marc Zyngier wrote: > On Tue, 19 May 2015 09:40:21 +0100 > Linus Walleij wrote: > >> On Thu, May 14, 2015 at 10:14 PM, Feng Kan wrote: >> > On Thu, May 14, 2015 at 3:32 AM, Linus Walleij >> > wrote: >> >> >> But surely the GPIO block has its own status register

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-19 Thread Linus Walleij
On Tue, May 19, 2015 at 12:01 PM, Marc Zyngier wrote: > If reading the pending state doesn't work, then I'd like to know > exactly *why*. Only then we can add support for LINE_LEVEL using SPISR > (which has to be GIC-400 specific, as it is not architected). That's a good point. Is it one of thes

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-19 Thread Marc Zyngier
On Tue, 19 May 2015 09:40:21 +0100 Linus Walleij wrote: > On Thu, May 14, 2015 at 10:14 PM, Feng Kan wrote: > > On Thu, May 14, 2015 at 3:32 AM, Linus Walleij > > wrote: > > >> But surely the GPIO block has its own status register, so are > >> you saying that this register is unreliable? > >

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-19 Thread Linus Walleij
On Thu, May 14, 2015 at 10:14 PM, Feng Kan wrote: > On Thu, May 14, 2015 at 3:32 AM, Linus Walleij > wrote: >> But surely the GPIO block has its own status register, so are >> you saying that this register is unreliable? > > When the GPIO is used as interrupt, the gpio block does not report the

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-14 Thread Feng Kan
On Thu, May 14, 2015 at 3:32 AM, Linus Walleij wrote: > On Wed, May 13, 2015 at 5:44 PM, Feng Kan wrote: > >> We are using the gpio driver with gpio_key for power button. The gpio >> status can only be retrieved from the GIC register when the gpio is >> acting as a interrupt. > > OK I understand

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-14 Thread Linus Walleij
On Wed, May 13, 2015 at 5:44 PM, Feng Kan wrote: > We are using the gpio driver with gpio_key for power button. The gpio > status can only be retrieved from the GIC register when the gpio is > acting as a interrupt. OK I understand so much. SPISR is a status register of the state of the IRQ line

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-13 Thread Feng Kan
On Wed, May 13, 2015 at 4:58 AM, Linus Walleij wrote: > On Wed, May 13, 2015 at 4:25 AM, Feng Kan wrote: > >> Marc: >> >> Sorry for top posting. It seems with GIC-400, the get_irqstate is not a >> reliable >> way of accessing the GPIO status. In our case, the gpio interrupt status can >> only be

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-13 Thread Linus Walleij
On Wed, May 13, 2015 at 4:25 AM, Feng Kan wrote: > Marc: > > Sorry for top posting. It seems with GIC-400, the get_irqstate is not a > reliable > way of accessing the GPIO status. In our case, the gpio interrupt status can > only be read correctly with the SPISR register. So it seems we have to

Re: [PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-05-12 Thread Feng Kan
Marc: Sorry for top posting. It seems with GIC-400, the get_irqstate is not a reliable way of accessing the GPIO status. In our case, the gpio interrupt status can only be read correctly with the SPISR register. So it seems we have to go back to the old way of mapping the SPISR portion of the GIC

[PATCH v4 2/3] irqchip: GIC: Add support for irq_{get,set}_irqchip_state

2015-03-18 Thread Marc Zyngier
Add the required hooks for the internal state of an interrupt to be exposed to other subsystems. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic.c | 69 --- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic.