All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
Cc: peter.maydell@linaro.org, monstr@monstr.eu,
	edgar.iglesias@petalogix.com, qemu-devel@nongnu.org,
	John Linn <john.linn@xilinx.com>,
	duyl@xilinx.com, linnj@xilinx.com, afaerber@suse.de,
	john.williams@petalogix.com
Subject: Re: [Qemu-devel] [RFC PATCH v2 2/4] cadence_ttc: initial version of device model
Date: Wed, 8 Feb 2012 10:15:25 +0000	[thread overview]
Message-ID: <201202081015.25639.paul@codesourcery.com> (raw)
In-Reply-To: <CAEgOgz7H_Hq-OMKGbSnxM2Rt8q7EOFDV193HK3O9fZD7qA63tA@mail.gmail.com>

> > > Implemented cadence Triple Timer Counter (TCC)
> > 
> > It looks like you're implementing a periodic timer as sequence of chained
> > oneshot timers.  This is a bad idea.  In qemu interrupt latency may be
> > high,
> > so you're likely to suffer from significant time skew.
> > 
> Ok, I could implemented the wraparound event as a periodic timer and the
> match events are kicked off as seperate one-shot timers when the wrap
> around occurs? There would still be a small delay on match events, but it
> would get rid of the integration effect of lots of little delays (over many
> wrap arounds) add up to a significant skew.

I'm not sure why you need the oneshot timers at all. But then again I'm not 
really sure what the desired semantics are either :-)

It would help me if you could describe how these timers operate.
In particular:

- Are they free running.  i.e. keep counting until explicitly stopped by the 
user, or stop when an event occurs.
- When are interrupts raised.  You mention a user specified match value.  Do 
we also get an interrupt on wraparound?
- What happens when the timer hits the limit (zero if count-down, match value 
if count-up)? Does it wrap? or load a fixed value? 

If you've got independent wrap and match events then I guess yes, a periodic 
wrap plus a oneshot match event is probably appropriate.

If wrapping does not generate an interrupt, or wrap and match are effectively 
the same thing then you just need to transpose the counter onto a single 
periodic timer.

If the timers can be configured in both periodic and oneshot modes, then you 
may want to have different implementations based on that.

Paul

  reply	other threads:[~2012-02-08 10:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07  6:19 [Qemu-devel] [RFC PATCH v2 0/4]Zynq-7000 EPP platform model Peter A. G. Crosthwaite
2012-02-07  6:19 ` [Qemu-devel] [RFC PATCH v2 1/4] cadence_uart: initial version of device model Peter A. G. Crosthwaite
2012-02-07  6:19 ` [Qemu-devel] [RFC PATCH v2 2/4] cadence_ttc: " Peter A. G. Crosthwaite
2012-02-07 11:28   ` Paul Brook
2012-02-08  7:27     ` Peter Crosthwaite
2012-02-08 10:15       ` Paul Brook [this message]
2012-02-08 10:35         ` Peter Crosthwaite
2012-02-08 12:35           ` Paul Brook
2012-02-08 12:47             ` Peter Crosthwaite
2012-02-07  6:19 ` [Qemu-devel] [RFC PATCH v2 3/4] cadence_gem: " Peter A. G. Crosthwaite
2012-02-07  6:19 ` [Qemu-devel] [RFC PATCH v2 4/4] xilinx_zynq: machine model initial version Peter A. G. Crosthwaite
2012-02-07 11:25 ` [Qemu-devel] [RFC PATCH v2 0/4]Zynq-7000 EPP platform model Paul Brook
2012-02-08  8:24   ` Peter Crosthwaite

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=201202081015.25639.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=afaerber@suse.de \
    --cc=duyl@xilinx.com \
    --cc=edgar.iglesias@petalogix.com \
    --cc=john.linn@xilinx.com \
    --cc=john.williams@petalogix.com \
    --cc=linnj@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=peter.crosthwaite@petalogix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.