Merge "hal: fix race condition between sthal and ahal"