Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-11-04 Thread Linus Walleij
On Thu, Oct 27, 2016 at 12:42 PM, Jerome Brunet wrote: > Ressource issue : When you create an irq mapping, in case of hierarchic > domain, it calls the "alloc" function of the domain, which will > eventually call the "alloc" function of the parent domain ... until you > reach the "root" domain (h

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-11-04 Thread Linus Walleij
On Wed, Oct 26, 2016 at 5:50 PM, Kevin Hilman wrote: >> Yes they are all wrong. They should all be using irq_find_mapping(). > > So, dumb question from someone trying (but having a hard time) to follow > and understand the rationale... > > If it's wrong enough to completely reject, why are change

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-27 Thread Jerome Brunet
On Wed, 2016-10-26 at 16:44 +0200, Linus Walleij wrote: > On Wed, Oct 26, 2016 at 4:23 PM, Jerome Brunet > wrote: > > > > [Me] > > > > > > We usually refer to the local numberspace on the GPIO controller > > > as "offsets", so line offsets 0...31 on a gpiochip with 31 lines. > > > > > > The ngp

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-26 Thread Kevin Hilman
Hi Linus, Linus Walleij writes: > On Wed, Oct 26, 2016 at 4:22 PM, Jerome Brunet wrote: >> On Tue, 2016-10-25 at 20:20 +0200, Linus Walleij wrote: > >>> However the semantic is such, that it is not necessary to call >>> to_irq() >>> before using an IRQ: the irqchip and gpiochip abstractions sho

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-26 Thread Linus Walleij
On Wed, Oct 26, 2016 at 4:23 PM, Jerome Brunet wrote: > [Me] >> We usually refer to the local numberspace on the GPIO controller >> as "offsets", so line offsets 0...31 on a gpiochip with 31 lines. >> >> The ngpio in struct gpio_chip is the number of lines on that >> controller, >> and should nomi

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-26 Thread Linus Walleij
On Wed, Oct 26, 2016 at 4:22 PM, Jerome Brunet wrote: > On Tue, 2016-10-25 at 20:20 +0200, Linus Walleij wrote: >> However the semantic is such, that it is not necessary to call >> to_irq() >> before using an IRQ: the irqchip and gpiochip abstractions should be >> orthogonal. > > Linus, > > They

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-26 Thread Jerome Brunet
On Tue, 2016-10-25 at 20:20 +0200, Linus Walleij wrote: > On Tue, Oct 25, 2016 at 5:31 PM, Jerome Brunet > wrote: > > > > On Tue, 2016-10-25 at 15:47 +0100, Marc Zyngier wrote: > > > > > > > > > Is gpio_to_irq() supposed to allocate an interrupt? Or merely to > > > report the existence of a ma

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-26 Thread Jerome Brunet
On Tue, 2016-10-25 at 20:10 +0200, Linus Walleij wrote: > On Tue, Oct 25, 2016 at 4:47 PM, Marc Zyngier > wrote: > > > > On 25/10/16 15:22, Jerome Brunet wrote: > > > > > > > > > There is a few problems to guarantee that gpio == hwirq. > > > 1. We have 2 instances of pinctrl, to guarantee that

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Linus Walleij
On Tue, Oct 25, 2016 at 5:31 PM, Jerome Brunet wrote: > On Tue, 2016-10-25 at 15:47 +0100, Marc Zyngier wrote: >> Is gpio_to_irq() supposed to allocate an interrupt? Or merely to >> report the existence of a mapping? It should provide an IRQ corresponding to the gpio line, if possible. However

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Linus Walleij
On Tue, Oct 25, 2016 at 4:47 PM, Marc Zyngier wrote: > On 25/10/16 15:22, Jerome Brunet wrote: >> There is a few problems to guarantee that gpio == hwirq. >> 1. We have 2 instances of pinctrl, to guarantee that the linux gpio >> number == hwirq, we would have to guarantee the order in which they

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Jerome Brunet
On Tue, 2016-10-25 at 15:47 +0100, Marc Zyngier wrote: >  > > > But why are those number different? Why don't you use the same > > > namespace? If gpio == hwirq, all your problems are already > > > solved. If > > > you don't find the mapping in the irqdomain, then there is no > > > irq, > > > end >

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Marc Zyngier
On 25/10/16 15:22, Jerome Brunet wrote: > On Tue, 2016-10-25 at 14:38 +0100, Marc Zyngier wrote: >> On 25/10/16 14:08, Jerome Brunet wrote: >>> >>> On Tue, 2016-10-25 at 11:38 +0100, Marc Zyngier wrote: > > On 25/10/16 10:14, Linus Walleij wrote: > > > On Fri, Oct 21,

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Jerome Brunet
On Tue, 2016-10-25 at 14:38 +0100, Marc Zyngier wrote: > On 25/10/16 14:08, Jerome Brunet wrote: > > > > On Tue, 2016-10-25 at 11:38 +0100, Marc Zyngier wrote: > > > > > > > > > > > > > > On 25/10/16 10:14, Linus Walleij wrote: > > > > > > > > > > > > On Fri, Oct 21, 2016 at 11:06 AM, Jerome

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Marc Zyngier
On 25/10/16 14:08, Jerome Brunet wrote: > On Tue, 2016-10-25 at 11:38 +0100, Marc Zyngier wrote: >>> >> On 25/10/16 10:14, Linus Walleij wrote: >>> >>> On Fri, Oct 21, 2016 at 11:06 AM, Jerome Brunet >> om> wrote: >>> > > Isn't this usecase (also as described in the cover letter) a >>>

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Jerome Brunet
On Tue, 2016-10-25 at 11:38 +0100, Marc Zyngier wrote: > > > On 25/10/16 10:14, Linus Walleij wrote: > > > > On Fri, Oct 21, 2016 at 11:06 AM, Jerome Brunet > om> wrote: > > > > > > > > > > > > > Isn't this usecase (also as described in the cover letter) a > > > > textbook > > > > example of

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Thomas Gleixner
On Tue, 25 Oct 2016, Linus Walleij wrote: > On Fri, Oct 21, 2016 at 11:06 AM, Jerome Brunet wrote: > > >> Isn't this usecase (also as described in the cover letter) a textbook > >> example of when you should be using hierarchical irqdomain? > >> > >> Please check with Marc et al on hierarchical i

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Marc Zyngier
On 25/10/16 10:14, Linus Walleij wrote: > On Fri, Oct 21, 2016 at 11:06 AM, Jerome Brunet wrote: > >>> Isn't this usecase (also as described in the cover letter) a textbook >>> example of when you should be using hierarchical irqdomain? >>> >>> Please check with Marc et al on hierarchical irqdoma

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-25 Thread Linus Walleij
On Fri, Oct 21, 2016 at 11:06 AM, Jerome Brunet wrote: >> Isn't this usecase (also as described in the cover letter) a textbook >> example of when you should be using hierarchical irqdomain? >> >> Please check with Marc et al on hierarchical irqdomains. > > Linus, > Do you mean I should create a

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-21 Thread Jerome Brunet
On Thu, 2016-10-20 at 21:21 +0200, Linus Walleij wrote: > On Wed, Oct 19, 2016 at 12:08 PM, Jerome Brunet > wrote: > > > > > Add the ability for gpio to request irq from the gpio interrupt > > controller > > if present. We have to specificaly that the parent interrupt > > controller is > > the g

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

2016-10-20 Thread Linus Walleij
On Wed, Oct 19, 2016 at 12:08 PM, Jerome Brunet wrote: > Add the ability for gpio to request irq from the gpio interrupt controller > if present. We have to specificaly that the parent interrupt controller is > the gpio interrupt controller because gpio on meson SoCs can't generate > interrupt di