Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-07-02 Thread Linus Walleij
On Fri, Jun 30, 2017 at 9:54 PM, Grygorii Strashko wrote: > On 06/29/2017 09:16 AM, Linus Walleij wrote: >> On Tue, Jun 27, 2017 at 10:43 PM, Grygorii Strashko >> wrote: >> >>> And my opinion is still the same here - It should be perfectly valid to >>> create >>> mappings from gpio_to_irq() to h

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-30 Thread Grygorii Strashko
On 06/29/2017 09:16 AM, Linus Walleij wrote: > On Tue, Jun 27, 2017 at 10:43 PM, Grygorii Strashko > wrote: > >> And my opinion is still the same here - It should be perfectly valid to >> create >> mappings from gpio_to_irq() to handle properly orthogonality of gpiochip and >> gpio-irqchip fun

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-29 Thread Linus Walleij
On Thu, Jun 29, 2017 at 4:57 PM, Jerome Brunet wrote: > On Thu, 2017-06-29 at 16:14 +0200, Linus Walleij wrote: >> So I changed my mind, it is fine for this type of driver to call >> irq_create_mapping() in gpio_to_irq(). Preferably with some comment >> around the call. > > What about disposing o

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-29 Thread Jerome Brunet
On Thu, 2017-06-29 at 17:53 +0100, Marc Zyngier wrote: > On 29/06/17 15:57, Jerome Brunet wrote: > > On Thu, 2017-06-29 at 16:14 +0200, Linus Walleij wrote: > > > On Tue, Jun 27, 2017 at 8:25 PM, Jerome Brunet > > > wrote: > > > > > > > At the time Linus strongly rejected the idea of > > > > call

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-29 Thread Marc Zyngier
On 29/06/17 15:57, Jerome Brunet wrote: > On Thu, 2017-06-29 at 16:14 +0200, Linus Walleij wrote: >> On Tue, Jun 27, 2017 at 8:25 PM, Jerome Brunet wrote: >> >>> At the time Linus strongly rejected the idea of calling irq_create_mapping >>> (or >>> any sleeping functions) in gpio_to_irq: please s

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-29 Thread Jerome Brunet
On Thu, 2017-06-29 at 16:14 +0200, Linus Walleij wrote: > On Tue, Jun 27, 2017 at 8:25 PM, Jerome Brunet wrote: > > > At the time Linus strongly rejected the idea of calling  irq_create_mapping > > (or > > any sleeping functions) in gpio_to_irq: please see the reply from Oct 26, > > 2016 > > (sor

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-29 Thread Linus Walleij
On Tue, Jun 27, 2017 at 10:43 PM, Grygorii Strashko wrote: > And my opinion is still the same here - It should be perfectly valid to create > mappings from gpio_to_irq() to handle properly orthogonality of gpiochip and > gpio-irqchip functionality and satisfy SPARSE_IRQ goal (allocate Linux virq

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-29 Thread Linus Walleij
On Tue, Jun 27, 2017 at 8:25 PM, Jerome Brunet wrote: > At the time Linus strongly rejected the idea of calling irq_create_mapping > (or > any sleeping functions) in gpio_to_irq: please see the reply from Oct 26, 2016 > (sorry for quoting such an old discussion but this is really the starting

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-27 Thread Grygorii Strashko
On 06/27/2017 01:25 PM, Jerome Brunet wrote: > On Tue, 2017-06-27 at 12:49 -0500, Grygorii Strashko wrote: >> >> On 06/22/2017 09:25 AM, Jerome Brunet wrote: >>> On Wed, 2017-06-21 at 22:50 +0200, Linus Walleij wrote: On Tue, Jun 20, 2017 at 7:23 PM, Jerome Brunet wrote: > On Tue,

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-27 Thread Jerome Brunet
On Tue, 2017-06-27 at 12:49 -0500, Grygorii Strashko wrote: > > On 06/22/2017 09:25 AM, Jerome Brunet wrote: > > On Wed, 2017-06-21 at 22:50 +0200, Linus Walleij wrote: > > > On Tue, Jun 20, 2017 at 7:23 PM, Jerome Brunet > > > wrote: > > > > On Tue, 2017-06-20 at 18:37 +0200, Linus Walleij wrote

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-27 Thread Grygorii Strashko
On 06/22/2017 09:25 AM, Jerome Brunet wrote: > On Wed, 2017-06-21 at 22:50 +0200, Linus Walleij wrote: >> On Tue, Jun 20, 2017 at 7:23 PM, Jerome Brunet wrote: >>> On Tue, 2017-06-20 at 18:37 +0200, Linus Walleij wrote: Eventually gpio_to_irq() should be DELETED and replaced in full with >>

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-22 Thread Jerome Brunet
On Wed, 2017-06-21 at 22:50 +0200, Linus Walleij wrote: > On Tue, Jun 20, 2017 at 7:23 PM, Jerome Brunet wrote: > > On Tue, 2017-06-20 at 18:37 +0200, Linus Walleij wrote: > > > Eventually gpio_to_irq() should be DELETED and replaced in full with > > > the prepare/unprepare calls. > > > > Woahh,

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-21 Thread Linus Walleij
On Tue, Jun 20, 2017 at 7:23 PM, Jerome Brunet wrote: > On Tue, 2017-06-20 at 18:37 +0200, Linus Walleij wrote: >> Eventually gpio_to_irq() should be DELETED and replaced in full with >> the prepare/unprepare calls. > > Woahh, that's not what I meant. gpio_to_irq should stay. Getting rid of it >

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-20 Thread Jerome Brunet
On Tue, 2017-06-20 at 18:37 +0200, Linus Walleij wrote: > On Tue, Jun 20, 2017 at 12:26 PM, Jerome Brunet wrote: > > So I finally understood that what you want is to handle those cases > where gpio_to_irq() is currently in use, and not expand the use of that > function. And that is good. Indeed

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-20 Thread Linus Walleij
On Tue, Jun 20, 2017 at 12:26 PM, Jerome Brunet wrote: So I finally understood that what you want is to handle those cases where gpio_to_irq() is currently in use, and not expand the use of that function. And that is good. > On Tue, 2017-06-20 at 10:39 +0200, Linus Walleij wrote: >> > The fact

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-20 Thread Jerome Brunet
On Tue, 2017-06-20 at 10:39 +0200, Linus Walleij wrote: > On Thu, Jun 15, 2017 at 6:20 PM, Jerome Brunet wrote: > > > To handle this we tried: > > - [0]: To create the mapping in the gpio_to_irq. Linus, you pointed out that > > this is not allowed as gpio_to_irq is callable in irq context, theref

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

2017-06-20 Thread Linus Walleij
On Thu, Jun 15, 2017 at 6:20 PM, Jerome Brunet wrote: > To handle this we tried: > - [0]: To create the mapping in the gpio_to_irq. Linus, you pointed out that > this is not allowed as gpio_to_irq is callable in irq context, therefore it > should not sleep. Actually 3 drivers [2] are calling gpio