dbglog_host: add timeout for dbglog_block fwlog read
Add timeout for dbglog_block fwlog read operation.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
diff --git a/CORE/UTILS/FWLOG/dbglog_host.c b/CORE/UTILS/FWLOG/dbglog_host.c
index 7a7be6d..5ac1dee 100644
--- a/CORE/UTILS/FWLOG/dbglog_host.c
+++ b/CORE/UTILS/FWLOG/dbglog_host.c
@@ -57,6 +57,7 @@
#define CLD_DEBUGFS_DIR "cld"
#endif
#define DEBUGFS_BLOCK_NAME "dbglog_block"
+#define CNSS_DIAG_FWLOG_TIMEOUT 2000
#define ATH_MODULE_NAME fwlog
#include <a_debug.h>
@@ -4291,8 +4292,9 @@
spin_unlock_bh(&fwlog->fwlog_queue.lock);
- ret = wait_for_completion_interruptible(
- &fwlog->fwlog_completion);
+ ret = wait_for_completion_interruptible_timeout(
+ &fwlog->fwlog_completion,
+ msecs_to_jiffies(CNSS_DIAG_FWLOG_TIMEOUT));
if (ret == -ERESTARTSYS) {
vfree(buf);
return ret;