Home
last modified time | relevance | path

Searched hist:b4121bfb3b1873f77e878f99437f1a5269c43f10 (Results 1 – 1 of 1) sorted by relevance

/optee_os/core/drivers/
H A Dpl011.cb4121bfb3b1873f77e878f99437f1a5269c43f10 Mon Oct 09 12:23:55 UTC 2017 Jerome Forissier <jerome.forissier@linaro.org> pl011: prevent putc() and flush() function from blocking indefinitely

It may happen that trace functions are called by OP-TEE when the UART
or its clock is disabled by the non-secure OS. In such a case, flush()
is likely to loop indefinitely, because the UART status register may
never contain the expected value. Make the code more robust by checking
if the UART is enabled in the wait loop. If it is not, or if the status
bit remains zero due to the clock being turned off, return immediately.
By doing so, we allow to drop some output rather than hang the whole
system.

Fixes: https://github.com/OP-TEE/optee_os/issues/1863
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>