All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Kevin Hilman <khilman@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Ben Dooks <ben-linux@fluff.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Philipp Zabel <philipp.zabel@gmail.com>,
	Mark Brown <broonie@kernel.org>, Wolfram Sang <wsa@the-dreams.de>,
	Russell King <linux@arm.linux.org.uk>,
	Jack Dai <jack.dai@rock-chips.com>,
	Jinkun Hong <jinkun.hong@rock-chips.com>,
	Aaron Lu <aaron.lu@intel.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>
Subject: Re: [PATCH] PM / Domains: Change prototype for the ->attach_dev() callback
Date: Wed, 5 Nov 2014 14:49:20 -0800	[thread overview]
Message-ID: <20141105224920.GD22754@dtor-ws> (raw)
In-Reply-To: <7h7fz92rqk.fsf@deeprootsystems.com>

On Wed, Nov 05, 2014 at 02:43:31PM -0800, Kevin Hilman wrote:
> Dmitry Torokhov <dmitry.torokhov@gmail.com> writes:
> 
> > On Thu, Oct 30, 2014 at 01:38:30PM -0700, Kevin Hilman wrote:
> >> "Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
> >> 
> >> > On Thursday, October 30, 2014 01:02:49 PM Ulf Hansson wrote:
> >> >> Convert the prototype to return and int. This is just an initial step,
> >> >> needed to support error handling.
> >> >> 
> >> >> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> >> 
> >> Acked-by: Kevin Hilman <khilman@linaro.org>
> >> 
> >> >> 
> >> >> This patch is intended as fix for 3.18 rc[n]. Why?
> >> >> 
> >> >> There are other SOC specific patches around that adds genpd support and which
> >> >> implements the ->attach_dev() callback. To prevent having an "atomic" patch
> >> >> during the next release cycle, let's change the prototype now instead.
> >> >> 
> >> >> Further patches will add the actual error handling in genpd and these can then
> >> >> be reviewed and tested thoroughly.
> >> >
> >> > So we have no users of ->attach_dev at the moment, right?
> >> 
> >> Not in mainline, but there are a couple getting ready to hit -next, so
> >> we wanted to fix this before they arrive so that adding the error
> >> handling will be easier.
> >
> > BTW, while we are at it, can we also pass the domain itself to
> > attach_dev() and detach_dev()? If anything it helps with debugging (you
> > can print domain name from the callbacks).
> 
> Agreed, and it makes it match the other callbacks (power_off, power_on)
> which currently take struct generic_pm_domain *domain.  
> 
> Updated version of $SUBJECT patch below.
> 
> Kevin
> 
> 
> ----- >8 ------
> From 353a62ffae2f9228142c8a2093108f9eda8dc6b4 Mon Sep 17 00:00:00 2001
> From: Ulf Hansson <ulf.hansson@linaro.org>
> Date: Thu, 30 Oct 2014 13:02:49 +0100
> Subject: [PATCH] PM / Domains: Change prototype for the ->attach_dev()
>  callback
> 
> Convert the prototype to return and int. This is just an initial step,
> needed to support error handling.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> [khilman: added domain as parameter to callbacks, as suggested by Dmitry]
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Kevin Hilman <khilman@linaro.org>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/base/power/domain.c | 4 ++--
>  include/linux/pm_domain.h   | 6 ++++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 40bc2f4072cc..b520687046d4 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1437,7 +1437,7 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
>  	spin_unlock_irq(&dev->power.lock);
>  
>  	if (genpd->attach_dev)
> -		genpd->attach_dev(dev);
> +		genpd->attach_dev(genpd, dev);

I guess as a followup we need to propagate the error returned by
genpd->attach_dev() here.

Thanks.

-- 
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PM / Domains: Change prototype for the ->attach_dev() callback
Date: Wed, 5 Nov 2014 14:49:20 -0800	[thread overview]
Message-ID: <20141105224920.GD22754@dtor-ws> (raw)
In-Reply-To: <7h7fz92rqk.fsf@deeprootsystems.com>

