This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 8bc4680cb818e4afdb3780873e34cae560d25894 Author: raiden00pl <[email protected]> AuthorDate: Tue Oct 27 11:11:27 2026 +0100 wireless/ieee802154: fix the energydetect() lock comments The comments said the radio calls the MAC with its lock held, but the MAC is released because energydetect() can take the radio lock. Assisted-by: Claude Code Signed-off-by: raiden00pl <[email protected]> --- wireless/ieee802154/mac802154.c | 4 ++-- wireless/ieee802154/mac802154_scan.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index 9592921be85..b7d5fd5cc63 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -1748,8 +1748,8 @@ mac802154_edresult(FAR const struct ieee802154_radiocb_s *radiocb, nxmutex_unlock(&priv->lock); - /* The radio calls the MAC with its lock held, the energy detect of the - * next channel starts after the MAC is released + /* energydetect() can take the radio lock, which the radio holds while it + * calls the MAC, so the next channel starts after the MAC is released */ if (next) diff --git a/wireless/ieee802154/mac802154_scan.c b/wireless/ieee802154/mac802154_scan.c index f181bd08f45..1e775a152ac 100644 --- a/wireless/ieee802154/mac802154_scan.c +++ b/wireless/ieee802154/mac802154_scan.c @@ -160,8 +160,8 @@ int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req) mac802154_setchpage(priv, req->chpage); mac802154_setchannel(priv, req->channels[priv->scanindex]); - /* The radio calls the MAC with its lock held, so the energy - * detect starts after the MAC is released + /* energydetect() can take the radio lock, which the radio holds + * while it calls the MAC, so it starts after the MAC is released */ nxmutex_unlock(&priv->lock);
