From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, qemu-devel@nongnu.org
Cc: chenhuacai@kernel.org
Subject: Re: [PATCH] target/mips: Rework cp0_timer with clock API
Date: Mon, 10 Jul 2023 21:21:24 +0200 [thread overview]
Message-ID: <234d7b82-e34e-53db-34de-c7cfe05ab204@linaro.org> (raw)
In-Reply-To: <20230521110037.90049-1-jiaxun.yang@flygoat.com>
On 21/5/23 13:00, Jiaxun Yang wrote:
> Previous implementation of MIPS cp0_timer computes a
> cp0_count_ns based on input clock. However rounding
> error of cp0_count_ns can affect precision of cp0_timer.
>
> Using clock API and a divider for cp0_timer, so we can
> use clock_ns_to_ticks/clock_ns_to_ticks to avoid rounding
> issue.
>
> Also workaround the situation that in such handler flow:
>
> count = read_c0_count()
> write_c0_compare(count)
>
> If timer had not progressed when compare was written, the
> interrupt would trigger again.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> This seems fixed MTTCG booting issue on malta 5kEc with SMP.
> I'm going to do more test and see if we can enable MTTCG for
> mips64el.
> ---
> target/mips/cpu.c | 8 +++++---
> target/mips/cpu.h | 3 ++-
> target/mips/sysemu/cp0_timer.c | 35 ++++++++++++++++++----------------
> 3 files changed, 26 insertions(+), 20 deletions(-)
Thanks, queued to mips-next.
prev parent reply other threads:[~2023-07-10 19:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-21 11:00 [PATCH] target/mips: Rework cp0_timer with clock API Jiaxun Yang
2023-05-21 11:37 ` Philippe Mathieu-Daudé
2023-07-10 19:21 ` Philippe Mathieu-Daudé [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=234d7b82-e34e-53db-34de-c7cfe05ab204@linaro.org \
--to=philmd@linaro.org \
--cc=chenhuacai@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).