All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Alexander Aring <alex.aring@gmail.com>,
	Eric Anholt <eric@anholt.net>, Jon Hunter <jonathanh@nvidia.com>
Cc: Kevin Hilman <khilman@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Lee Jones <lee@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	linux-rpi-kernel@lists.infradead.org, Pavel Machek <pavel@ucw.cz>,
	Len Brown <len.brown@intel.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [PATCH v2 1/5] power: domain: add pm_genpd_exit
Date: Mon, 14 Dec 2015 10:49:07 +0100	[thread overview]
Message-ID: <CAPDyKFpSu=vik3kDn9zrv7dkg5n+Dqe+xs4FZnB8nhTA=ahaAg@mail.gmail.com> (raw)
In-Reply-To: <20151209104752.GB1036@omega>

+Russell

[...]

>> >> +void pm_genpd_exit(struct generic_pm_domain *genpd)
>> >> +{
>> >> +  if (IS_ERR_OR_NULL(genpd))
>> >> +          return;
>> >> +
>> >> +  /* check if domain is still in registered inside the pm subsystem */
>> >> +  WARN_ON_ONCE(!list_empty(&genpd->master_links) ||
>> >> +               !list_empty(&genpd->slave_links) ||
>> >> +               !list_empty(&genpd->dev_list));
>> >> +
>> >
>> > Why not return an error here? Seems bad to remove it, if it could still
>> > be referenced by other domains.
>>
>> I had pointed this out as well in an earlier review.
>>
>
> I talked with Ulf Hansson about such handling and there exists currently
> no handling to remove the pm_genpd on error handling (what our use case
> is for RPi domains).
>
> The real solution would be a "pm_genpd_exit_recursive" functionality to
> remove subdomains, etc -> simple everything. Anway I am not a expert into
> power domain functionality and this simple approach was enough to him to
> add "something" which we have actually a lack of support.
>
>

[...]

Just to be clear on my view. I think Russell made a good summary of
how we should implement this API [1].
We should return an error, instead of WARN_ON_ONCE and continue.

Perhaps you can do both a WARN *and* return an error.

Regarding the similar patch from Jon Hunter, I would suggest we focus
on Alexander's $subject patch and try to it queued for 4.5. Please
send a new version.

Also, as other SoC genpd driver isn't using a "pm_genpd_exit()" API,
it shouldn't prevent neither Alexander/Eric or Jon from proceeding
with the RPI/Tegra genpd drivers. Once the new API is in place you can
update these drivers to properly deal with error handling and undo
things from pm_genpd_init().

Kind regards
Uffe

[1]
https://lkml.org/lkml/2015/12/9/308

WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Alexander Aring
	<alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>,
	Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Florian Fainelli
	<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	"linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Lee Jones <lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>,
	Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Russell King - ARM Linux
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Subject: Re: [PATCH v2 1/5] power: domain: add pm_genpd_exit
Date: Mon, 14 Dec 2015 10:49:07 +0100	[thread overview]
Message-ID: <CAPDyKFpSu=vik3kDn9zrv7dkg5n+Dqe+xs4FZnB8nhTA=ahaAg@mail.gmail.com> (raw)
In-Reply-To: <20151209104752.GB1036@omega>

+Russell

[...]

>> >> +void pm_genpd_exit(struct generic_pm_domain *genpd)
>> >> +{
>> >> +  if (IS_ERR_OR_NULL(genpd))
>> >> +          return;
>> >> +
>> >> +  /* check if domain is still in registered inside the pm subsystem */
>> >> +  WARN_ON_ONCE(!list_empty(&genpd->master_links) ||
>> >> +               !list_empty(&genpd->slave_links) ||
>> >> +               !list_empty(&genpd->dev_list));
>> >> +
>> >
>> > Why not return an error here? Seems bad to remove it, if it could still
>> > be referenced by other domains.
>>
>> I had pointed this out as well in an earlier review.
>>
>
> I talked with Ulf Hansson about such handling and there exists currently
> no handling to remove the pm_genpd on error handling (what our use case
> is for RPi domains).
>
> The real solution would be a "pm_genpd_exit_recursive" functionality to
> remove subdomains, etc -> simple everything. Anway I am not a expert into
> power domain functionality and this simple approach was enough to him to
> add "something" which we have actually a lack of support.
>
>

[...]

Just to be clear on my view. I think Russell made a good summary of
how we should implement this API [1].
We should return an error, instead of WARN_ON_ONCE and continue.

Perhaps you can do both a WARN *and* return an error.

Regarding the similar patch from Jon Hunter, I would suggest we focus
on Alexander's $subject patch and try to it queued for 4.5. Please
send a new version.

Also, as other SoC genpd driver isn't using a "pm_genpd_exit()" API,
it shouldn't prevent neither Alexander/Eric or Jon from proceeding
with the RPI/Tegra genpd drivers. Once the new API is in place you can
update these drivers to properly deal with error handling and undo
things from pm_genpd_init().

Kind regards
Uffe

[1]
https://lkml.org/lkml/2015/12/9/308
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: ulf.hansson@linaro.org (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/5] power: domain: add pm_genpd_exit
Date: Mon, 14 Dec 2015 10:49:07 +0100	[thread overview]
Message-ID: <CAPDyKFpSu=vik3kDn9zrv7dkg5n+Dqe+xs4FZnB8nhTA=ahaAg@mail.gmail.com> (raw)
In-Reply-To: <20151209104752.GB1036@omega>

+Russell

[...]

>> >> +void pm_genpd_exit(struct generic_pm_domain *genpd)
>> >> +{
>> >> +  if (IS_ERR_OR_NULL(genpd))
>> >> +          return;
>> >> +
>> >> +  /* check if domain is still in registered inside the pm subsystem */
>> >> +  WARN_ON_ONCE(!list_empty(&genpd->master_links) ||
>> >> +               !list_empty(&genpd->slave_links) ||
>> >> +               !list_empty(&genpd->dev_list));
>> >> +
>> >
>> > Why not return an error here? Seems bad to remove it, if it could still
>> > be referenced by other domains.
>>
>> I had pointed this out as well in an earlier review.
>>
>
> I talked with Ulf Hansson about such handling and there exists currently
> no handling to remove the pm_genpd on error handling (what our use case
> is for RPi domains).
>
> The real solution would be a "pm_genpd_exit_recursive" functionality to
> remove subdomains, etc -> simple everything. Anway I am not a expert into
> power domain functionality and this simple approach was enough to him to
> add "something" which we have actually a lack of support.
>
>

[...]

Just to be clear on my view. I think Russell made a good summary of
how we should implement this API [1].
We should return an error, instead of WARN_ON_ONCE and continue.

Perhaps you can do both a WARN *and* return an error.

Regarding the similar patch from Jon Hunter, I would suggest we focus
on Alexander's $subject patch and try to it queued for 4.5. Please
send a new version.

Also, as other SoC genpd driver isn't using a "pm_genpd_exit()" API,
it shouldn't prevent neither Alexander/Eric or Jon from proceeding
with the RPI/Tegra genpd drivers. Once the new API is in place you can
update these drivers to properly deal with error handling and undo
things from pm_genpd_init().

Kind regards
Uffe

[1]
https://lkml.org/lkml/2015/12/9/308

  parent reply	other threads:[~2015-12-14  9:49 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 17:45 [PATCH v2 0/5] Raspberry Pi power domains v2 Eric Anholt
2015-12-04 17:45 ` Eric Anholt
2015-12-04 17:45 ` Eric Anholt
2015-12-04 17:45 ` [PATCH v2 1/5] power: domain: add pm_genpd_exit Eric Anholt
2015-12-04 17:45   ` Eric Anholt
2015-12-04 17:45   ` Eric Anholt
2015-12-07 10:04   ` Jon Hunter
2015-12-07 10:04     ` Jon Hunter
2015-12-07 10:04     ` Jon Hunter
2015-12-08 18:59     ` Kevin Hilman
2015-12-08 18:59       ` Kevin Hilman
2015-12-08 18:59       ` Kevin Hilman
2015-12-09 10:47       ` Alexander Aring
2015-12-09 10:47         ` Alexander Aring
2015-12-09 10:54         ` Russell King - ARM Linux
2015-12-09 10:54           ` Russell King - ARM Linux
2015-12-14  9:49         ` Ulf Hansson [this message]
2015-12-14  9:49           ` Ulf Hansson
2015-12-14  9:49           ` Ulf Hansson
2015-12-04 17:45 ` [PATCH v2 2/5] ARM: bcm2835: Define two new packets from the latest firmware Eric Anholt
2015-12-04 17:45   ` Eric Anholt
2015-12-04 17:45   ` Eric Anholt
2015-12-04 17:45 ` [PATCH v2 3/5] ARM: bcm2835: add rpi power domain driver Eric Anholt
2015-12-04 17:45   ` Eric Anholt
2015-12-07 23:35   ` Kevin Hilman
2015-12-07 23:35     ` Kevin Hilman
2015-12-08  1:04     ` Eric Anholt
2015-12-08  1:04       ` Eric Anholt
2015-12-08 18:19       ` Kevin Hilman
2015-12-08 18:19         ` Kevin Hilman
2015-12-11 18:13   ` Stefan Wahren
2015-12-11 18:13     ` Stefan Wahren
2015-12-11 18:13     ` Stefan Wahren
2015-12-04 17:45 ` [PATCH v2 4/5] dt-bindings: add rpi power domain driver bindings Eric Anholt
2015-12-04 17:45   ` Eric Anholt
2015-12-04 17:45 ` [PATCH v2 5/5] ARM: bcm2835: Add the Raspberry Pi power domain driver to the DT Eric Anholt
2015-12-04 17:45   ` Eric Anholt

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='CAPDyKFpSu=vik3kDn9zrv7dkg5n+Dqe+xs4FZnB8nhTA=ahaAg@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=alex.aring@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jonathanh@nvidia.com \
    --cc=khilman@kernel.org \
    --cc=lee@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=pawel.moll@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=swarren@wwwdotorg.org \
    /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.