All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [POWERPC] Fix off-by-one error in setting decrementer on Book E
Date: Tue, 30 Oct 2007 17:23:42 +0300	[thread overview]
Message-ID: <47273E6E.4030103@ru.mvista.com> (raw)
In-Reply-To: <42A23BAB-6081-41CC-870C-7C7F094D69C3@kernel.crashing.org>

Hello.

Kumar Gala wrote:

>>The decrementer in Book E and 4xx processors interrupts on the
>>transition from 1 to 0, rather than on the 0 to -1 transition as on
>>64-bit server and 32-bit "classic" (6xx/7xx/7xxx) processors.

>>This fixes the problem by making set_dec subtract 1 from the count for
>>server and classic processors.  Since set_dec already had a bunch of
>>ifdefs to handle different processor types, there is no net increase
>>in ugliness. :)

>>This also removes a redundant call to set the decrementer to
>>0x7fffffff - it was already set to that earlier in timer_interrupt.

>>Signed-off-by: Paul Mackerras <paulus@samba.org>
>>---

> ...

>>diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
>>index f058955..eed64bd 100644
>>--- a/include/asm-powerpc/time.h
>>+++ b/include/asm-powerpc/time.h
>>@@ -183,6 +183,7 @@ static inline void set_dec(int val)
>> #elif defined(CONFIG_8xx_CPU6)
>> 	set_dec_cpu6(val);
>> #else
>>+	--val;	/* classic decrementer interrupts when dec goes negative */
>> #ifdef CONFIG_PPC_ISERIES
>> 	int cur_dec;

> Unless I'm reading set_dec() you are getting --val on booke.

    You meant "misreading"?
    Indeed the patch is decrementing count for *both* book E and classic CPUs 
now, and that slipped past my attention the first time.  The patch summary 
("Fix off-by-one error in setting decrementer on Book E") also looks stange -- 
there is *no* off-by-one error on Book E, and the description correctly says 
that we're fixing off-by-one on classic/server CPUs.
     Maybe I should even go and post my patch variant instead...

WBR, Sergei

      reply	other threads:[~2007-10-30 14:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29  2:57 [POWERPC] Fix off-by-one error in setting decrementer on Book E Paul Mackerras
2007-10-29  3:10 ` Paul Mackerras
2007-10-29  3:16 ` Olof Johansson
2007-10-29 16:52 ` Sergei Shtylyov
2007-10-31  9:40   ` Paul Mackerras
2007-10-31 14:12     ` Sergei Shtylyov
2007-10-30  3:52 ` Kumar Gala
2007-10-30 14:23   ` Sergei Shtylyov [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=47273E6E.4030103@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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.