From: Mukesh Ojha <mojha@codeaurora.org>
To: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
lkml <linux-kernel@vger.kernel.org>,
neeraju@codeaurora.org, gkohli@codeaurora.org,
cpandya@codeaurora.org
Subject: Re: [PATCH RESEND] time: Fix sleeptime injection for non-stop clocksource & persistent clock
Date: Wed, 30 May 2018 15:57:02 +0530 [thread overview]
Message-ID: <76bd29b8-c8af-b5ac-3538-b6a97afb6ab1@codeaurora.org> (raw)
In-Reply-To: <CALAqxLWsD7rpgGYhdpDCVuH3Sss+RkqmFgunDejFYpKZ7=JTng@mail.gmail.com>
Hi John,
On 5/30/2018 7:50 AM, John Stultz wrote:
> On Tue, May 29, 2018 at 2:49 AM, Mukesh Ojha <mojha@codeaurora.org> wrote:
>> Currently, for both non-stop clocksource and persistent clock
>> there is a corner case, when a driver failed to go suspend mode
>> rtc_resume() injects the sleeptime as timekeeping_rtc_skipresume()
>> returned 'false' due to which we can see mismatch in time between
>> system clock and other timers.
>>
>> Success case:
>> {sleeptime_injected=true}
>> rtc_suspend() => timekeeping_suspend() => timekeeping_resume() =>
>> rtc_resume()
>>
>> Failure case:
>> {failure in sleep path} {sleeptime_injected=false}
>> rtc_suspend() => rtc_resume()
>>
>> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
> I'm not sure this patch makes sense yet (since I don't really see how
> its used
In a system where both non-stop clocksource and rtc exist
Timestamp mismatch seen between a (Gyro)timer based on non-stop clocksource
and system clock after attempting a sleep.
Here, System clock timestamps increase by some millisecond as compare to
other timer.
And we see this is possible only when timekeeping_resume() has not been
called
which is keeping sleeptime_injected to its default value(false). So, the
call to
timekeeping_rtc_skipresume() in rtc_resume() is false and thats ends up in
sleeptime injection via rtc_resume().
When timekeeping_resume() has not been called means one of the driver failed
during suspend in syscore_suspend() in kernel/power/suspend.c .
So if we let rtc inject the sleeptime here, we would see the timestamp
increase in case of
system clock.
> - mind cc'ing me on the patch that makes use of this?)
>
> And more problematic, the patch doesn't seem to apply to mainline.
> Could you respin and resend?
Will spin the patch again with some minor code change.
Thanks,
Mukesh
>
> thanks
> -john
prev parent reply other threads:[~2018-05-30 10:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 9:49 Mukesh Ojha
2018-05-30 2:20 ` John Stultz
2018-05-30 10:27 ` Mukesh Ojha [this message]
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=76bd29b8-c8af-b5ac-3538-b6a97afb6ab1@codeaurora.org \
--to=mojha@codeaurora.org \
--cc=cpandya@codeaurora.org \
--cc=gkohli@codeaurora.org \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neeraju@codeaurora.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®