[Top] [All Lists]

Re: [PATCH] MIPS: __raw_spin_lock() spins forever on ticket wrap.

To: David Daney <>
Subject: Re: [PATCH] MIPS: __raw_spin_lock() spins forever on ticket wrap.
From: Ralf Baechle <>
Date: Fri, 27 Mar 2009 23:47:50 +0100
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Mutt/1.5.18 (2008-05-17)
On Fri, Mar 27, 2009 at 10:07:02AM -0700, David Daney wrote:

> If the lock is not acquired and has to spin *and* the second attempt
> to acquire the lock fails, the delay time is not masked by the ticket
> range mask.  If the ticket number wraps around to zero, the result is
> that the lock sampling delay is essentially infinite (due to casting
> -1 to an unsigned int).
> The fix: Always mask the difference between my_ticket and the current
> ticket value before calculating the delay.

Thanks, applied!


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