summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Viel <clement.viel@qorvo.com>2023-03-31 18:26:34 +0200
committerClément Viel <clement.viel@qorvo.com>2023-04-04 09:31:54 -0700
commit0beaa9090d4ffbd9b6ed2bcef02167076bd110b3 (patch)
tree6a13d726a3a983cb0ac55c465c3516a3bef2c07e
parent0457964d772872a2b8e8c5be2b0891e844d121a2 (diff)
downloaduwb-android-gs-bluejay-5.10-android13-qpr3.tar.gz
Bug: 275542396 Change-Id: I7ecc6d90dffa18f59d2d9186f0fa7edfc8c9cac3 Signed-off-by: Clément Viel <clement.viel@qorvo.com>
-rw-r--r--mac/ops.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mac/ops.c b/mac/ops.c
index 65d7e8a..bfeb3a2 100644
--- a/mac/ops.c
+++ b/mac/ops.c
@@ -24,10 +24,13 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <net/rtnetlink.h>
+#include <linux/jiffies.h>
#include "mcps802154_i.h"
#include "llhw-ops.h"
+#define DW3000_MAX_STOP_WAIT 10000
+
static int mcps802154_start(struct ieee802154_hw *hw)
{
struct mcps802154_local *local = hw->priv;
@@ -55,6 +58,7 @@ static int mcps802154_start(struct ieee802154_hw *hw)
static void mcps802154_stop(struct ieee802154_hw *hw)
{
struct mcps802154_local *local = hw->priv;
+ int rc;
ASSERT_RTNL();
WARN_ON(!local->started);
@@ -63,7 +67,9 @@ static void mcps802154_stop(struct ieee802154_hw *hw)
mcps802154_ca_stop(local);
mutex_unlock(&local->fsm_lock);
- wait_event(local->wq, !local->started);
+ rc = wait_event_timeout(local->wq, !local->started, msecs_to_jiffies(DW3000_MAX_STOP_WAIT));
+ if (!rc)
+ pr_err("%s timeout elapsed, event !local->started = false\n", __func__);
}
static int mcps802154_xmit_async(struct ieee802154_hw *hw, struct sk_buff *skb)