lkml.org 
[lkml]   [2022]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/10] staging: wfx: prefer to wait for an event instead to sleep
Date
From: Jérôme Pouiller <jerome.pouiller@silabs.com>

When possible it is better to wait for an explicit event instead of wait
an arbitrary amount of time.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
drivers/staging/wfx/hif_tx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 0b1ed12c0e83..ae3cc5919dcd 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -72,8 +72,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
wfx_bh_request_tx(wdev);

if (no_reply) {
- /* Chip won't reply. Give enough time to the wq to send the buffer. */
- msleep(100);
+ /* Chip won't reply. Ensure the wq has send the buffer before to continue. */
+ flush_workqueue(system_highpri_wq);
ret = 0;
goto end;
}
--
2.34.1
\
 
 \ /
  Last update: 2022-02-25 12:37    [W:0.103 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site