staging: wfx: wait for SCAN_CMPL after a SCAN_STOP
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 13 Sep 2021 13:01:35 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Sep 2021 07:16:31 +0000 (09:16 +0200)
commit10b72a7c59450b409b49abf51c794ec8c7233c11
tree5001f34e3c9fb080a23887c41b019a2250f75e70
parenta5a8eb1fe7448a621400c2c2e748b0a7b3736f43
staging: wfx: wait for SCAN_CMPL after a SCAN_STOP

When the device has finished a scan request, it send a scan complete
("SCAN_COMPL") indication. It is also possible to abort a scan request
with a "SCAN_STOP" message. A SCAN_COMPL is also send in this case.

The driver limits the delay to make a scan request. A timeout happens
almost never but is theoretically possible. Currently, if it happens
the driver does not wait for the SCAN_COMPL. Then, when the driver
starts the next scan request, the device may return -EBUSY (scan
requests often occur back-to-back).

This patch give a chance to the device to send a SCAN_COMPL after a scan
timeout.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20210913130203.1903622-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/scan.c