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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 10 Jun 2013, Ralf Baechle wrote:

> > Only an interrupt can wake the core from 'wait', enable interrupts
> > locally before executing 'wait'.
> > 
> > Signed-off-by: Manuel Lauss <manuel.lauss@xxxxxxxxx>
> > ---
> > 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.

 My understanding has been the race is that an interrupt can be taken 
between the MTC0 instruction used to enable interrupts and the WAIT 
instruction and the handler can disable interrupts back.  That's not going 
to be a problem if the interrupt is taken "a few cycles" later, because by 
then WAIT will have already been executed.

 Have I been missing something here?

  Maciej


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux