From 973b594eaa8fbbd7f26db43d6e9b9fb6bfd6a548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Bida?= Date: Sun, 13 Aug 2023 20:08:59 +0200 Subject: [PATCH] [posix] fix rcp reset flow in `ResetRcp` (#9314) Remove call to `WaitResponse` after calling `HardwareReset` which didn't trigger any spinel transaction. `kOpenFileDelay` change form 500 to 50. --- src/lib/spinel/radio_spinel_impl.hpp | 6 +++++- src/posix/platform/hdlc_interface.hpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/spinel/radio_spinel_impl.hpp b/src/lib/spinel/radio_spinel_impl.hpp index c97130564..908b02b9b 100644 --- a/src/lib/spinel/radio_spinel_impl.hpp +++ b/src/lib/spinel/radio_spinel_impl.hpp @@ -259,7 +259,11 @@ template void RadioSpinel::ResetRcp(bool } hardwareReset = (mSpinelInterface.HardwareReset() == OT_ERROR_NONE); - SuccessOrExit(WaitResponse(false)); + + if (hardwareReset) + { + SuccessOrExit(WaitResponse(false)); + } resetDone = true; diff --git a/src/posix/platform/hdlc_interface.hpp b/src/posix/platform/hdlc_interface.hpp index 04266a667..bc2b899ac 100644 --- a/src/posix/platform/hdlc_interface.hpp +++ b/src/posix/platform/hdlc_interface.hpp @@ -235,7 +235,7 @@ private: { kMaxWaitTime = 2000, ///< Maximum wait time in Milliseconds for socket to become writable (see `SendFrame`). kResetTimeout = 5000, ///< Maximum wait time in Milliseconds for file to become ready (see `ResetConnection`). - kOpenFileDelay = 500, ///< Delay between open file calls, in Milliseconds (see `ResetConnection`). + kOpenFileDelay = 50, ///< Delay between open file calls, in Milliseconds (see `ResetConnection`). kRemoveRcpDelay = 2000, ///< Delay for removing RCP device from host OS after hard reset (see `ResetConnection`). };