[BUGFIX] iwlwifi: mvm: don't schedule the roc_done_wk if it is already running

When P2P roc is removed, the IWL_MVM_STATUS_NEED_FLUSH_P2P bit is set
to indicate to iwl_mvm_roc_done_wk() that the removed roc is a P2P
one, so it will flush the broadcast station and not the aux station.

However, since setting this bit and scheduling the worker is done
in roc ended flow as well as in case the roc is removed, there is
a race where the worker has already started running (but did not
test this bit yet) and then it is scheduled again. In this case,
the first run of the worker will clear this bit, and thus the second
run will find it already cleared and will try to flush and remove
the aux station by mistake.

Fix it by scheduling the worker only if this bit is not yet set. In
case this bit is already set, the worker is either running or
scheduled, so there is no need to re-schedule it.


Change-Id: If5924375e9bfd46214ab8ab81cb9d0f5c82fbcbc
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/315437
automatic-review: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
x-iwlwifi-stack-dev: b4cf37a4317b488f78cf9c110a5e05bca6350010
2 files changed