All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Richard Cochran <richard.cochran@domain.hid>
Cc: adeos-main@gna.org, xenomai@xenomai.org
Subject: Re: [Xenomai-core] [Adeos-main] [PATCH] Adeos support for IXP4xx
Date: Tue, 17 Apr 2007 19:48:55 +0200	[thread overview]
Message-ID: <17957.2183.25570.823923@domain.hid> (raw)
In-Reply-To: <899865CA54E4444DAF2E3639C04C5F4805EC70@domain.hid>

Richard Cochran wrote:
 > This patch adds Adeos support for the Intel IXP425 processor. It may
 > also work on the IXP465, but I only tested it on the 425. The patch
 > is against a vanilla 2.6.19 kernel.

Great.

 > +static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
 > +{
 > +	write_seqlock(&xtime_lock);
 > +	if (__ipipe_mach_timerstolen) {
 > +		/* If some other domain has taken over the timer, then
 > +		 * do nothing (ipipe has acked it, and the other
 > +		 * domain has reprogramed it)
 > +		 */
 > +	} else {
 > +		/* If Linux is running under ipipe, but it still has
 > +		 * the control over the timer (no Xenomai for
 > +		 * example), then reprogram the timer (ipipe has
 > +		 * already acked it)
 > +		 */
 > +		*IXP4XX_OSRT1 = LATCH | ONE_SHOT_ENABLE;
 > +	}
 > +	/*
 > +	 * Catch up with the real idea of time
 > +	 */
 > +	while ((signed long)(*IXP4XX_OSTS - last_jiffy_time) >= LATCH) {
 > +		timer_tick();
 > +		last_jiffy_time += LATCH;
 > +	}
 > +	write_sequnlock(&xtime_lock);
 > +	return IRQ_HANDLED;
 > +}

For reasons explained on the wiki, I would rather see
ixp4xx_timer_interrupt implemented as:

	if (__ipipe_mach_timerstolen) {
		/* If some other domain has taken over the timer, then
		 * do nothing (ipipe has acked it, and the other
		 * domain has reprogramed it)
		 */
		timer_tick();
		last_jiffy_time += LATCH;
	} else {
		/* If Linux is running under ipipe, but it still has
		 * the control over the timer (no Xenomai for
		 * example), then reprogram the timer (ipipe has
		 * already acked it)
		 */
	        while ((long)(*IXP4XX_OSTS - last_jiffy_time) >= LATCH) {
		        timer_tick();
		        last_jiffy_time += LATCH;
	        }
		*IXP4XX_OSRT1 = LATCH | ONE_SHOT_ENABLE;
	}

 > +void __ipipe_mach_set_dec(unsigned long delay)
 > +{
 > +	unsigned long flags;
 > +	if (delay > 8) {

Why 8 ? It looks suspiciously like you just copied the PXA code. 

-- 


					    Gilles Chanteperdrix.


  reply	other threads:[~2007-04-17 17:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-17  6:02 [Xenomai-core] [PATCH] Adeos support for IXP4xx Richard Cochran
2007-04-17 17:48 ` Gilles Chanteperdrix [this message]
2007-04-17 17:58   ` [Xenomai-core] [Adeos-main] " Gilles Chanteperdrix
2007-04-18  5:58     ` Richard Cochran
2007-04-18  7:45       ` Gilles Chanteperdrix
2007-04-18  5:21   ` Richard Cochran
2007-04-18  7:53     ` Gilles Chanteperdrix
2007-04-18  9:19       ` Richard Cochran

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=17957.2183.25570.823923@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=adeos-main@gna.org \
    --cc=richard.cochran@domain.hid \
    --cc=xenomai@xenomai.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.