Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031314AbcCQPN2 (ORCPT ); Thu, 17 Mar 2016 11:13:28 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:19359 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031279AbcCQPNX (ORCPT ); Thu, 17 Mar 2016 11:13:23 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 17 Mar 2016 08:11:51 -0700 Subject: Re: [PATCH 08/15] genirq: Add runtime power management support for IRQ chips To: Marc Zyngier , 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> CC: Kevin Hilman , Geert Uytterhoeven , Grygorii Strashko , Lars-Peter Clausen , , , , From: Jon Hunter Message-ID: <56EAC98A.7090405@nvidia.com> Date: Thu, 17 Mar 2016 15:13:14 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56EAC6E8.1070806@arm.com> X-Originating-IP: [10.21.132.114] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL101.nvidia.com (10.26.138.13) 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: 2723 Lines: 66 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 > I'll come back to the rest of the patch a bit later, but I wanted to put > that one out right away... ;-) Thanks, Jon