wifi: iwlwifi: mvm: Fix a race in scan abort flow
authorIlan Peer <ilan.peer@intel.com>
Sun, 25 Aug 2024 05:56:37 +0000 (08:56 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:15:05 +0000 (10:15 +0200)
commit87c1c28a9aa149489e1667f5754fc24f4973d2d0
tree33a1ff7dd4c296174292b4aa8662dbed04a52f44
parent6d1b52cc9af56b773238516030b82310cb1f1ba2
wifi: iwlwifi: mvm: Fix a race in scan abort flow

When the upper layer requests to cancel an ongoing scan, a race
is possible in which by the time the driver starts to handle the
upper layers scan cancel flow, the FW already completed handling
the scan request and the driver received the scan complete
notification but still did not handle the notification. In such a
case the FW will simply ignore the scan abort request coming from
the driver, no notification would arrive from the FW and the entire
abort flow would be considered a failure.

To better handle this, check the status code returned by the FW for
the scan abort command. In case the status indicates that
no scan was aborted, complete the scan abort flow with success, i.e.,
the scan was aborted, as the flow is expected to consume the scan
complete notification.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240825085558.483989d3baef.I3340556a222388504c6330b333360bf77d10f9e2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
drivers/net/wireless/intel/iwlwifi/mvm/scan.c