Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755917AbbHYT0y (ORCPT ); Tue, 25 Aug 2015 15:26:54 -0400 Received: from www.linutronix.de ([62.245.132.108]:52310 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbbHYT0x (ORCPT ); Tue, 25 Aug 2015 15:26:53 -0400 Date: Tue, 25 Aug 2015 21:26:20 +0200 (CEST) From: Thomas Gleixner To: Sudeep Holla cc: Shenwei Wang , "shawn.guo@linaro.org" , "jason@lakedaemon.net" , Huang Anson , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources In-Reply-To: <55DC96BA.2020905@arm.com> Message-ID: References: <1440443055-7291-1-git-send-email-shenwei.wang@freescale.com> <55DC3452.3070205@arm.com> <55DC738D.8000302@arm.com> <55DC7FA4.7040902@arm.com> <55DC96BA.2020905@arm.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1788 Lines: 41 On Tue, 25 Aug 2015, Sudeep Holla wrote: > On 25/08/15 15:54, Shenwei Wang wrote: > > You don't really understand what happens after a driver calls > > enable_irq_wake. In suspend state, even the interrupt > > controller itself is powered off. How can you get the system up > > again by just using a SKIP_SET_WAKE. > > Sorry for that, let me try to understand aloud. So you have > irq_{un,}mask function that are called when interrupts are enabled and > disabled. So suppose you have 3 irqs that are enabled and only one of > then is set as wakeup source. > > Now you call enable_irq_wake, you save that in wakeup_sources, fine. > Later when you enter suspend, you save all the 3 active irqs in > saved_irq_mask and over-write cpu2wakeup with wakeup_sources, right? > > All fine, what I am saying is let irq-core know that you want to mask > the 2 non-wakeup irqs you have using MASK_ON_SUSPEND. So when > suspend_device_irqs is called in suspend path, that's done for you > automatically and the cpu2wakeup will have just 1 wakeup enabled which > is what you are doing in suspend callback, right ? I missed that when I reviewed the patch. You are right, it can be simplified. > Now that it's already done for you, you need not do anything extra and > hence just set SKIP_SET_WAKE to do nothing. He still needs the set_wake function to capture the wake enabled interrupts as they are handed over to the low level asm code via imx_gpcv2_get_wakeup_source(). Though they could be read back from the hw registers as well. Thanks, tglx -- 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/