Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752243AbcDUJTV (ORCPT ); Thu, 21 Apr 2016 05:19:21 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:9366 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751751AbcDUJTQ (ORCPT ); Thu, 21 Apr 2016 05:19:16 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 21 Apr 2016 02:19:04 -0700 Subject: Re: [PATCH V2 07/14] genirq: Add runtime power management support for IRQ chips To: Kevin Hilman References: <1461150237-15580-1-git-send-email-jonathanh@nvidia.com> <1461150237-15580-8-git-send-email-jonathanh@nvidia.com> <7h37qgb3xi.fsf@baylibre.com> CC: Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , "Pawel Moll" , Mark Rutland , Ian Campbell , Kumar Gala , "Stephen Warren" , Thierry Reding , Geert Uytterhoeven , Grygorii Strashko , Lars-Peter Clausen , "Linus Walleij" , , , , From: Jon Hunter Message-ID: <57189B09.4030402@nvidia.com> Date: Thu, 21 Apr 2016 10:19:05 +0100 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: <7h37qgb3xi.fsf@baylibre.com> X-Originating-IP: [10.21.132.108] 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: 1251 Lines: 43 On 20/04/16 18:11, Kevin Hilman wrote: > Jon Hunter writes: > >> 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. >> >> Signed-off-by: Jon Hunter > > [...] > >> @@ -1891,10 +1906,18 @@ int setup_percpu_irq(unsigned int irq, struct irqaction *act) >> >> if (!desc || !irq_settings_is_per_cpu_devid(desc)) >> return -EINVAL; >> + >> + retval = irq_chip_pm_get(&desc->irq_data); >> + if (retval < 0) >> + return retval; >> + >> chip_bus_lock(desc); >> retval = __setup_irq(irq, desc, act); >> chip_bus_sync_unlock(desc); >> >> + if (retval) >> + irq_chip_pm_get(&desc->irq_data); >> + > > Shouldn't this one be a _put() ? Good grief! Yes it should. Sorry, will fix :-( > Otherwise, LGTM > > Reviewed-by: Kevin Hilman Thanks! Jon