Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031487AbcCQP2o (ORCPT ); Thu, 17 Mar 2016 11:28:44 -0400 Received: from foss.arm.com ([217.140.101.70]:48881 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031465AbcCQP2j (ORCPT ); Thu, 17 Mar 2016 11:28:39 -0400 Subject: Re: [PATCH 08/15] genirq: Add runtime power management support for IRQ chips To: Jon Hunter , Thomas Gleixner , Jason Cooper , =?UTF-8?Q?Beno=c3=aet_Cousson?= , Tony Lindgren , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Stephen Warren , Thierry Reding , Linus Walleij References: <1458224359-32665-1-git-send-email-jonathanh@nvidia.com> <1458224359-32665-9-git-send-email-jonathanh@nvidia.com> <56EAC6E8.1070806@arm.com> <56EAC98A.7090405@nvidia.com> Cc: Kevin Hilman , Geert Uytterhoeven , Grygorii Strashko , Lars-Peter Clausen , linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Marc Zyngier Organization: ARM Ltd Message-ID: <56EACD21.20309@arm.com> Date: Thu, 17 Mar 2016 15:28:33 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <56EAC98A.7090405@nvidia.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2991 Lines: 71 On 17/03/16 15:13, Jon Hunter wrote: > Hi Marc, > > On 17/03/16 15:02, Marc Zyngier wrote: >> Hi Jon, >> >> On 17/03/16 14:19, Jon Hunter wrote: >>> Some IRQ chips may be located in a power domain outside of the CPU >>> subsystem and hence will require device specific runtime power >>> management. In order to support such IRQ chips, add a pointer for a >>> device structure to the irq_chip structure, and if this pointer is >>> populated by the IRQ chip driver and CONFIG_PM is selected in the kernel >>> configuration, then the pm_runtime_get/put APIs for this chip will be >>> called when an IRQ is requested/freed, respectively. >>> >>> When entering system suspend and each interrupt is disabled if there is >>> no wake-up set for that interrupt. For an IRQ chip that utilises runtime >>> power management, print a warning message for each active interrupt that >>> has no wake-up set because these interrupts may be unnecessarily keeping >>> the IRQ chip enabled during system suspend. >>> >>> Signed-off-by: Jon Hunter >>> --- >>> include/linux/irq.h | 5 +++++ >>> kernel/irq/chip.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ >>> kernel/irq/internals.h | 1 + >>> kernel/irq/manage.c | 14 +++++++++++--- >>> kernel/irq/pm.c | 3 +++ >>> 5 files changed, 72 insertions(+), 3 deletions(-) >>> >>> diff --git a/include/linux/irq.h b/include/linux/irq.h >>> index c4de62348ff2..82f36390048d 100644 >>> --- a/include/linux/irq.h >>> +++ b/include/linux/irq.h >>> @@ -315,6 +315,7 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) >>> /** >>> * struct irq_chip - hardware interrupt chip descriptor >>> * >>> + * @parent: pointer to associated device >>> * @name: name for /proc/interrupts >>> * @irq_startup: start up the interrupt (defaults to ->enable if NULL) >>> * @irq_shutdown: shut down the interrupt (defaults to ->disable if NULL) >>> @@ -354,6 +355,7 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) >>> * @flags: chip specific flags >>> */ >>> struct irq_chip { >>> + struct device *parent; >> >> Nit: Please don't call this just "parent". We have parent fields in >> irq_data and irq_domain structures, and they always are a pointer to the >> same type, indicating some form of stacking. Here, we're pointing to a >> different type altogether... >> >> How about calling it "dev", or "device" instead? It would make it much >> clearer that when crossing that pointer, we're in another subsystem >> altogether. > > I will defer to Linus W here, as it was his request we make this > 'parent' and not 'dev'. See ... > > http://marc.info/?l=linux-kernel&m=145035839623442&w=2 Well, that contradicts the way use use the word "parent" in the IRQ subsystem, I guess. I'd settle for parent_device or something along those lines (but keep in mind I'm really bad at naming things). Anyway, enough bikeshedding... ;-) M. -- Jazz is not dead. It just smells funny...