Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932543AbbEHU0N (ORCPT ); Fri, 8 May 2015 16:26:13 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:34273 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932239AbbEHU0K (ORCPT ); Fri, 8 May 2015 16:26:10 -0400 From: Kevin Hilman To: Geert Uytterhoeven Cc: Alan Stern , Magnus Damm , Linux-sh list , Jason Cooper , Geert Uytterhoeven , Linux PM list , "linux-kernel\@vger.kernel.org" , Simon Horman , Thomas Gleixner Subject: Re: [PATCH/RFC 00/03] irqchip: renesas-irqc: Fine grained Runtime PM support References: Date: Fri, 08 May 2015 13:26:06 -0700 In-Reply-To: (Geert Uytterhoeven's message of "Thu, 23 Apr 2015 19:49:59 +0200") Message-ID: <7hmw1ehl41.fsf@deeprootsystems.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1705 Lines: 39 Geert Uytterhoeven writes: > On Thu, Apr 23, 2015 at 4:44 PM, Alan Stern wrote: >> On Thu, 23 Apr 2015, Geert Uytterhoeven wrote: >>> >> I'm afraid you can't call pm_runtime_get_sync() from these methods, as >>> >> they may be called from interrupt context. >>> > >>> > Ouch. I know the clock framework has prepare/enable separated with >>> > context, but with the irqchip callbacks I suppose no such separation >>> >>> It's not the clock operations, but the pm_runtime operations that cannot be >>> called from interrupt context. >> >> In fact the pm_runtime operations _can_ be called from interrupt >> context, provided the driver has first invoked pm_runtime_irq_safe(). >> Of course, this requires that none of the runtime-PM callback routines >> ever sleep or perform a blocking operation. >> >> This is all explained in Documentation/power/runtime_pm.txt (search for >> "irq_safe"). > > Perhaps that can help. We'll have to give it a try... > > I've always found this a bit strange when PM Domains are involved: > pm_runtime_irq_safe(dev) applies to device dev, while the actual callbacks > belong to the PM Domain code (the device's driver doesn't have any). Currently PM domains don't support IRQ-safe devices very well. Any irq_safe devices will prevent the entire PM domain from ever powering off. There is some on-going work for this but it requires reworking the genpd locking a bit. Kevin -- 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/