From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Huacai Chen <chenhc@lemote.com>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Xuefeng Li <lixuefeng@loongson.cn>,
Yinglu Yang <yangyinglu@loongson.cn>,
WANG Xuerui <git@xen0n.name>
Subject: Re: [PATCH] MIPS: Loongson64: Add read_persistent_clock64()
Date: Thu, 12 Nov 2020 20:03:50 +0800 [thread overview]
Message-ID: <6f0a7a43-4eac-65d8-61ff-778dc13f925c@loongson.cn> (raw)
In-Reply-To: <b84fe88b-7527-e88c-1efd-739f6d846518@flygoat.com>
On 11/12/2020 06:09 PM, Jiaxun Yang wrote:
>
>
> 在 2020/11/12 18:04, Jiaxun Yang 写道:
>> Hi Tiezhu,
>>
>> 在 2020/11/12 16:29, Tiezhu Yang 写道:
>>> Add read_persistent_clock64() to read the time from the battery backed
>>> persistent clock. With this patch, we can fix the wrong time issue due
>>> to the system clock is not consistent with hardware clock after resume
>>> from sleep state S3 (suspend to RAM), at the same time, the system time
>>> can be right instead of "Thu Jan 1 08:00:00 CST 1970" without rtc
>>> driver.
>>>
>>> start_kernel()
>>> timekeeping_init()
>>> read_persistent_wall_and_boot_offset()
>>> read_persistent_clock64()
>>>
>>> timekeeping_resume()
>>> read_persistent_clock64()
>>>
>>> timekeeping_suspend()
>>> read_persistent_clock64()
>>
>> It is highly discoraged to do anything with bridgetype, which isn't
>> probed via
>> devicetree.
>>
>> Please check if you can deal with that inside RTC framework, or make
>> it as
>> a part of RTC driver (e.g. set up a callback).
>>
>> Also you should submit RTC driver at first if you intend to complete
>> LS7A support.
>
> Oops,
> Just dig it deeper, I guess simply select RTC_HCTOSYS would solve the
> issue.
> We're trying very hard to decouple all the drivers and conponents,
> DeviceTree for all!
+cc WANG Xuerui <git@xen0n.name>
Hi Jiaxun,
Thanks for your reply.
Xuerui has already submitted the patch of LS7A rtc driver [1],
but not yet been merged into the mainline kernel, I discussed
with him early today.
Do you mean that read_persistent_clock64() can call the function
like rtc_read_time() defined in rtc driver?
Thanks,
Tiezhu
[1]
https://patchwork.kernel.org/project/linux-mips/patch/20200923075845.360974-2-git@xen0n.name/
>
>>
>> Thanks.
>>
>> - Jiaxun
>>
>>>
>>> Signed-off-by: Yinglu Yang <yangyinglu@loongson.cn>
>>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>>> ---
>>>
next prev parent reply other threads:[~2020-11-12 12:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 8:29 Tiezhu Yang
2020-11-12 10:04 ` Jiaxun Yang
2020-11-12 10:09 ` Jiaxun Yang
2020-11-12 12:03 ` Tiezhu Yang [this message]
2020-11-13 2:21 ` Jiaxun Yang
2020-11-13 3:41 ` Tiezhu Yang
2020-11-13 8:24 ` Jiaxun Yang
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=6f0a7a43-4eac-65d8-61ff-778dc13f925c@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=chenhc@lemote.com \
--cc=git@xen0n.name \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=tsbogend@alpha.franken.de \
--cc=yangyinglu@loongson.cn \
/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®