From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752525AbaILHJZ (ORCPT ); Fri, 12 Sep 2014 03:09:25 -0400 Received: from mail.karo-electronics.de ([81.173.242.67]:49353 "EHLO mail.karo-electronics.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226AbaILHJX convert rfc822-to-8bit (ORCPT ); Fri, 12 Sep 2014 03:09:23 -0400 Date: Fri, 12 Sep 2014 09:09:18 +0200 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Bryan Wu Cc: Linux LED Subsystem , lkml , Richard Purdie Subject: Re: [PATCH 2/2] leds: trigger: gpio: make ledtrig-gpio useable with GPIO drivers requiring threaded irqs Message-ID: <20140912090918.6e860198@ipc1.ka-ro> In-Reply-To: References: <1410248433-24005-1-git-send-email-LW@KARO-electronics.de> <1410248433-24005-3-git-send-email-LW@KARO-electronics.de> Organization: Ka-Ro electronics GmbH X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Bryan Wu wrote: > On Tue, Sep 9, 2014 at 12:40 AM, Lothar Waßmann wrote: > > When trying to use the LED GPIO trigger with e.g. the PCA953x GPIO > > driver, request_irq() fails with -EINVAL, because the GPIO driver > > requires a nested interrupt handler. > > > > Use request_any_context_irq() to be able to use any GPIO driver as LED > > trigger. > > > > Hmmm, what about use request_thread_irq() and put the gpio_trig_work() > in as the thread_func. > > Felipe, can you take a look at this? > > Also in the first patch: > Actually in gpio_trig_irq(), it said: > /* just schedule_work since gpio_get_value can sleep */ > schedule_work(&gpio_data->work); > > Then that means we need to call gpio_get_value_can_sleep() in the > gpio_trig_work() instead of gpio_get_value(), right? > That's exactly what my first patch does! Lothar Waßmann -- ___________________________________________________________ Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10 Geschäftsführer: Matthias Kaussen Handelsregistereintrag: Amtsgericht Aachen, HRB 4996 www.karo-electronics.de | info@karo-electronics.de ___________________________________________________________