Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754386Ab1CLANT (ORCPT ); Fri, 11 Mar 2011 19:13:19 -0500 Received: from wolverine01.qualcomm.com ([199.106.114.254]:62848 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752047Ab1CLANS (ORCPT ); Fri, 11 Mar 2011 19:13:18 -0500 X-IronPort-AV: E=McAfee;i="5400,1158,6282"; a="79519720" Message-ID: <4D7ABA9D.8070705@codeaurora.org> Date: Fri, 11 Mar 2011 16:13:17 -0800 From: Abhijeet Dharmapurikar User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Thomas Gleixner 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 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> In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2830 Lines: 84 Thomas Gleixner wrote: > 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; > } Awesome. This addresses the suspend/resume concerns. Thanks so much. Reviewed-by: Abhijeet Dharmapurikar To avoid compile time issues, I will add .flags = IRQCHIP_MASK_ON_SUSPEND in my driver at a later time (after this change is pulled in). -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. -- 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/