From: Kevin Hilman <khilman@deeprootsystems.com>
To: Nishanth Menon <nm@ti.com>
Cc: "Tony Lindgren" <tony@atomide.com>,
"Tero Kristo" <t-kristo@ti.com>, "Paul Walmsley" <paul@pwsan.com>,
linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org, Keerthy <j-keerthy@ti.com>,
"Benoît Cousson" <bcousson@baylibre.com>,
"Santosh Shilimkar" <santosh.shilimkar@ti.com>
Subject: Re: [PATCH 4/7] ARM: OMAP2+: powerdomain: introduce logic for finding valid power domain
Date: Wed, 27 Aug 2014 11:27:38 -0700 [thread overview]
Message-ID: <7h1ts1eqjp.fsf@paris.lan> (raw)
In-Reply-To: <1408715373-25791-5-git-send-email-nm@ti.com> (Nishanth Menon's message of "Fri, 22 Aug 2014 08:49:30 -0500")
Nishanth Menon <nm@ti.com> writes:
> powerdomain configuration in OMAP is done using PWRSTCTRL register for
> each power domain. However, PRCM lets us write any value we'd like to
> the logic and power domain target states, however the SoC integration
> tends to actually function only at a few discrete states. These valid
> states are already in our powerdomains_xxx_data.c file.
>
> So, provide a function to easily query valid low power state that the
> power domain is allowed to go to.
>
> Based on work originally done by Jean Pihet <j-pihet@ti.com>
> https://patchwork.kernel.org/patch/1325091/ . There is no attempt to
> create a new powerdomain solution here, except fixing issues seen
> attempting invalid programming attempts. Future consolidation to the
> generic powerdomain framework should consider this requirement as
> well.
>
> Similar solutions have been done in product kernels in the past such
> as:
> https://android.googlesource.com/kernel/omap.git/+blame/android-omap-panda-3.0/arch/arm/mach-omap2/pm44xx.c
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
nit: this is part of a fixes series, but it's more of a new feature.
That being said, the feature is needed and looks OK, except for...
> +up_search:
> + /* OK, no deeper ones, can we get a higher match? */
> + new_pwrst = req_state + 1;
> + while (!(pwrdm_states & BIT(new_pwrst))) {
> + /* BUG if we have messed up database */
> + BUG_ON(new_pwrst > PWRDM_POWER_ON);
I don't think this is BUG() worthy, and should have a saner way to recover.
Kevin
WARNING: multiple messages have this Message-ID (diff)
From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] ARM: OMAP2+: powerdomain: introduce logic for finding valid power domain
Date: Wed, 27 Aug 2014 11:27:38 -0700 [thread overview]
Message-ID: <7h1ts1eqjp.fsf@paris.lan> (raw)
In-Reply-To: <1408715373-25791-5-git-send-email-nm@ti.com> (Nishanth Menon's message of "Fri, 22 Aug 2014 08:49:30 -0500")
Nishanth Menon <nm@ti.com> writes:
> powerdomain configuration in OMAP is done using PWRSTCTRL register for
> each power domain. However, PRCM lets us write any value we'd like to
> the logic and power domain target states, however the SoC integration
> tends to actually function only at a few discrete states. These valid
> states are already in our powerdomains_xxx_data.c file.
>
> So, provide a function to easily query valid low power state that the
> power domain is allowed to go to.
>
> Based on work originally done by Jean Pihet <j-pihet@ti.com>
> https://patchwork.kernel.org/patch/1325091/ . There is no attempt to
> create a new powerdomain solution here, except fixing issues seen
> attempting invalid programming attempts. Future consolidation to the
> generic powerdomain framework should consider this requirement as
> well.
>
> Similar solutions have been done in product kernels in the past such
> as:
> https://android.googlesource.com/kernel/omap.git/+blame/android-omap-panda-3.0/arch/arm/mach-omap2/pm44xx.c
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
nit: this is part of a fixes series, but it's more of a new feature.
That being said, the feature is needed and looks OK, except for...
> +up_search:
> + /* OK, no deeper ones, can we get a higher match? */
> + new_pwrst = req_state + 1;
> + while (!(pwrdm_states & BIT(new_pwrst))) {
> + /* BUG if we have messed up database */
> + BUG_ON(new_pwrst > PWRDM_POWER_ON);
I don't think this is BUG() worthy, and should have a saner way to recover.
Kevin
next prev parent reply other threads:[~2014-08-27 18:27 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 13:49 [PATCH 0/7] ARM: OMAP4+: powerdomain fixes Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` [PATCH 1/7] ARM: OMAP: DRA7: powerdomain data: fix powerdomain powerstate Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` [PATCH 2/7] ARM: OMAP5: " Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` [PATCH 3/7] ARM: OMAP2+: powerdomain: pwrdm_for_each_clkdm iterate only valid clkdms Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` [PATCH 4/7] ARM: OMAP2+: powerdomain: introduce logic for finding valid power domain Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-27 18:27 ` Kevin Hilman [this message]
2014-08-27 18:27 ` Kevin Hilman
2014-08-27 18:35 ` Nishanth Menon
2014-08-27 18:35 ` Nishanth Menon
2014-08-27 18:39 ` Kevin Hilman
2014-08-27 18:39 ` Kevin Hilman
2014-08-22 13:49 ` [PATCH 5/7] ARM: OMAP4+: PM: Make logic state programmable Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` [PATCH 6/7] ARM: OMAP4+: PM: use only valid low power state for suspend Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` [PATCH 7/7] ARM: OMAP4+: PM: Use only valid low power state for CPU hotplug Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-22 13:49 ` Nishanth Menon
2014-08-27 18:30 ` [PATCH 0/7] ARM: OMAP4+: powerdomain fixes Kevin Hilman
2014-08-27 18:30 ` Kevin Hilman
2014-08-27 18:37 ` Santosh Shilimkar
2014-08-27 18:37 ` Santosh Shilimkar
2014-08-27 18:54 ` [PATCH V2 4/7] ARM: OMAP2+: powerdomain: introduce logic for finding valid power domain Nishanth Menon
2014-08-27 18:54 ` Nishanth Menon
2014-08-27 18:54 ` Nishanth Menon
2014-08-27 20:25 ` Kevin Hilman
2014-08-27 20:25 ` Kevin Hilman
2014-08-27 20:25 ` Kevin Hilman
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=7h1ts1eqjp.fsf@paris.lan \
--to=khilman@deeprootsystems.com \
--cc=bcousson@baylibre.com \
--cc=j-keerthy@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=paul@pwsan.com \
--cc=santosh.shilimkar@ti.com \
--cc=t-kristo@ti.com \
--cc=tony@atomide.com \
/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.