Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607Ab1CKUi4 (ORCPT ); Fri, 11 Mar 2011 15:38:56 -0500 Received: from www.tglx.de ([62.245.132.106]:37100 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754408Ab1CKUiy (ORCPT ); Fri, 11 Mar 2011 15:38:54 -0500 Date: Fri, 11 Mar 2011 21:37:50 +0100 (CET) From: Thomas Gleixner To: Abhijeet Dharmapurikar cc: davidb@codeaurora.org, "David S. Miller" , Andrew Morton , Bryan Huntsman , Daniel Walker , David Collins , Grant Likely , Greg Kroah-Hartman , Joe Perches , Russell King , Samuel Ortiz , Stepan Moskovchenko , Mark Brown , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, LKML Subject: Re: [Qualcomm PM8921 MFD v2 2/6] mfd: pm8xxx: Add irq support In-Reply-To: <4D7A80DD.7000909@codeaurora.org> Message-ID: References: <1299564590-30116-1-git-send-email-adharmap@codeaurora.org> <1299564590-30116-3-git-send-email-adharmap@codeaurora.org> <4D770E47.6050402@codeaurora.org> <4D79A85D.8000301@codeaurora.org> <4D7A71B9.9000306@codeaurora.org> <4D7A80DD.7000909@codeaurora.org> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2706 Lines: 82 On Fri, 11 Mar 2011, Abhijeet Dharmapurikar wrote: > Thomas Gleixner wrote: > > Simply because this kind of misdesigned hardware will creep up over > > and over and we want to handle these cases in the core. Even for a > > sinlge instance like yours solving it in the core is the right thing > > to do, because it's a ~3 lines patch to the core code to get this > > done. > > ~3 lines patch to the code sounds promising. Please tell me how? So I deduce, that your HW has no way to mark the wakeup interrupts. Whack your HW designer on my behalf, please! :) Patch below against: git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git irq/core It's 8 lines, but that's still at least an order of magnitude less than solving this with an workaround. :) Thanks, tglx ----------> Subject: genirq-force-mask-on-suspend.patch From: Thomas Gleixner Date: Fri, 11 Mar 2011 21:22:14 +0100 Signed-off-by: Thomas Gleixner --- include/linux/irq.h | 2 ++ kernel/irq/pm.c | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) Index: linux-2.6-tip/include/linux/irq.h =================================================================== --- linux-2.6-tip.orig/include/linux/irq.h +++ linux-2.6-tip/include/linux/irq.h @@ -330,10 +330,12 @@ struct irq_chip { * * IRQCHIP_SET_TYPE_MASKED: Mask before calling chip.irq_set_type() * IRQCHIP_EOI_IF_HANDLED: Only issue irq_eoi() when irq was handled + * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path */ enum { IRQCHIP_SET_TYPE_MASKED = (1 << 0), IRQCHIP_EOI_IF_HANDLED = (1 << 1), + IRQCHIP_MASK_ON_SUSPEND = (2 << 1), }; /* This include will go away once we isolated irq_desc usage to core code */ Index: linux-2.6-tip/kernel/irq/pm.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/pm.c +++ linux-2.6-tip/kernel/irq/pm.c @@ -68,10 +68,16 @@ int check_wakeup_irqs(void) struct irq_desc *desc; int irq; - for_each_irq_desc(irq, desc) - if (irqd_is_wakeup_set(&desc->irq_data) && - (desc->istate & IRQS_PENDING)) - return -EBUSY; + for_each_irq_desc(irq, desc) { + if (irqd_is_wakeup_set(&desc->irq_data)) { + if (desc->istate & IRQS_PENDING) + return -EBUSY; + continue; + } + if (desc->istate & IRQS_SUSPENDED && + irq_desc_get_chip(desc)->flags & IRQCHIP_MASK_ON_SUSPEND) + mask_irq(desc); + } return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/