Re: [U-Boot] [PATCH] imx: syscounter: make sure asm is volatile

2018-03-09 Thread Stefano Babic
On 09/03/2018 11:46, Fabio Estevam wrote: > [Adding Stefano] > > On Thu, Mar 8, 2018 at 1:21 AM, Yasushi SHOJI wrote: >> Without the volatile attribute, compilers are entitled to optimize out >> the same asm(). In the case of __udelay() in syscounter.c, it calls >>

Re: [U-Boot] [PATCH] imx: syscounter: make sure asm is volatile

2018-03-09 Thread Fabio Estevam
[Adding Stefano] On Thu, Mar 8, 2018 at 1:21 AM, Yasushi SHOJI wrote: > Without the volatile attribute, compilers are entitled to optimize out > the same asm(). In the case of __udelay() in syscounter.c, it calls > `get_ticks()` twice, one for the starting time and the

[U-Boot] [PATCH] imx: syscounter: make sure asm is volatile

2018-03-07 Thread Yasushi SHOJI
Without the volatile attribute, compilers are entitled to optimize out the same asm(). In the case of __udelay() in syscounter.c, it calls `get_ticks()` twice, one for the starting time and the second in the loop to check the current time. When compilers inline `get_ticks()` they see the same