Hi Leo,

> Has anyone else experienced this?

Are u using the latest ATF?

Yep
 

If u can build the ATF w/t source code, could u help check if the
patch 7c2d6de8b89 "Add memory barrier after pll setting" has been
included in your code base?

Just checked, and it wasn't in my code base.


BTW, because now in ATF, the mmio_write/mmio_read APIs have not added
any memory barrier, so it's easily introduce the out-of-order issue,
especially now armv8 has more weaker memory model rather than armv7;
so if upper patch can not fix your issue, could u also try below
patch, which it will add memory barriers for register's accessing:

https://github.com/Leo-Yan/arm-trusted-firmware/commit/a87af905ef77bf96409b846788512d34ac84a439


Interesting that there were no barriers, as the mmio macros were written by ARM. Re-building with this patch cherry-picked into ATL, I've just booted 15 times and not seen the issue. So this seems (so far at least) to have resolved the intermittent hang :-)

 
I also have sent pull request for this patch.

Yes getting this merged would be good.

Also do you know if anyone is investigating further why removing the packed attribute on usb_endpoint_descriptor is required when compiling ATL with gcc 4.9 (which is the other change I also have applied to my ATL code).

regards,

Peter.