From patchwork Fri Mar 19 08:38:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: christian pellegrin X-Patchwork-Id: 86899 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2J8fKqh004731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Mar 2010 08:41:56 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NsXlg-0003Bz-AD; Fri, 19 Mar 2010 08:41:20 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NsXle-0003Bm-O6 for spi-devel-general@lists.sourceforge.net; Fri, 19 Mar 2010 08:41:18 +0000 Received-SPF: pass (sfi-mx-1.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.221.180 as permitted sender) client-ip=209.85.221.180; envelope-from=chripell@gmail.com; helo=mail-qy0-f180.google.com; Received: from mail-qy0-f180.google.com ([209.85.221.180]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NsXld-0007N0-Ov for spi-devel-general@lists.sourceforge.net; Fri, 19 Mar 2010 08:41:18 +0000 Received: by qyk10 with SMTP id 10so1763921qyk.6 for ; Fri, 19 Mar 2010 01:41:12 -0700 (PDT) Received: by 10.224.6.206 with SMTP id a14mr63484qaa.323.1268988071798; Fri, 19 Mar 2010 01:41:11 -0700 (PDT) Received: from localhost (host126-57-dynamic.4-87-r.retail.telecomitalia.it [87.4.57.126]) by mx.google.com with ESMTPS id 21sm589864qyk.13.2010.03.19.01.41.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Mar 2010 01:41:10 -0700 (PDT) From: Christian Pellegrin To: feng.tang@intel.com, akpm@linux-foundation.org, greg@kroah.com, david-b@pacbell.net, grant.likely@secretlab.ca, alan@lxorguk.ukuu.org.uk, spi-devel-general@lists.sourceforge.net, linux-serial@vger.kernel.org Date: Fri, 19 Mar 2010 09:38:54 +0100 Message-Id: <1268987934-22690-1-git-send-email-chripell@fsfe.org> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: References: X-Spam-Score: -0.8 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.8 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NsXld-0007N0-Ov Cc: Christian Pellegrin Subject: [spi-devel-general] [PATCH 1/3] max3100: added raise_threaded_irq X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 19 Mar 2010 08:41:57 +0000 (UTC) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 75f3f00..14c0c13 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -144,6 +144,9 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler, static inline void exit_irq_thread(void) { } #endif +extern int raise_threaded_irq(unsigned int irq); + + extern void free_irq(unsigned int, void *); struct device; diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index eb6078c..a7d21e0 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1088,3 +1088,30 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler, return retval; } EXPORT_SYMBOL(request_threaded_irq); + +/** + * raise_threaded_irq - triggers a threded interrupt + * @irq: Interrupt line to trigger + */ +int raise_threaded_irq(unsigned int irq) +{ + struct irq_desc *desc = irq_to_desc(irq); + struct irqaction *action; + + if (!desc) + return -ENOENT; + action = desc->action; + if (!action) + return -ENOENT; + if (unlikely(!action->thread_fn)) + return -EINVAL; + if (likely(!test_bit(IRQTF_DIED, + &action->thread_flags))) { + set_bit(IRQTF_RUNTHREAD, &action->thread_flags); + wake_up_process(action->thread); + } else { + return -ECHILD; + } + return 0; +} +EXPORT_SYMBOL(raise_threaded_irq);