From patchwork Fri Sep 17 16:55:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vipin Mehta X-Patchwork-Id: 188702 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8HGtK4f023668 for ; Fri, 17 Sep 2010 16:55:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754176Ab0IQQzT (ORCPT ); Fri, 17 Sep 2010 12:55:19 -0400 Received: from mail.atheros.com ([12.19.149.2]:38376 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761Ab0IQQzS (ORCPT ); Fri, 17 Sep 2010 12:55:18 -0400 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Fri, 17 Sep 2010 09:55:12 -0700 Received: from smtp.atheros.com (10.10.16.187) by SC1EXHC-01.global.atheros.com (10.10.20.111) with Microsoft SMTP Server (TLS) id 8.2.213.0; Fri, 17 Sep 2010 09:55:17 -0700 Received: by smtp.atheros.com (sSMTP sendmail emulation); Fri, 17 Sep 2010 09:55:17 -0700 From: Vipin Mehta To: CC: , , Subject: [PATCH] staging: ath6kl: Fixing a race condition during initialization Date: Fri, 17 Sep 2010 09:55:15 -0700 Message-ID: <1284742515-3013-1-git-send-email-vmehta@atheros.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Sep 2010 16:55:21 +0000 (UTC) diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c index ff7976e..41d8842 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c @@ -4174,8 +4174,6 @@ ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap, A_UINT32 sw_ver, AR_SOFTC_T *ar = (AR_SOFTC_T *)devt; struct net_device *dev = ar->arNetDev; - ar->arWmiReady = TRUE; - wake_up(&arEvent); A_MEMCPY(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN); AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("mac address = %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", dev->dev_addr[0], dev->dev_addr[1], @@ -4186,6 +4184,10 @@ ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap, A_UINT32 sw_ver, ar->arVersion.wlan_ver = sw_ver; ar->arVersion.abi_ver = abi_ver; + /* Indicate to the waiting thread that the ready event was received */ + ar->arWmiReady = TRUE; + wake_up(&arEvent); + #if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN wmi_pmparams_cmd(ar->arWmi, 0, 1, 0, 0, 1, IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN); #endif