Re: [PATCH v4] introduce macro spin_event_timeout()

From: Timur Tabi
Date: Tue Mar 10 2009 - 12:12:29 EST


Will Newton wrote:

> The correct timescale is rather application dependant - for some
> accesses that cross clock domains it can be a requirement to wait for
> a small number of core clock cycles (2 - 20) for a condition to become
> true, for others, e.g. PIO, it is more appropriate to wait for a few
> 100 cycles.

The timeout is only needed to avoid hangs in the driver. If the
response normally comes within 20 clocks, but you waited two
milliseconds until you gave up, that's not a bad thing. At least after
two milliseconds you've aborted the loop and returned an error.

--
Timur Tabi
Linux kernel developer at Freescale
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/