Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755785AbbHYTYd (ORCPT ); Tue, 25 Aug 2015 15:24:33 -0400 Received: from mail-bn1on0143.outbound.protection.outlook.com ([157.56.110.143]:61792 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752418AbbHYTYc (ORCPT ); Tue, 25 Aug 2015 15:24:32 -0400 From: Shenwei Wang To: Sudeep Holla CC: "shawn.guo@linaro.org" , "tglx@linutronix.de" , "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 Thread-Topic: [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources Thread-Index: AQHQ3p+6j6/hUiWpuEeJKYEULwppIZ4ccnUAgABCQ0CAAAkegIAAAI4ggAAN2wCAAADbcIAAGqsAgAAvgoA= Date: Tue, 25 Aug 2015 19:24:28 +0000 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> In-Reply-To: <55DC96BA.2020905@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Shenwei.Wang@freescale.com; x-originating-ip: [192.88.168.50] x-microsoft-exchange-diagnostics: 1;BN3PR03MB1367;5:PorWrgecdtsdQYBV9R3kSND7hcbuPxGL86+JdKMiTB0rCrLsJrkUjRkPniNaSiZPGUj/ssXKLOlN0TSZVVd9d3yGvlI7gqIZZXEH6UpDEu3DDgJ72hwaxArjni2Yot3a6G+GYkZUXf1jvMYsRNvZfA==;24:3lsuOGVM/cuvZS/kqPOCePJV27ykcpmhYGUCuagGeujBdo5PQL3yZxdUZE2q/fp70kBRcGIk9/5qjNtmhoa61tC+QZYzeb+IIbY0fpi7CAE=;20:rZT+DEW/vVWF9LhfOFpvUbOa0FEdYppBHgVKkRquID8RqRqJuLBO6VrxFJ5Jfdz5LgQ3H+3FAbGhklKTpMNDhQ== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1367; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(8121501046)(3002001);SRVR:BN3PR03MB1367;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1367; x-forefront-prvs: 06793E740F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(13464003)(189002)(92566002)(76576001)(10400500002)(19580405001)(5001860100001)(86362001)(46102003)(62966003)(102836002)(64706001)(77156002)(77096005)(2900100001)(5002640100001)(5007970100001)(66066001)(2950100001)(93886004)(5004730100002)(106356001)(122556002)(106116001)(101416001)(5001920100001)(99286002)(74316001)(87936001)(105586002)(76176999)(68736005)(33656002)(5001830100001)(5001960100002)(4001540100001)(5003600100002)(189998001)(40100003)(97736004)(2656002)(110136002)(54356999)(50986999)(81156007)(19580395003);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1367;H:CY1PR0301MB0843.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2015 19:24:28.6950 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1367 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t7PJOcoN020262 Content-Length: 2858 Lines: 72 > -----Original Message----- > From: Sudeep Holla [mailto:sudeep.holla@arm.com] > Sent: 2015年8月25日 11:24 > To: Wang Shenwei-B38339 > Cc: Sudeep Holla; shawn.guo@linaro.org; tglx@linutronix.de; > jason@lakedaemon.net; Huang Yongcai-B20788; 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 > > > > 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 ? /* * Hardware which has no wakeup source configuration facility * requires that the non wakeup interrupts are masked at the * chip level. The chip implementation indicates that with * IRQCHIP_MASK_ON_SUSPEND. */ if (irq_desc_get_chip(desc)->flags & IRQCHIP_MASK_ON_SUSPEND) mask_irq(desc); IRQCHIP_MASK_ON_SUSPEND flag is for the hardware that has no wakeup source capability. This GPCv2 block is designed to manage the wakeup source, so the flag does not make any sense. > Now that it's already done for you, you need not do anything extra and hence just > set SKIP_SET_WAKE to do nothing. static int set_irq_wake_real(unsigned int irq, unsigned int on) { struct irq_desc *desc = irq_to_desc(irq); int ret = -ENXIO; if (irq_desc_get_chip(desc)->flags & IRQCHIP_SKIP_SET_WAKE) return 0; if (desc->irq_data.chip->irq_set_wake) ret = desc->irq_data.chip->irq_set_wake(&desc->irq_data, on); return ret; } >From the codes above, if a irqchip can not handle the wakeup sources, it can set SKIP flag. This driver is intended to manage the wakeup sources, what's the reason to skip here? Regards, Shenwei > Hope this clarifies, sorry if I am still missing to understand something here, but I > don't see anything. Let me know. > > Regards, > Sudeep ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?