Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755841AbbHYOag (ORCPT ); Tue, 25 Aug 2015 10:30:36 -0400 Received: from mail-by2on0134.outbound.protection.outlook.com ([207.46.100.134]:12153 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751316AbbHYOaf (ORCPT ); Tue, 25 Aug 2015 10:30:35 -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/hUiWpuEeJKYEULwppIZ4ccnUAgABCQ0CAAAkegIAAAI4g Date: Tue, 25 Aug 2015 14:14:58 +0000 Message-ID: References: <1440443055-7291-1-git-send-email-shenwei.wang@freescale.com> <55DC3452.3070205@arm.com> <55DC738D.8000302@arm.com> In-Reply-To: <55DC738D.8000302@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;BLUPR03MB1364;5:xjV8kQHLDKFrTCoyqluvdAwebxyDmxUgLykubYdmUbOwbZcNqmqjoeDc+DYfVohVhJZmfDBGZrLJDfWXQAYjYnjPIfbqpxGNdKFOl6UxVrKM97aGPxBlN6sW4oCQZ5wIbMBg35iqGMowXaobMCk4Ew==;24:enlvKfOlxv5rGGT19jCY99d5lhoMqRTU1q7TSh0VJe29FjeMjerpvToeQrVjl2HOe3hft/cUYPODoKLofNS6c/mm/MvQg96aJUZM9kDXFsc=;20:QvwLf80cfSkqiAPHmzksmMgDd793tu9m+AXjCYiJJbNW92ZOh1yzIsesVq70l5sROessi1BR4dUbktciieAKGA== 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)(5005006)(8121501046)(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)(50986999)(106116001)(106356001)(19580395003)(5004730100002)(5007970100001)(19580405001)(92566002)(105586002)(5002640100001)(2656002)(62966003)(77156002)(93886004)(81156007)(101416001)(110136002)(74316001)(2900100001)(102836002)(5003600100002)(33656002)(40100003)(54356999)(5001960100002)(5001860100001)(2950100001)(46102003)(4001540100001)(99286002)(10400500002)(76576001)(64706001)(77096005)(122556002)(68736005)(66066001)(189998001)(76176999)(87936001)(86362001)(97736004)(5001830100001);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="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2015 14:14:58.4815 (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 t7PEUfAT018572 Content-Length: 3581 Lines: 83 > -----Original Message----- > From: Sudeep Holla [mailto:sudeep.holla@arm.com] > >>> IMX7D contains a new version of GPC IP block (GPCv2). It has two > >>> major > >>> functions: power management and wakeup source management. > >>> This patch adds a new irqchip driver to manage the interrupt wakeup > >>> sources on IMX7D. > >> > >> Interesting, you mention that this IP block has mainly power > >> management and it itself requires save/restore. Is it not in always on > domain ? > > > > Yes, it is in always on domain. > > > > Hmm, then why do you need to save and restore the mask ? The save/restore is used to handle the two different low power states: one is WFI in cpu idle, and the other case is suspend. This has nothing to do with this IP block itself. > >>> When the system is in WFI (wait for interrupt) mode, this GPC block > >>> will be the first block on the platform to be activated and signaled. > >>> Under normal wait mode during cpu idle, the system can be woke up by > >>> +static void gpcv2_wakeup_source_restore(void) { > >>> + struct gpcv2_irqchip_data *cd; > >>> + void __iomem *reg; > >>> + int i; > >>> + > >>> + cd = imx_gpcv2_instance; > >>> + if (!cd) > >>> + return; > >>> + > >>> + for (i = 0; i < IMR_NUM; i++) { > >>> + reg = cd->gpc_base + cd->cpu2wakeup + i * 4; > >>> + writel_relaxed(cd->saved_irq_mask[i], reg); > >> > >> Instead of saving all the non-wakeup sources, can't you use raw > >> save/restore of these registers and mask all the non-wakeup sources > >> by setting MASK_ON_SUSPEND ? > > > > I can't catch what you mean. Can you show me an example? > > > > What I meant is instead of you tracking all the enabled irqs(both wakeup and > non-wakeup) in saved_irq_mask, just set MASK_ON_SUSPEND flag where all the > non-wakeup interrupts are masked on suspend and unmasked on resume by the > irq core. You can then just save and restore the wakeup irq mask, but as I asked > above do you have to do that as you are saying it's in always on domain ? > > >> Also your interrupt controller seems like has no special way to > >> configure wakeups, you are just leaving them enabled. i.e. I see > >> cpu2wakeup used for both {un,}masking and wakeup enable. So you can just > use IRQCHIP_SKIP_SET_WAKE. > >> Correct me if my understanding is wrong. > > > > In this driver, the Core0 is configured to be the default core to be > > woke up, not both. You can configure it to Core1 by changing the > > cpu2wakeup value. I don't see any reason to use IRQCHIP_SKIP_SET_WAKE flag. > > > > I don't see this driver doing anything extra apart from keeping the wakeup irqs > enabled. i.e. You use the same cpu*wake register to mask/unmask the interrupt > as well as set the wakeup source. Since the wakeup interrupt will be enabled by > the driver, you just need to mark it as wake-up source and nothing extra in the > controller right ? > If so, you need to set IRQCHIP_SKIP_SET_WAKE as you are just leaving that irq > enabled and not doing any extra configuration to enable it as wakeup source. > Please correct if that wrong, but from the code that's what I could infer. There is no special for this driver. We just use the IRQCHIP driver framework to manage the wakeup sources. Why did you propose to set IRQCHIP_SKIP_SET_WAKE flag here? If you don't need the wakeup feature, you should just not enable this driver in the configuration. Thanks, Shenwei > Regards, > Sudeep ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?