[PATCH] spi: mvebu: use wait_on_timeout instead of a loop with udelay.

Sascha Hauer s.hauer at pengutronix.de
Sun Dec 11 21:45:21 PST 2016


On Thu, Dec 08, 2016 at 11:20:50AM +0100, Uwe Kleine-König wrote:
> This looks nicer and reduces the time to transfer 40 MB at 50 MHz from
> 203 seconds to 87 seconds.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
> Side note:
> 
> When using
> 
> 	while(!(readl(p->base + SPI_IF_CTRL) & IF_READ_READY))
> 		;
> 	return 0;
> 
> instead, the time goes down to 24 seconds.

Have you tried how many loop iterations it takes to complete? Maybe it's
worth it to try a few times and only after that start a real timeout
loop.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list