Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754762AbbKLPid (ORCPT ); Thu, 12 Nov 2015 10:38:33 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:7579 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752089AbbKLPib (ORCPT ); Thu, 12 Nov 2015 10:38:31 -0500 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 12 Nov 2015 07:36:12 -0800 Subject: Re: [RFC PATCH 1/2] genirq: Add runtime resume/suspend support for IRQ chips To: Lars-Peter Clausen , Grygorii Strashko , Thomas Gleixner References: <1447166377-19707-1-git-send-email-jonathanh@nvidia.com> <1447166377-19707-2-git-send-email-jonathanh@nvidia.com> <56421421.8070807@nvidia.com> <56421FA5.4020801@ti.com> <56423245.1040602@metafoo.de> <564314D9.9040502@nvidia.com> <564361AE.4070303@ti.com> <5644710D.7080108@nvidia.com> <5644920C.8080007@metafoo.de> <5644959D.2020207@nvidia.com> <5644986B.5030901@metafoo.de> <56449BF0.9090408@nvidia.com> <5644A418.2020906@metafoo.de> CC: Jason Cooper , Marc Zyngier , Stephen Warren , Thierry Reding , Kevin Hilman , "Geert Uytterhoeven" , LKML , , Soren Brinkmann , Linus Walleij , Alexandre Courbot From: Jon Hunter Message-ID: <5644B26F.5060508@nvidia.com> Date: Thu, 12 Nov 2015 15:38:23 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5644A418.2020906@metafoo.de> X-Originating-IP: [10.21.132.159] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) 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: 1997 Lines: 47 On 12/11/15 14:37, Lars-Peter Clausen wrote: > On 11/12/2015 03:02 PM, Jon Hunter wrote: > [...] >>>>> One easy way out might be to always call pm_get/pm_but from >>>>> bus_lock,/bus_unlock. This way the chip is guaranteed to be powered up when >>>>> accessed happens. In addition pm_get is called when the IRQ is request and >>>>> pm_put is called when the IRQ is release, this is to ensure the chip stays >>>>> powered when it is actively monitoring the IRQ lines. >>>> >>>> Yes I had thought about that, but it is not quite that easy, because in >>>> the case of request_irq() you don't want to pm_put() after the >>>> bus_unlock(). However, the bus_lock/unlock() are good indicators of >>>> different paths. >>> >>> You'd call pm_get() twice in request_irq() once from bus_lock() and once >>> independently, that way you still have a reference even after the bus_unlock(). >> >> Yes that is a possibility. However, there are places such as >> show_interrupts() (kernel/irq/proc.c) and irq_gc_suspend() that do not >> call bus_lock/unlock() which would need to be handled for PM. May be >> these should also call bus_lock() as well? > > show_interrupts() only accesses software state, not hardware state, or does it? Good point. Today there only appears to be one user: arch/powerpc/sysdev/fsl_msi.c: .irq_print_chip = fsl_msi_print_chip, This one is purely software. However, it would be easy to handle the show_interrupts case if needed. > suspend/resume is a bit tricky. It's kind of driver specific if it needs to > actually access the hardware or whether the state is already shadowed in > software. Maybe we can make this an exception for now and let drivers handle > this on their own. Yes I would agree with you on that. Cheers Jon -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/