From: Jérôme Pouiller Date: Fri, 25 Feb 2022 11:24:03 +0000 (+0100) Subject: staging: wfx: prefer to wait for an event instead to sleep X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0803a85a6f236f648b80584bc02b86b092f43d5a;p=linux.git staging: wfx: prefer to wait for an event instead to sleep 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 Link: https://lore.kernel.org/r/20220225112405.355599-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 0b1ed12c0e83f..ae3cc5919dcd5 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; }