staging: wfx: avoid possible lock-up during scan
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 13 Sep 2021 13:01:36 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Sep 2021 07:16:31 +0000 (09:16 +0200)
commit8bce06b06b807468f36631f1fe17cbc336debde7
tree305179b22a08b5855d9c4b1e944897c9f2bbb302
parent10b72a7c59450b409b49abf51c794ec8c7233c11
staging: wfx: avoid possible lock-up during scan

If the environment is noisy, the device may take time to send scan
requests. Thus, scan requests durations > 5s have already been observed.
During the scan, traffic is neither received, neither sent. From the
user point-of-view, the traffic is frozen for a long time.

This patch reworks the scan processing. It gives to the device a smaller
time budget than previously. However, it does not expect the scan to be
complete and it is able to send another scan request to finish the work.

A big part of the patch aims to avoid an infinite loop if the device
goes crazy.

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