[PATCH] powerpc: Cell timebase bug workaround

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Oct 9 18:57:55 EST 2006

On Mon, 2006-10-09 at 18:36 +1000, Stephen Rothwell wrote:
> On Mon, 09 Oct 2006 17:05:17 +1000 Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:
> >
> > > Why not branch back to the mftb if the lower word is zero (this would
> > > also take care of the very unlikely "hitting the bug more than once" case
> > > and the "normal" case would then not have to branch at all.  (And it uses
> > > one less instruction.)
> >
> > Because that would cause us to spinloop for the whole duration of a tb
> > tick in that case, which is pretty bad when the timebase is slow (the
> > slower I've seen so far is 14Mhz).
> Right!  /me hits himself in the forehead :-)

Well, it's not -that- stupid .... I did consider it. The chances of
hitting the problem at all are so small that taking a 100ns hit or so
when it happen isn't -that- bad and it does make the normal case nicer
avoiding a branch....

In fact, I'll ask Mike what he thinks of doing it that way instead, it
might be a better option in the long run.


More information about the Linuxppc-dev mailing list