[Top] [All Lists]

Re: [PATCH v2] MIPS: Alchemy: fix wait function

To: Manuel Lauss <>
Subject: Re: [PATCH v2] MIPS: Alchemy: fix wait function
From: Ralf Baechle <>
Date: Mon, 10 Jun 2013 17:49:44 +0200
Cc: Linux-MIPS <>
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, May 23, 2013 at 03:28:36PM +0200, Manuel Lauss wrote:

> Only an interrupt can wake the core from 'wait', enable interrupts
> locally before executing 'wait'.
> Signed-off-by: Manuel Lauss <>
> ---
> Ralf made me aware of the race in between enabling interrupts and
> entering wait.  While this patch does not eliminate it, it shrinks it
> to 1 instruction.  It's not perfect, but lets Alchemy boot until a
> more sophisticated solution (like __r4k_wait) can be implemented
> without having to duplicate the interrupt exception handler.

It doesn't shrink it - interrupts will be pending from the time they
were disabled to the point where they get re-enabled.  That can be quite
a few cycles and so the likelyhood for hitting the race is not that low.


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