From e83ecab39587e854492d0184d0b610dfe93da1d8 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Fri, 3 Jun 2022 04:58:36 +0800 Subject: [PATCH] [log] add log to record the RCP restoration state (#7743) --- src/lib/spinel/radio_spinel_impl.hpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/lib/spinel/radio_spinel_impl.hpp b/src/lib/spinel/radio_spinel_impl.hpp index 176e79419..b7650ddf7 100644 --- a/src/lib/spinel/radio_spinel_impl.hpp +++ b/src/lib/spinel/radio_spinel_impl.hpp @@ -1671,18 +1671,11 @@ otError RadioSpinel::WaitResponse(void) do { uint64_t now; - uint64_t remain; now = otPlatTimeGet(); - if (end <= now) - { - HandleRcpTimeout(); - ExitNow(mError = OT_ERROR_NONE); - } - remain = end - now; - - if (mSpinelInterface.WaitForFrame(remain) != OT_ERROR_NONE) + if ((end <= now) || (mSpinelInterface.WaitForFrame(end - now) != OT_ERROR_NONE)) { + otLogWarnPlat("Wait for response timeout"); HandleRcpTimeout(); ExitNow(mError = OT_ERROR_NONE); } @@ -2309,6 +2302,7 @@ void RadioSpinel::RecoverFromRcpFailure(void) } --mRcpFailureCount; + otLogNotePlat("RCP recovery is done"); exit: return;