From 97967f0526f7c26ce77e139bf7a51c737601115c Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 21 Jan 2023 19:55:29 +0100 Subject: [PATCH] drivers: ieee802154: rf2xx: Fix hang on 0x2c isr_status When transceiver is overload on reception a frame can be stored on the internal buffer without processing a frame start interrupt. The frame will complete and system will received a interrupt and signal receiver thread with an isr_status equal to 0x2c. The current implementation process one flag at time and it may hang when status is 0x2c. This issue can be reproduced using two nodes where one perform a regular TX broadcast and tThe other one should be wait for frames. The receptor should run on debug mode and system should be started normally. The problem happens when pressing CTRL+C on the debugger, which will cause system to stop. However, the transceiver still can receive one last frame. After a few transmission user can continue application and a isr_status of 0x2c will be visible if CONFIG_IEEE802154_DRIVER_LOG_DEBUG is enabled. This fixes the current issue by processing all RF2XX_TRX_END events. Signed-off-by: Gerson Fernando Budke --- drivers/ieee802154/ieee802154_rf2xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ieee802154/ieee802154_rf2xx.c b/drivers/ieee802154/ieee802154_rf2xx.c index 6619febd54d..2d2ed83b03d 100644 --- a/drivers/ieee802154/ieee802154_rf2xx.c +++ b/drivers/ieee802154/ieee802154_rf2xx.c @@ -326,7 +326,8 @@ static void rf2xx_thread_main(void *arg) rf2xx_iface_sram_read(ctx->dev, 0, &ctx->rx_phr, 1); } - } else if (isr_status & (1 << RF2XX_TRX_END)) { + } + if (isr_status & (1 << RF2XX_TRX_END)) { rf2xx_process_trx_end(ctx->dev); } }