[Top] [All Lists]

Re: Bug in atomic_sub_if_positive

To: Morten Larsen <>
Subject: Re: Bug in atomic_sub_if_positive
From: Ralf Baechle <>
Date: Thu, 26 Jun 2008 14:11:20 +0200
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Mutt/1.5.17 (2007-11-01)
On Wed, Jun 25, 2008 at 11:07:24PM -0700, Morten Larsen wrote:

> As far as I can tell the branch optimization fixes in 2.6.21 introduced
> a bug in atomic_sub_if_positive that causes it to return even when the
> sc instruction fails. The result is that e.g. down_trylock becomes
> unreliable as the semaphore counter is not always decremented.

I did play with a test program and can't reproduce the effect with my
assembler.  I have darm memories of gas immitating some obscure behaviour
of the IRIX assembler and I think it doesn't do so for all MIPS targets.

So I'm wandering what toolchain have you been using?


<Prev in Thread] Current Thread [Next in Thread>