On Wed, Nov 05, 2014 at 02:43:31PM -0800, Kevin Hilman wrote:
> Dmitry Torokhov <dmitry.torokhov@gmail.com> writes:
> 
> > On Thu, Oct 30, 2014 at 01:38:30PM -0700, Kevin Hilman wrote:
> >> "Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
> >> 
> >> > On Thursday, October 30, 2014 01:02:49 PM Ulf Hansson wrote:
> >> >> Convert the prototype to return and int. This is just an initial step,
> >> >> needed to support error handling.
> >> >> 
> >> >> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> >> 
> >> Acked-by: Kevin Hilman <khilman@linaro.org>
> >> 
> >> >> 
> >> >> This patch is intended as fix for 3.18 rc[n]. Why?
> >> >> 
> >> >> There are other SOC specific patches around that adds genpd support and which
> >> >> implements the ->attach_dev() callback. To prevent having an "atomic" patch
> >> >> during the next release cycle, let's change the prototype now instead.
> >> >> 
> >> >> Further patches will add the actual error handling in genpd and these can then
> >> >> be reviewed and tested thoroughly.
> >> >
> >> > So we have no users of ->attach_dev at the moment, right?
> >> 
> >> Not in mainline, but there are a couple getting ready to hit -next, so
> >> we wanted to fix this before they arrive so that adding the error
> >> handling will be easier.
> >
> > BTW, while we are at it, can we also pass the domain itself to
> > attach_dev() and detach_dev()? If anything it helps with debugging (you
> > can print domain name from the callbacks).
> 
> Agreed, and it makes it match the other callbacks (power_off, power_on)
> which currently take struct generic_pm_domain *domain.  
> 
> Updated version of $SUBJECT patch below.
> 
> Kevin
> 
> 
> ----- >8 ------
> From 353a62ffae2f9228142c8a2093108f9eda8dc6b4 Mon Sep 17 00:00:00 2001
> From: Ulf Hansson <ulf.hansson@linaro.org>
> Date: Thu, 30 Oct 2014 13:02:49 +0100
> Subject: [PATCH] PM / Domains: Change prototype for the ->attach_dev()
>  callback
> 
> Convert the prototype to return and int. This is just an initial step,
> needed to support error handling.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> [khilman: added domain as parameter to callbacks, as suggested by Dmitry]
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Kevin Hilman <khilman@linaro.org>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/base/power/domain.c | 4 ++--
>  include/linux/pm_domain.h   | 6 ++++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 40bc2f4072cc..b520687046d4 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1437,7 +1437,7 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
>  	spin_unlock_irq(&dev->power.lock);
>  
>  	if (genpd->attach_dev)
> -		genpd->attach_dev(dev);
> +		genpd->attach_dev(genpd, dev);

I guess as a followup we need to propagate the error returned by
genpd->attach_dev() here.

Thanks.

-- 
Dmitry

  reply	other threads:[~2014-11-05 22:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 12:02 [PATCH] PM / Domains: Change prototype for the ->attach_dev() callback Ulf Hansson
2014-10-30 12:02 ` Ulf Hansson
2014-10-30 12:17 ` Geert Uytterhoeven
2014-10-30 12:17   ` Geert Uytterhoeven
2014-10-30 12:28 ` Pavel Machek
2014-10-30 12:28   ` Pavel Machek
2014-10-30 20:04 ` Rafael J. Wysocki
2014-10-30 20:04   ` Rafael J. Wysocki
2014-10-30 20:38   ` Kevin Hilman
2014-10-30 20:38     ` Kevin Hilman
2014-11-05  1:33     ` Dmitry Torokhov
2014-11-05  1:33       ` Dmitry Torokhov
2014-11-05  7:43       ` Geert Uytterhoeven
2014-11-05  7:43         ` Geert Uytterhoeven
2014-11-05  7:54         ` Dmitry Torokhov
2014-11-05  7:54           ` Dmitry Torokhov
2014-11-05 22:43       ` Kevin Hilman
2014-11-05 22:43         ` Kevin Hilman
2014-11-05 22:49         ` Dmitry Torokhov [this message]
2014-11-05 22:49           ` Dmitry Torokhov
2014-11-05 23:21         ` Rafael J. Wysocki
2014-11-05 23:21           ` Rafael J. Wysocki
2014-11-05 23:11           ` Kevin Hilman
2014-11-05 23:11             ` Kevin Hilman
2014-11-06  0:54             ` Rafael J. Wysocki
2014-11-06  0:54               ` Rafael J. Wysocki
2014-11-14  8:17               ` Geert Uytterhoeven
2014-11-14  8:17                 ` Geert Uytterhoeven
2014-11-06  7:36             ` Geert Uytterhoeven
2014-11-06  7:36               ` Geert Uytterhoeven
2014-11-06  9:55             ` Ulf Hansson
2014-11-06  9:55               ` Ulf Hansson
2014-11-14 23:48             ` Rafael J. Wysocki
2014-11-14 23:48               ` Rafael J. Wysocki
2014-11-15 11:32               ` Geert Uytterhoeven
2014-11-15 11:32                 ` Geert Uytterhoeven

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=20141105224920.GD22754@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=aaron.lu@intel.com \
    --cc=ben-linux@fluff.org \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=horms@verge.net.au \
    --cc=jack.dai@rock-chips.com \
    --cc=jinkun.hong@rock-chips.com \
    --cc=kgene.kim@samsung.com \
    --cc=khilman@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=philipp.zabel@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=s.nawrocki@samsung.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tomasz.figa@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.