From: Dmitry Osipenko <digetx@gmail.com>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [RFC v1 0/2] ARM MPTimer fixes and refactoring
Date: Mon, 5 Oct 2015 19:07:29 +0300 [thread overview]
Message-ID: <5612A041.8000005@gmail.com> (raw)
In-Reply-To: <560FD3FF.3040206@gmail.com>
03.10.2015 16:11, Dmitry Osipenko пишет:
> 20.09.2015 20:48, Peter Crosthwaite пишет:
>> On Sun, Jul 5, 2015 at 1:58 PM, Peter Crosthwaite
>> <peter.crosthwaite@xilinx.com> wrote:
>>> On Sun, Jul 5, 2015 at 1:47 PM, Dmitry Osipenko <digetx@gmail.com> wrote:
>>>> 05.07.2015 23:26, Peter Crosthwaite пишет:
>>>>
>>>>> Hi Dmitry,
>>>>>
>>>>> Based on my comment earlier, this is what I came up with RE consolidation
>>>>> of
>>>>> those arm_mptimer code paths that were giving you problems. I have not
>>>>> done the
>>>>> interrupt mask fix, as that one from your series is reasonably
>>>>> independent.
>>>>>
>>>>> Regards,
>>>>> Peter
>>>>>
>>>>> Peter Crosthwaite (2):
>>>>> timer: arm_mp: Factor out timer value calculation
>>>>> timer: arm_mp: consolidate control and counter write logic
>>>>>
>>>>> hw/timer/arm_mptimer.c | 73
>>>>> +++++++++++++++++++++++++++++---------------------
>>>>> 1 file changed, 42 insertions(+), 31 deletions(-)
>>>>>
>>>>
>>>> Hi Peter, thanks a lot! Generally, I don't have any trouble with currently
>>>> missed functionality, just noticed it while was hacking my NVIDIA Tegra2
>>>> emulation pet-project and decided to contribute =).
>>>>
>>>> It looks like you are trying to duplicate what generic ptimer is already
>>>> doing, isn't it?
>>>>
>>>
>>> Yes, ptimer was probably the correct way to do this in the first
>>> place. Some of the new code structures introduced in this patch series
>>> are directly applicable though for that conversion effort.
>>>
>>
>> I looked into doing this with ptimer, and pitmer doesn't really play
>> nice with periodic down counters. You could do the subtractions
>> against an up counter with the load value but that seems just as
>> complex as the current solution IMO. The hardest part is setting the
>> counter value on an already running timer.
>>
>> The alternative is to patch ptimer to handle down timers.
>>
>> Regards,
>> Peter
>>
>
> Hmm, I think you missed something. Ptimer is doing downcount, not up.
> ptimer_get_count() might be a misnomer, it returns current timer value (it goes
> down to 0), not a passed ticks count number. Ptimer also should handle reloading
> of a running timer just fine with ptimer_set_count(), don't see any trouble
> here. Anyway, I'll try to re-implement MPtimer using ptimer ASAP and see how it
> really fits.
>
Finally, I tried ptimer and everything seem to work perfect. Pausing,
re-loading, etc works as it should. Will send the patch soon.
--
Dmitry
next prev parent reply other threads:[~2015-10-05 16:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-05 20:26 [Qemu-devel] [RFC v1 0/2] ARM MPTimer fixes and refactoring Peter Crosthwaite
2015-07-05 20:26 ` [Qemu-devel] [RFC v1 1/2] timer: arm_mp: Factor out timer value calculation Peter Crosthwaite
2015-07-05 20:26 ` [Qemu-devel] [RFC v1 2/2] timer: arm_mp: consolidate control and counter write logic Peter Crosthwaite
2015-07-05 20:47 ` [Qemu-devel] [RFC v1 0/2] ARM MPTimer fixes and refactoring Dmitry Osipenko
2015-07-05 20:58 ` Peter Crosthwaite
2015-07-05 21:01 ` Peter Crosthwaite
2015-07-05 21:06 ` Peter Maydell
2015-07-05 21:12 ` Peter Crosthwaite
2015-07-05 21:21 ` Dmitry Osipenko
2015-09-20 17:48 ` Peter Crosthwaite
2015-10-03 13:11 ` Dmitry Osipenko
2015-10-05 16:07 ` Dmitry Osipenko [this message]
2015-10-05 16:27 ` Peter Crosthwaite
2015-10-05 16:43 ` Dmitry Osipenko
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=5612A041.8000005@gmail.com \
--to=digetx@gmail.com \
--cc=crosthwaite.peter@gmail.com \
--cc=crosthwaitepeter@gmail.com \
--cc=peter.maydell@linaro.org \
--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).