Re: [PATCH v5 3/4] gpiolib: add irq_not_threaded flag to gpio_chip

2014-09-24 Thread Johan Hovold
On Wed, Sep 24, 2014 at 10:54:51AM +0200, Linus Walleij wrote:
> On Fri, Sep 19, 2014 at 10:22 PM, Octavian Purdila
>  wrote:
> 
> > Some GPIO chips (e.g. the DLN2 USB adapter) have blocking get/set
> > operation but do not need a threaded irq handler.
> >
> > Signed-off-by: Octavian Purdila 
> 
> Usually I don't apply patches adding interfaces with no users, but
> this seems very useful, so patch applied. I guess your driver will
> appear on v3.19+ so then you can rely on this having been merged
> for v3.18.

Octavian, please include this one in any future revision of you series
so that it is self-contained (at least until v3.18-rc1 is out)
nonetheless.

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 3/4] gpiolib: add irq_not_threaded flag to gpio_chip

2014-09-24 Thread Linus Walleij
On Fri, Sep 19, 2014 at 10:22 PM, Octavian Purdila
 wrote:

> Some GPIO chips (e.g. the DLN2 USB adapter) have blocking get/set
> operation but do not need a threaded irq handler.
>
> Signed-off-by: Octavian Purdila 

Usually I don't apply patches adding interfaces with no users, but
this seems very useful, so patch applied. I guess your driver will
appear on v3.19+ so then you can rely on this having been merged
for v3.18.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 3/4] gpiolib: add irq_not_threaded flag to gpio_chip

2014-09-19 Thread Octavian Purdila
Some GPIO chips (e.g. the DLN2 USB adapter) have blocking get/set
operation but do not need a threaded irq handler.

Signed-off-by: Octavian Purdila 
---
 drivers/gpio/gpiolib.c  | 2 +-
 include/linux/gpio/driver.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 15cc0bb..3fa7e73 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -447,7 +447,7 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned 
int irq,
irq_set_lockdep_class(irq, &gpiochip_irq_lock_class);
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
/* Chips that can sleep need nested thread handlers */
-   if (chip->can_sleep)
+   if (chip->can_sleep && !chip->irq_not_threaded)
irq_set_nested_thread(irq, 1);
 #ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index e78a237..44161ac 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -56,6 +56,8 @@ struct seq_file;
  * as the chip access may sleep when e.g. reading out the IRQ status
  * registers.
  * @exported: flags if the gpiochip is exported for use from sysfs. Private.
+ * @irq_not_threaded: flag must be set if @can_sleep is set but the
+ * IRQs don't need to be threaded
  *
  * A gpio_chip can help platforms abstract various sources of GPIOs so
  * they can all be accessed through a common programing interface.
@@ -101,6 +103,7 @@ struct gpio_chip {
struct gpio_desc*desc;
const char  *const *names;
boolcan_sleep;
+   boolirq_not_threaded;
boolexported;
 
 #ifdef CONFIG_GPIOLIB_IRQCHIP
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html