From f404a228aa43bd2cc8763b954d8bf9f5ffc32915 Mon Sep 17 00:00:00 2001 From: Ashish <104561745+aashu216@users.noreply.github.com> Date: Thu, 2 May 2024 22:44:49 +0530 Subject: [PATCH] [spinel] remove `mIsCoprocessorReady` flag check (#10144) - If we check in between SendReset() and WaitResponse(), mIsCoprocessorReady may become true before waitResponse() and if loop becomes false even successfully reset done. - mIsCoprocessorReady is already checked before sendReset() to avoid resetting in case of Mulipan architecture. There is no need to check in between sendReset() and waitResponse(). - Removed mIsCoprocessorReady from if loop check between sendReset() and waitResponse(). Signed-off-by: Ashishkumar Vara --- src/lib/spinel/spinel_driver.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/spinel/spinel_driver.cpp b/src/lib/spinel/spinel_driver.cpp index 0f49262cc..6c7268af1 100644 --- a/src/lib/spinel/spinel_driver.cpp +++ b/src/lib/spinel/spinel_driver.cpp @@ -129,8 +129,7 @@ void SpinelDriver::ResetCoprocessor(bool aSoftwareReset) mWaitingKey = SPINEL_PROP_LAST_STATUS; - if (aSoftwareReset && (SendReset(SPINEL_RESET_STACK) == OT_ERROR_NONE) && (!mIsCoprocessorReady) && - (WaitResponse() == OT_ERROR_NONE)) + if (aSoftwareReset && (SendReset(SPINEL_RESET_STACK) == OT_ERROR_NONE) && (WaitResponse() == OT_ERROR_NONE)) { VerifyOrExit(mIsCoprocessorReady, resetDone = false); LogCrit("Software reset co-processor successfully");