public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Hiremath, Vaibhav" <hvaibhav@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@nokia.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: Save/Restore (PM) support in DSS2
Date: Tue, 23 Mar 2010 18:50:50 +0100	[thread overview]
Message-ID: <87tys7apvp.fsf@deeprootsystems.com> (raw)
In-Reply-To: <19F8576C6E063C45BE387C64729E7394044DE0E53F@dbde02.ent.ti.com> (Vaibhav Hiremath's message of "Mon\, 22 Mar 2010 10\:43\:04 +0530")

"Hiremath, Vaibhav" <hvaibhav@ti.com> writes:

> Hi Tomi and others,
>
> As part of our internal release I found that save and restore support doesn't work as expected (I have fixed it for our release and full PM support works fine for me), and below is my analysis/observation and fix for the same - 
>
> Observation - 
> -----------
>
> The save and restore of DSS registers happen inside function dss_clk_enable and dss_clk_disable. The save context gets executed as per expectation when actually required, i.e. when clock usage count goes to 0.
>
> The issue is with restore functionality, the restore is blocked by various conditions - 
>
> void dss_clk_enable(enum dss_clock clks)
> {
>         bool check_ctx = core.num_clks_enabled == 0;
>
>         dss_clk_enable_no_ctx(clks);
>
>         if (check_ctx && cpu_is_omap34xx() && dss_need_ctx_restore())
>                 restore_all_ctx();
> }
>
> The check for clock usage count is mandatory here (which was missing earlier) but I am more concerned about other of two, cpu_is_omap34xx() & dss_need_ctx_restore(). 
>
> Why this is tied only to omap34xx? And 
> Frankly I am quite not sure whether I understood use of dss_need_ctx_restore()? What are we trying to do here with function dss_need_ctx_restore()? It internally calls dss_get_ctx_id() which internally calls pdata->get_last_off_on_transaction_id().
>
> Are we providing control to platform file when to restore? If yes, then what could be the trigger for that decision?
>
> Currently none of OMAP board files defines this function, so it is always going to return 0. That means, without this function (and returns true) restore won't happen at all.
>
> If I understand correctly, irrespective of which platform you are running on and whether you are hitting off/idle/retention state or not, you must save and restore states when your module interface clock usage count goes to zero. I may be missing something here.

You only need restore if the powerdomain has gone to off mode (or
OSWR, which is not yet in l-o.)  For retention or inactive, no context
save/restore is needed.

That pdata pointer was intended to hook up to the OMAP PM layer
funciton of the same name, which uses the has the smarts to determine
if context was actually lost.

Kevin

  reply	other threads:[~2010-03-23 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22  5:13 Save/Restore (PM) support in DSS2 Hiremath, Vaibhav
2010-03-23 17:50 ` Kevin Hilman [this message]
2010-03-24  7:55 ` Tomi Valkeinen

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=87tys7apvp.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=hvaibhav@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@nokia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox