From: Axel Haslam <ahaslam@baylibre.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Ulf Hansson" <ulf.hansson@linaro.org>,
"Kevin Hilman" <khilman@linaro.org>,
"Krzysztof Kozłowski" <k.kozlowski.k@gmail.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"Benoit Cousson" <bcousson@baylibre.com>,
"Linux PM list" <linux-pm@vger.kernel.org>
Subject: Re: [RFC v4 1/8] PM / Domains: structure changes for multiple states
Date: Wed, 22 Apr 2015 16:50:35 +0200 [thread overview]
Message-ID: <5537B53B.4070808@baylibre.com> (raw)
In-Reply-To: <5537A0B5.5000507@baylibre.com>
Hi Geert,
>>
>> While your series now looks compilable for all patch steps, it's not
>> bisectable: the right hook won't be called until the platform is
>> converted to support multiple states.
>>
>> I think you can fix this by e.g. using -1 for the target_state on
>> non-converted
>> platforms, and doing:
>>
>> if (target_state < 0) {
>> if (!genpd->power_on)
>> return 0;
>> } else {
>> if (!genpd->states[target_state].power_on)
>> return 0;
>> }
>>
>> and
>>
>> ret = target_state < 0 ? genpd->power_on(genpd)
>> :
>> genpd->states[target_state].power_on(genpd);
>>
>> The checks for a negative target_state can be removed only after
>> all platforms have been converted.
>>
instead of adding checks for negative target state,
i think we can use a single state as a placeholder for the
old callbacks.
would this be an acceptable solution?
on init i can add something like:
+ if (genpd->power_off || genpd->power_on) {
+ pr_warn("Using old genpd callbacks\n");
+ genpd->state_count = 1;
+ genpd->states[0].name = "OFF";
+ genpd->states[0].power_off = genpd->power_off;
+ genpd->states[0].power_off_latency_ns =
+ genpd->power_off_latency_ns;
+ genpd->states[0].power_on = genpd->power_on;
+ genpd->states[0].power_on_latency_ns =
+ genpd->power_on_latency_ns;
+ }
+
this way, old callbacks are called in case the platform
has not been converted yet.
Regards
Axel
next prev parent reply other threads:[~2015-04-22 14:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 9:45 [RFC v4 0/8] genpd multiple states v4 ahaslam
2015-04-22 9:45 ` [RFC v4 1/8] PM / Domains: structure changes for multiple states ahaslam
2015-04-22 11:17 ` Geert Uytterhoeven
2015-04-22 13:23 ` Axel Haslam
2015-04-22 13:57 ` Geert Uytterhoeven
2015-04-22 16:26 ` Axel Haslam
2015-04-22 14:50 ` Axel Haslam [this message]
2015-04-22 9:45 ` [RFC v4 2/8] PM / Domains: select deepest state ahaslam
2015-04-22 9:45 ` [RFC v4 3/8] ARM: s3c64xx: pm: Convert to multiple states ahaslam
2015-04-22 9:45 ` [RFC v4 4/8] ARM: exynos: " ahaslam
2015-04-22 9:45 ` [RFC v4 5/8] ARM: r8a7779: " ahaslam
2015-04-22 9:45 ` [RFC v4 6/8] ARM: rmobile: " ahaslam
2015-04-22 9:45 ` [RFC v4 7/8] ARM: ux500: " ahaslam
2015-04-22 9:45 ` [RFC v4 8/8] PM / Domains: remove old power on/off callbacks ahaslam
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=5537B53B.4070808@baylibre.com \
--to=ahaslam@baylibre.com \
--cc=bcousson@baylibre.com \
--cc=geert@linux-m68k.org \
--cc=k.kozlowski.k@gmail.com \
--cc=khilman@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=ulf.hansson@linaro.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.