Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754155Ab1EKTLh (ORCPT ); Wed, 11 May 2011 15:11:37 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:43334 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450Ab1EKTLg (ORCPT ); Wed, 11 May 2011 15:11:36 -0400 From: "Rafael J. Wysocki" To: Jonathan Corbet Subject: Re: [PATCH 3/5] PM: Support for system-wide power transitions in generic power domains Date: Wed, 11 May 2011 21:11:50 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.39-rc7+; KDE/4.6.0; x86_64; ; ) Cc: Linux PM mailing list , Greg KH , LKML , Kevin Hilman , Grant Likely , Magnus Damm , linux-sh@vger.kernel.org, MyungJoo Ham , Guennadi Liakhovetski References: <201104290154.12966.rjw@sisk.pl> <201105082324.19674.rjw@sisk.pl> <20110511111732.2f75713a@bike.lwn.net> In-Reply-To: <20110511111732.2f75713a@bike.lwn.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105112111.50740.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1311 Lines: 38 On Wednesday, May 11, 2011, Jonathan Corbet wrote: > Hi, Rafael, > > One small question that came to mind as I was looking at this patch: > > > +/** > > + * pm_genpd_powered_down - Check if power has been removed from a power domain. > > + * @genpd: Power domain to check. > > + */ > > +static bool pm_genpd_powered_down(struct generic_power_domain *genpd) > > +{ > > + bool ret; > > + > > + mutex_lock(&genpd->lock); > > + ret = genpd->power_is_off; > > + mutex_unlock(&genpd->lock); > > + > > + return ret; > > I'm not quite sure why this function exists? The lock doesn't really > change anything, since the power state can change before or after this > check regardless. If you need the power state to be stable, it seems like > the lock needs to be taken further up the stack; otherwise simply checking > genpd->power_is_off directly would seem to be sufficient. Am I missing > something? No, you aren't. :-) In fact, the function doesn't exist any more in the most recent version of the patch: https://patchwork.kernel.org/patch/775412/ Thanks, 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/