From: Ralf Baechle <ralf@linux-mips.org>
To: Kevin Cernekee <cernekee@gmail.com>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] MIPS: Fix CP0 COUNTER clockevent race
Date: Wed, 24 Nov 2010 11:34:05 +0000 [thread overview]
Message-ID: <20101124113404.GA30204@linux-mips.org> (raw)
In-Reply-To: <444ef6c4bbb47d55c700452d8cd23229@localhost>
On Tue, Nov 23, 2010 at 10:26:44AM -0800, Kevin Cernekee wrote:
> write_c0_compare(read_c0_count());
>
> Even if the counter doesn't increment during execution, this might not
> generate an interrupt until the counter wraps around. The CPU may
> perform the comparison each time CP0 COUNT increments, not when CP0
> COMPARE is written.
>
> If mips_next_event() is called with a very small delta, and CP0 COUNT
> increments during the calculation of "cnt += delta", it is possible
> that CP0 COMPARE will be written with the current value of CP0 COUNT.
> If this is detected, the function should return -ETIME, to indicate
> that the interrupt might not have actually gotten scheduled.
Good catch - though on real hardware it should be theoretical as the
minimum timer interval is 300ns. So it should only be trigerable on
a very slow system like a hardware emulator or maybe if a software
emulator like qemu gets rescheduled between the update and the read-back.
Applied,
Ralf
next prev parent reply other threads:[~2010-11-24 11:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 18:26 [PATCH RESEND 1/7] MIPS: sync after cacheflush Kevin Cernekee
2010-11-23 18:26 ` [PATCH RESEND 2/7] MIPS: pfn_valid() is broken on low memory HIGHMEM systems Kevin Cernekee
2010-11-23 18:26 ` [PATCH v2 RESEND 3/7] MIPS: Move FIXADDR_TOP into spaces.h Kevin Cernekee
2010-11-23 18:26 ` [PATCH v4 RESEND 4/7] MIPS: HIGHMEM DMA on noncoherent MIPS32 processors Kevin Cernekee
2010-11-23 18:26 ` [PATCH RESEND 5/7] MIPS: Install handlers for BMIPS software IRQs Kevin Cernekee
2010-11-23 18:26 ` [PATCH 6/7] MIPS: Fix CP0 COUNTER clockevent race Kevin Cernekee
2010-11-24 11:34 ` Ralf Baechle [this message]
2010-11-23 18:26 ` [PATCH 7/7] MIPS: Fix regression on BCM4710 processor detection Kevin Cernekee
2010-11-24 11:34 ` Ralf Baechle
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=20101124113404.GA30204@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=cernekee@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.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