mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	Kevin Hilman <khilman@ti.com>,
	jean.pihet@newoldbits.com
Subject: Re: [PATCH 2/7] PM / Domains: Make it possible to use per-device .active_wakeup()
Date: Wed, 9 Nov 2011 09:52:18 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.1111090818060.24340@axis700.grange> (raw)
In-Reply-To: <201111082140.00876.rjw@sisk.pl>

On Tue, 8 Nov 2011, Rafael J. Wysocki wrote:

> On Tuesday, November 08, 2011, Guennadi Liakhovetski wrote:
> > On Mon, 7 Nov 2011, Rafael J. Wysocki wrote:
> > 
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > 
> > > The current generic PM domains code requires that the same
> > > .active_wakeup() device callback routine be used for all devices in
> > > the given domain, which is inflexible and may not cover some specific
> > > use cases.  For this reason, make it possible to use device specific
> > > .active_wakeup() callback routines by adding a corresponding callback
> > > pointer to struct generic_pm_domain_data.  To reduce code duplication
> > > use struct gpd_dev_ops to represent PM domain device callbacks as
> > > well as device-specific ones and add a macro for defining routines
> > > that will execute those callbacks.
> > > 
> > > Modify the shmobile's power domains code to allow drivers to use
> > > their own .active_wakeup() callback routines.
> > > 
> > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > > ---
> > >  arch/arm/mach-shmobile/pm-sh7372.c |   11 ++++---
> > >  drivers/base/power/domain.c        |   54 ++++++++++++++++++-------------------
> > >  include/linux/pm_domain.h          |   15 ++++------
> > >  3 files changed, 41 insertions(+), 39 deletions(-)
> > > 
> > > Index: linux/include/linux/pm_domain.h
> > > ===================================================================
> > > --- linux.orig/include/linux/pm_domain.h
> > > +++ linux/include/linux/pm_domain.h
> > > @@ -23,6 +23,12 @@ struct dev_power_governor {
> > >  	bool (*power_down_ok)(struct dev_pm_domain *domain);
> > >  };
> > >  
> > > +struct gpd_dev_ops {
> > > +	int (*start)(struct device *dev);
> > > +	int (*stop)(struct device *dev);
> > > +	bool (*active_wakeup)(struct device *dev);
> > > +};
> > > +
> > >  struct generic_pm_domain {
> > >  	struct dev_pm_domain domain;	/* PM domain operations */
> > >  	struct list_head gpd_list_node;	/* Node in the global PM domains list */
> > > @@ -45,9 +51,7 @@ struct generic_pm_domain {
> > >  	bool dev_irq_safe;	/* Device callbacks are IRQ-safe */
> > >  	int (*power_off)(struct generic_pm_domain *domain);
> > >  	int (*power_on)(struct generic_pm_domain *domain);
> > > -	int (*start_device)(struct device *dev);
> > > -	int (*stop_device)(struct device *dev);
> > > -	bool (*active_wakeup)(struct device *dev);
> > > +	struct gpd_dev_ops dev_ops;
> > 
> > Wouldn't it be better to merge patches 1 and 2?
> 
> First, why would it?

Because (1) AFAICS both these patches add new logically rather close to 
each other methods to the same existing API, and (2) it would reduce the 
total changed lines count and simplify reading of the patch(es), because 
your second patch moves around and modifies lines of code, that the first 
patch adds.

> Second, why does it matter?

See above.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

  reply	other threads:[~2011-11-09  8:52 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07  0:01 [PATCH 0/7] PM / Domains: Per-device callbacks and PM QoS Rafael J. Wysocki
2011-11-07  0:06 ` [PATCH 1/7] PM / Domains: Make it possible to use per-device start/stop routines Rafael J. Wysocki
2011-11-08  9:30   ` Guennadi Liakhovetski
2011-11-08 20:38     ` Rafael J. Wysocki
2011-11-07  0:06 ` [PATCH 2/7] PM / Domains: Make it possible to use per-device .active_wakeup() Rafael J. Wysocki
2011-11-08 10:27   ` Guennadi Liakhovetski
2011-11-08 20:40     ` Rafael J. Wysocki
2011-11-09  8:52       ` Guennadi Liakhovetski [this message]
2011-11-09 22:40         ` Rafael J. Wysocki
2011-11-09 23:02           ` Guennadi Liakhovetski
2011-11-07  0:07 ` [PATCH 3/7] PM / Domains: Introduce "save/restore state" device callbacks Rafael J. Wysocki
2011-11-07  0:08 ` [PATCH 4/7] PM / Domains: Rework system suspend callback routines Rafael J. Wysocki
2012-02-17 19:29   ` Pavel Machek
2012-02-17 21:01     ` Rafael J. Wysocki
2011-11-07  0:08 ` [PATCH 5/7] PM / Domains: Add device stop governor function (v3) Rafael J. Wysocki
2011-11-07  0:09 ` [PATCH 6/7] PM / Domains: Add default power off " Rafael J. Wysocki
2011-11-07  0:10 ` [PATCH 7/7] PM / Domains: Automatically update overoptimistic latency information Rafael J. Wysocki
2011-11-14  0:22 ` [update][PATCH 0/7] PM / Domains: Per-device callbacks and PM QoS Rafael J. Wysocki
2011-11-14  0:23   ` [update][PATCH 1/7] PM / Domains: Make it possible to use per-device domain callbacks Rafael J. Wysocki
2011-11-14  0:24   ` [update][PATCH 2/7] PM / Domains: Introduce "save/restore state" device callbacks Rafael J. Wysocki
2011-11-14  0:25   ` [update][PATCH 3/7] PM / Domains: Rework system suspend callback routines Rafael J. Wysocki
2011-11-14  0:26   ` [update][PATCH 4/7] PM / Runtime: Use device PM QoS constraints Rafael J. Wysocki
2011-11-14  0:27   ` [update][PATCH 5/7] PM / Domains: Add device stop governor function (v4) Rafael J. Wysocki
2011-11-14  0:27   ` [update][PATCH 6/7] PM / Domains: Add default power off " Rafael J. Wysocki
2011-11-14  0:28   ` [update][PATCH 7/7] PM / Domains: Automatically update overoptimistic latency information Rafael J. Wysocki
2011-11-19 13:56   ` [Update 2x][PATCH 0/7] PM / Domains: Per-device callbacks and PM QoS Rafael J. Wysocki
2011-11-19 13:58     ` [Update 2x][PATCH 1/7] PM / Domains: Make it possible to use per-device domain callbacks Rafael J. Wysocki
2011-11-19 13:59     ` [Update 2x][PATCH 2/7] PM / Domains: Introduce "save/restore state" device callbacks Rafael J. Wysocki
2011-11-19 13:59     ` [Update 2x][PATCH 3/7] PM / Domains: Rework system suspend callback routines Rafael J. Wysocki
2011-11-24  0:20       ` [Update 3x][PATCH 3/7] PM / Domains: Rework system suspend callback routines (v2) Rafael J. Wysocki
2011-11-19 14:00     ` [Update 2x][PATCH 4/7] PM / Runtime: Use device PM QoS constraints Rafael J. Wysocki
2011-11-30 23:20       ` [Update 3x][PATCH 4/7] PM / Runtime: Use device PM QoS constraints (v2) Rafael J. Wysocki
2011-11-19 14:01     ` [Update 2x][PATCH 5/7] PM / Domains: Add device stop governor function (v4) Rafael J. Wysocki
2011-11-19 14:01     ` [Update 2x][PATCH 6/7] PM / Domains: Add default power off " Rafael J. Wysocki
2011-11-19 14:02     ` [Update 2x][PATCH 7/7] PM / Domains: Automatically update overoptimistic latency information Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1111090818060.24340@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=jean.pihet@newoldbits.com \
    --cc=khilman@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®