From patchwork Wed Sep 8 18:14:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 164101 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o88IJQ8w016926 for ; Wed, 8 Sep 2010 18:19:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910Ab0IHSTZ (ORCPT ); Wed, 8 Sep 2010 14:19:25 -0400 Received: from www.tglx.de ([62.245.132.106]:58213 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912Ab0IHSTX (ORCPT ); Wed, 8 Sep 2010 14:19:23 -0400 Received: from localhost6.localdomain6 (www.tglx.de [127.0.0.1]) by www.tglx.de (8.13.8/8.13.8/TGLX-2007100201) with ESMTP id o88IEEtT006631; Wed, 8 Sep 2010 20:14:14 +0200 Message-Id: <20100908152036.643594727@linutronix.de> User-Agent: quilt/0.47-1 Date: Wed, 08 Sep 2010 18:14:14 -0000 From: Thomas Gleixner To: LKML Cc: Linus Torvalds , Andrew Morton , Ingo Molnar , Peter Zijlstra , Christoph Hellwig , linux-alpha@vger.kernel.org, linux-cris-kernel@axis.com, Haavard Skinnemoen , Tony Luck , linux-ia64@vger.kernel.org, Yoshinori Sato , Hirokazu Takata , Greg Ungerer , Jeff Dike , linux-parisc@vger.kernel.org, Chris Zankel , linux-arch@vger.kernel.org Subject: [RFC trollpatch 1/1] genirq: Remove the fits all and nothing __do_IRQ() code Content-Disposition: inline; filename=genirq-troll-patch.patch X-Virus-Scanned: clamav-milter 0.95.3 at www.tglx.de X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on www.tglx.de Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 08 Sep 2010 18:19:26 +0000 (UTC) Index: linux-2.6/Documentation/DocBook/genericirq.tmpl =================================================================== --- linux-2.6.orig/Documentation/DocBook/genericirq.tmpl +++ linux-2.6/Documentation/DocBook/genericirq.tmpl @@ -147,13 +147,6 @@ use a generic irq-flow implementation for 'level type' interrupts and add a (sub)architecture specific 'edge type' implementation. - - To make the transition to the new model easier and prevent the - breakage of existing implementations, the __do_IRQ() super-handler - is still available. This leads to a kind of duality for the time - being. Over time the new model should be used in more and more - architectures, as it enables smaller and cleaner IRQ subsystems. - Known Bugs And Assumptions @@ -402,28 +395,6 @@ desc->chip->end(); - - __do_IRQ entry point - - The original implementation __do_IRQ() is an alternative entry - point for all types of interrupts. - - - This handler turned out to be not suitable for all - interrupt hardware and was therefore reimplemented with split - functionality for egde/level/simple/percpu interrupts. This is not - only a functional optimization. It also shortens code paths for - interrupts. - - - To make use of the split implementation, replace the call to - __do_IRQ by a call to desc->handle_irq() and associate - the appropriate handler function to desc->handle_irq(). - In most cases the generic handler implementations should - be sufficient. - - - Locking on SMP Index: linux-2.6/Documentation/feature-removal-schedule.txt =================================================================== --- linux-2.6.orig/Documentation/feature-removal-schedule.txt +++ linux-2.6/Documentation/feature-removal-schedule.txt @@ -315,14 +315,6 @@ Who: Dave Jones , Matt ----------------------------- -What: __do_IRQ all in one fits nothing interrupt handler -When: 2.6.32 -Why: __do_IRQ was kept for easy migration to the type flow handlers. - More than two years of migration time is enough. -Who: Thomas Gleixner - ------------------------------ - What: fakephp and associated sysfs files in /sys/bus/pci/slots/ When: 2011 Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to Index: linux-2.6/include/linux/irq.h =================================================================== --- linux-2.6.orig/include/linux/irq.h +++ linux-2.6/include/linux/irq.h @@ -150,7 +150,7 @@ struct irq_2_iommu; * @timer_rand_state: pointer to timer rand state struct * @kstat_irqs: irq stats per cpu * @irq_2_iommu: iommu with this irq - * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] + * @handle_irq: highlevel irq-events handler * @chip: low level interrupt hardware access * @msi_desc: MSI descriptor * @handler_data: per-IRQ data for the irq_chip methods @@ -294,28 +294,12 @@ extern void handle_bad_irq(unsigned int extern void handle_nested_irq(unsigned int irq); /* - * Monolithic do_IRQ implementation. - */ -#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ -extern unsigned int __do_IRQ(unsigned int irq); -#endif - -/* * Architectures call this to let the generic IRQ layer - * handle an interrupt. If the descriptor is attached to an - * irqchip-style controller then we call the ->handle_irq() handler, - * and it calls __do_IRQ() if it's attached to an irqtype-style controller. + * handle an interrupt. */ static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc) { -#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ desc->handle_irq(irq, desc); -#else - if (likely(desc->handle_irq)) - desc->handle_irq(irq, desc); - else - __do_IRQ(irq); -#endif } static inline void generic_handle_irq(unsigned int irq) Index: linux-2.6/kernel/irq/handle.c =================================================================== --- linux-2.6.orig/kernel/irq/handle.c +++ linux-2.6/kernel/irq/handle.c @@ -426,117 +426,6 @@ irqreturn_t handle_IRQ_event(unsigned in return retval; } -#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ - -#ifdef CONFIG_ENABLE_WARN_DEPRECATED -# warning __do_IRQ is deprecated. Please convert to proper flow handlers -#endif - -/** - * __do_IRQ - original all in one highlevel IRQ handler - * @irq: the interrupt number - * - * __do_IRQ handles all normal device IRQ's (the special - * SMP cross-CPU interrupts have their own specific - * handlers). - * - * This is the original x86 implementation which is used for every - * interrupt type. - */ -unsigned int __do_IRQ(unsigned int irq) -{ - struct irq_desc *desc = irq_to_desc(irq); - struct irqaction *action; - unsigned int status; - - kstat_incr_irqs_this_cpu(irq, desc); - - if (CHECK_IRQ_PER_CPU(desc->status)) { - irqreturn_t action_ret; - - /* - * No locking required for CPU-local interrupts: - */ - if (desc->chip->ack) - desc->chip->ack(irq); - if (likely(!(desc->status & IRQ_DISABLED))) { - action_ret = handle_IRQ_event(irq, desc->action); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - } - desc->chip->end(irq); - return 1; - } - - raw_spin_lock(&desc->lock); - if (desc->chip->ack) - desc->chip->ack(irq); - /* - * REPLAY is when Linux resends an IRQ that was dropped earlier - * WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - status |= IRQ_PENDING; /* we _want_ to handle it */ - - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { - action = desc->action; - status &= ~IRQ_PENDING; /* we commit to handling */ - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; - - /* - * If there is no IRQ handler or it was disabled, exit early. - * Since we set PENDING, if another processor is handling - * a different instance of this same irq, the other processor - * will take care of it. - */ - if (unlikely(!action)) - goto out; - - /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. - */ - for (;;) { - irqreturn_t action_ret; - - raw_spin_unlock(&desc->lock); - - action_ret = handle_IRQ_event(irq, action); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - - raw_spin_lock(&desc->lock); - if (likely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } - desc->status &= ~IRQ_INPROGRESS; - -out: - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - desc->chip->end(irq); - raw_spin_unlock(&desc->lock); - - return 1; -} -#endif - void early_init_irq_lock_class(void) { struct irq_desc *desc;