Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754337Ab0AVUzk (ORCPT ); Fri, 22 Jan 2010 15:55:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753947Ab0AVUzj (ORCPT ); Fri, 22 Jan 2010 15:55:39 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:40972 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752689Ab0AVUzh (ORCPT ); Fri, 22 Jan 2010 15:55:37 -0500 From: "Rafael J. Wysocki" To: Alan Stern Subject: Re: [PATCH 1/2] PM / Runtime: Add sysfs switch for disabling device run-time PM (rev. 2) Date: Fri, 22 Jan 2010 21:56:25 +0100 User-Agent: KMail/1.12.3 (Linux/2.6.33-rc4-rjw; KDE/4.3.3; x86_64; ; ) Cc: pm list , LKML , Jesse Barnes , Matthew Garrett , Greg KH References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201001222156.25529.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2027 Lines: 48 On Friday 22 January 2010, Alan Stern wrote: > On Thu, 21 Jan 2010, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > Add new device sysfs attribute, power/control, allowing the user > > space to block the run-time power management of devices. If this > > attribute is set to "on", the driver of the device won't be able to power > > manage it at run time (without breaking the rules) and the device will > > always be in the full power state (except when the entire system goes > > into a sleep state). > > ... > > > --- linux-2.6.orig/drivers/base/power/power.h > > +++ linux-2.6/drivers/base/power/power.h > > @@ -2,11 +2,15 @@ > > > > extern void pm_runtime_init(struct device *dev); > > extern void pm_runtime_remove(struct device *dev); > > +extern void pm_runtime_allow(struct device *dev); > > +extern void pm_runtime_forbid(struct device *dev); > > Can you write a follow-up patch that moves these declarations to a > public header file like include/linux/pm_runtime.h and EXPORTs the two > new routines? It is sometimes useful for drivers to be able to call > the routines directly. I can put them in there in this patch just as well, but I'm not sure it's the right thing to do. > For example, we disable runtime PM for most USB devices by default. > But a few drivers may know that their devices are able to handle it, so > they want to change the default setting when they are bound. Runtime PM is disabled for all devices by default unless the driver enables it. The setting in power/control is to override the driver's choice, so that it can be disabled even if the driver tries to enable it. IOW, the user space is the owner of the power.runtime_auto flag and I don't think we should allow drivers to modify it. Rafael -- 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/