Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755936AbbHYUnl (ORCPT ); Tue, 25 Aug 2015 16:43:41 -0400 Received: from mail-bn1on0135.outbound.protection.outlook.com ([157.56.110.135]:12414 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751989AbbHYUnk (ORCPT ); Tue, 25 Aug 2015 16:43:40 -0400 From: Shenwei Wang To: Thomas Gleixner CC: Sudeep Holla , "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 Thread-Topic: [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources Thread-Index: AQHQ3p+6j6/hUiWpuEeJKYEULwppIZ4ccnUAgABCQ0CAAAkegIAAAI4ggAAN2wCAAADbcIAAGqsAgAAvgoCAAARJgIAABh4QgAAGyICAAANSkA== Date: Tue, 25 Aug 2015 20:43:36 +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: 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;BLUPR03MB1364;5:sUy0BJQZn559hPu7h8fBuMJmzygLQ+yf/ePBYgfM6u5twcglB1VbDHCfRClHx5TYvCThVFP6qsgyBTRC24nEJzO+4yoZISzDz4SYtpPy2V3i8B5BrPQZ8euJJmLF4Q4c63p3jDyvBqsMea0WYB0TfA==;24:DFek3nBMANSHGg/Qpl6gtd+CxZU1SZZwJcbe+lpQOvMwaCLKSXt2gyU8PF5Av5medNonNr7lfybNhdHHcLtYTf8DejvFJ1bkUAUqKiIQImY=;20:NOTNus82L4cMY6T24edveh2FkrwUUz0xre6R9t7C9q4CxYd07Q3+C1pxDw5hjyWrXo6GW3elcGcwbExGN/JZRw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1364; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(8121501046)(5005006)(3002001);SRVR:BLUPR03MB1364;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1364; x-forefront-prvs: 06793E740F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(164054003)(13464003)(199003)(189002)(24454002)(50986999)(10400500002)(106116001)(106356001)(92566002)(105586002)(5007970100001)(19580405001)(5004730100002)(5002640100001)(77156002)(62966003)(2656002)(101416001)(19580395003)(81156007)(110136002)(74316001)(2900100001)(54356999)(33656002)(102836002)(5003600100002)(99286002)(40100003)(5001960100002)(5001860100001)(4001540100001)(2950100001)(46102003)(189998001)(122556002)(68736005)(76176999)(64706001)(76576001)(66066001)(86362001)(87936001)(5001830100001)(97736004)(77096005)(93886004);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB1364;H:CY1PR0301MB0843.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="gb2312" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2015 20:43:36.7242 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1364 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 t7PKhkn1020729 Content-Length: 2441 Lines: 64 > -----Original Message----- > From: Thomas Gleixner [mailto:tglx@linutronix.de] > Sent: 2015??8??25?? 15:16 > To: Wang Shenwei-B38339 > Cc: Sudeep Holla; shawn.guo@linaro.org; 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 > sources > > On Tue, 25 Aug 2015, Shenwei Wang wrote: > > > From: Thomas Gleixner [mailto:tglx@linutronix.de] > > > > 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. > > > > > > You have no seperate wakeup source mechanism. All you do is to mask > > > all non wakeup sources and keep the wakeup sources unmask. > > > > > > That's what happens in gpcv2_wakeup_source_save() > > > > > > writel_relaxed(cd->wakeup_sources[i], reg); > > > > > > So it's the same as letting the core mask all non wakeup sources and > > > leave the wakeup sources unmask. > > > > Does it mean an unexpected interrupt may activate the system, and the > > core will let the system go into suspend again if the core determines > > it not a wakeup source? The current design is to ignore all the > > unexpected interrupts in the hardware level. Only the presetting > > wakeup sources can activate the platform. Here power consumption is > > more important. > > Did you actually read, what I wrote? > > The core does in case of MASK_ON_SUSPEND > > for_each_irq() { > if (!irq->wakeupsource) > mask(irq) > } > > That's identical to what you are doing. You just do it differently by saving the > active wakeup sources in your own data structure and then write that info to the > mask register, which leaves only the wakeup sources unmasked. Sorry. I just took a study on the two flags: MASK_ON_SUSPEND and IRQCHIP_SKIP_SET_WAKE. MASK_ON_SUSPEND flag does simply the implementation. IRQCHIP_SKIP_SET_WAKE flag can't be used here because the wakeup sources are required for power management. I will send out a subsequent patch to simply the implementation by using this idea. Thank you Sudeep for the insightful review! Thanks, Shenwei > Thanks, > > tglx ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?