Subject: [PATCH 05/10] S3C I2S: lrsync function made to work with IRQs disabled.

From: [email-masked] (Mark Brown)
Date: Wed, 16 Sep 2009 11:26:58 +0100

On Wed, Sep 16, 2009 at 10:03:41AM +0900, jassi brar wrote:
> On Wed, Sep 16, 2009 at 9:14 AM, Ben Dooks <[email-masked]> wrote:

> > I don't think cpu_relax() gives a defined 'timeout' length, thus this
> > loop is of a very indeterminate length of timeout.

> Ofcourse the total delay is non-deterministic. Besides, there is no
> hard limit on the amount of time we want to wait on lrsync. And this
> non-deterministic delay comes into picture only when the I2S is
> broken. It is second best option to simply hanging.
> Total wait period is _atleast_ what we want, as is mentioned in the changelog.

The length of time you should need to wait for a LRCLK transition is
given by the sample rate - even 1ms is a very generous timeout for 8kHz,
which is the lowest sample rate you'd really expect to see.  The actual
value isn't terribly important since we should never hit it when things
aren't broken.