staging: wfx: prefer to wait for an event instead to sleep
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Fri, 25 Feb 2022 11:24:03 +0000 (12:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Feb 2022 13:00:29 +0000 (14:00 +0100)
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>
Link: https://lore.kernel.org/r/20220225112405.355599-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/hif_tx.c

index 0b1ed12..ae3cc59 100644 (file)
@@ -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;
        }