brcmfmac: Fix race condition bug when deleting p2p interface.
authorHante Meuleman <meuleman@broadcom.com>
Fri, 18 Sep 2015 20:08:16 +0000 (22:08 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 29 Sep 2015 07:56:03 +0000 (10:56 +0300)
commita2044d91d9d25a0e9e2abb43ca90cceee032f6ee
treecb360d4f6acad3c3a60655f8cf70b0938b80a7d2
parent8268c2011d255b547a9093977e728af5cf16d69e
brcmfmac: Fix race condition bug when deleting p2p interface.

When p2p device interface gets deleted by deinitialising discovery
it will result in an event which removes the interface, but that is
also done by delete p2p interface code. This results in race
condition which sometimes results in lockup/crash. With this patch
the delete device interface will wait for the event (with timeout)
removing the possible race condition. Also on the stop device call
from cfg80211 the deinitialisation of the discovery device should
be avoided as it can result in a similar situation.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/brcm80211/brcmfmac/p2p.c