diff options
author | Vipin Mehta <vmehta@atheros.com> | 2010-09-17 12:55:15 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-20 20:02:02 -0400 |
commit | 9b906a33e0a459ea4d51c8d243154c6998be2a1d (patch) | |
tree | b65c3139397cb74da1f0858d7c28c48b3a0bcc01 /drivers/staging/ath6kl/os | |
parent | 103281df0b7fec07872ef033666a1707b5755b9c (diff) |
staging: ath6kl: Fixing a race condition during initialization
The commit fixes a race condition in the initialization portion of the
driver. The problem was observed while testing with the kernel in the
staging-next tree. The wait on the ready event is signalled prematurely
before setting the arVersion.wlan_ver and arVersion.abi_ver. The code
waiting on this semaphore checks for the validity of these values and
hence may proceed with an un-updated values of these fields. The wakeup
signal is now sent after these values are set.
Signed-off-by: Vipin Mehta <vmehta@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/ath6kl/os')
-rw-r--r-- | drivers/staging/ath6kl/os/linux/ar6000_drv.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c index c7922c9ff23..daba6e4cb9d 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c | |||
@@ -4170,8 +4170,6 @@ ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap, A_UINT32 sw_ver, | |||
4170 | AR_SOFTC_T *ar = (AR_SOFTC_T *)devt; | 4170 | AR_SOFTC_T *ar = (AR_SOFTC_T *)devt; |
4171 | struct net_device *dev = ar->arNetDev; | 4171 | struct net_device *dev = ar->arNetDev; |
4172 | 4172 | ||
4173 | ar->arWmiReady = TRUE; | ||
4174 | wake_up(&arEvent); | ||
4175 | A_MEMCPY(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN); | 4173 | A_MEMCPY(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN); |
4176 | AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("mac address = %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", | 4174 | AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("mac address = %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", |
4177 | dev->dev_addr[0], dev->dev_addr[1], | 4175 | dev->dev_addr[0], dev->dev_addr[1], |
@@ -4182,6 +4180,10 @@ ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap, A_UINT32 sw_ver, | |||
4182 | ar->arVersion.wlan_ver = sw_ver; | 4180 | ar->arVersion.wlan_ver = sw_ver; |
4183 | ar->arVersion.abi_ver = abi_ver; | 4181 | ar->arVersion.abi_ver = abi_ver; |
4184 | 4182 | ||
4183 | /* Indicate to the waiting thread that the ready event was received */ | ||
4184 | ar->arWmiReady = TRUE; | ||
4185 | wake_up(&arEvent); | ||
4186 | |||
4185 | #if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN | 4187 | #if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN |
4186 | wmi_pmparams_cmd(ar->arWmi, 0, 1, 0, 0, 1, IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN); | 4188 | wmi_pmparams_cmd(ar->arWmi, 0, 1, 0, 0, 1, IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN); |
4187 | #endif | 4189 | #endif |