Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756092Ab1DOOjD (ORCPT ); Fri, 15 Apr 2011 10:39:03 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:46717 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755305Ab1DOOjA convert rfc822-to-8bit (ORCPT ); Fri, 15 Apr 2011 10:39:00 -0400 MIME-Version: 1.0 In-Reply-To: <201104150112.24722.rjw@sisk.pl> References: <201104130205.26988.rjw@sisk.pl> <201104150112.24722.rjw@sisk.pl> From: Grant Likely Date: Fri, 15 Apr 2011 08:38:39 -0600 X-Google-Sender-Auth: wbpBHwsrfZSCyOdn1uf9PzNE8lU Message-ID: Subject: Re: [RFC][PATCH] PM: Make power domain callbacks take precedence over subsystem ones To: "Rafael J. Wysocki" Cc: Alan Stern , Linux PM mailing list , Kevin Hilman , LKML , Len Brown , linux-sh@vger.kernel.org, lethal@linux-sh.org, Magnus Damm Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3368 Lines: 68 On Thu, Apr 14, 2011 at 5:12 PM, Rafael J. Wysocki wrote: > On Wednesday, April 13, 2011, Grant Likely wrote: >> On Wed, Apr 13, 2011 at 8:17 AM, Alan Stern wrote: >> > On Wed, 13 Apr 2011, Rafael J. Wysocki wrote: >> > >> >> From: Rafael J. Wysocki >> >> >> >> Change the PM core's behavior related to power domains in such a way >> >> that, if a power domain is defined for a given device, its callbacks >> >> will be executed instead of and not in addition to the device >> >> subsystem's PM callbacks. >> >> >> >> The idea behind the initial implementation of power domains handling >> >> by the PM core was that power domain callbacks would be executed in >> >> addition to subsystem callbacks, so that it would be possible to >> >> extend the subsystem callbacks by using power domains. ?It turns out, >> >> however, that this wouldn't be really convenient in some important >> >> situations. >> >> >> >> For example, there are systems in which power can only be removed >> >> from entire power domains. ?On those systems it is not desirable to >> >> execute device drivers' PM callbacks until it is known that power is >> >> going to be removed from the devices in question, which means that >> >> they should be executed by power domain callbacks rather then by >> >> subsystem (e.g. bus type) PM callbacks, because subsystems generally >> >> have no information about what devices belong to which power domain. >> >> Thus, for instance, if the bus type in question is the platform bus >> >> type, its PM callbacks generally should not be called in addition to >> >> power domain callbacks, because they run device drivers' callbacks >> >> unconditionally if defined. >> > >> > What about systems where it makes sense to execute the subsystem >> > callbacks even if power isn't going to be removed from the device? >> > It's quite possible that the subsystem could reduce the device's power >> > consumption even when the device isn't powered down completely. >> >> The understanding Rafael and I came to was that if a power domain is >> attached to a device, then the power domain becomes the responsible >> party. ?Normally this means it will turn around and immediately call >> the bus_type pm ops, but it has the option to not call them if for a >> particular system it knows better, or to defer calling them. >> >> Basically, if you're using a power domain, it is assumed that the >> power domain has particular knowledge about the system, and it should >> have the option to override the default behaviour. >> >> > >> > Is the extra overhead of invoking the subsystem callback really all >> > that troublesome? >> >> It isn't an overhead problem. ?It's a control & complexity problem. >> We could try to implement a heuristic or api to control when the bus >> type PM ops should be overridden, but I think it is cleaner to make it >> a rule that if you implement a power domain, then that power domain >> becomes responsible for all PM operations. > > Well said. :-) > > I'm taking that as an ACK for my patch if you don't mind. And so you should. g. -- 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/