From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: "Tang, Feng" <feng.tang@intel.com>
Cc: John Stultz <john.stultz@linaro.org>, linux-kernel@vger.kernel.org
Subject: Re: FW: [RFC PATCH v2 0/4] Add support for S3 non-stop TSC support.
Date: Mon, 4 Mar 2013 20:20:36 -0700 [thread overview]
Message-ID: <20130305032036.GA24117@obsidianresearch.com> (raw)
In-Reply-To: <A74E4C03C808B649AF1F11527F2D4414034E0BE8@SHSMSX101.ccr.corp.intel.com>
On Tue, Mar 05, 2013 at 02:34:25AM +0000, Tang, Feng wrote:
> Hi Jason,
>
> Sorry, I forgot to add you in cc list in the first place. Please
> help to review the patch series, thanks!
Sure, I didn't get CC'd on the patches, so this is an imperfect reply,
but..
Did you consider an approach closer to the function I outlined to
Jonh:
// Drops some small precision along the way but is simple..
static inline u64 cyclecounter_cyc2ns_128(const struct cyclecounter *cc,
cycle_t cycles)
{
u64 max = U64_MAX/cc->mult;
u64 num = cycles/max;
u64 result = num * ((max * cc->mult) >> cc->shift);
return result + cyclecounter_cyc2ns(cc, cycles - num*cc->mult);
}
Rather than the while loop, which, I suspect, drops more precision
that something like the above. (replace cyclecounter with clocksource)
At the very least, keeping it as a distinct inline will let someone
come by one day and implement a proper 128 bit multiply...
You may want to also CC the maintainers of all the ARM subsystems that
use read_persistent_clock and check with them to ensure this new
interface will let them migrate their implementations as well.
> * Solve the problem of judging S3/S4, as the clocksource
> counter will be reset after coming out S4.
Hrm, what if it wraps during suspend? This probably isn't a problem
for a 64 bit TSC though..
Is it impossible to track if S4 or S3 was entered in the clocksource?
Reagrds,
Jason
parent reply other threads:[~2013-03-05 3:20 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <A74E4C03C808B649AF1F11527F2D4414034E0BE8@SHSMSX101.ccr.corp.intel.com>]
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=20130305032036.GA24117@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=feng.tang@intel.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome