ath9k: fix a chip wakeup related crash in ath9k_start
authorFelix Fietkau <nbd@openwrt.org>
Fri, 25 Mar 2011 16:43:41 +0000 (17:43 +0100)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:40:58 +0000 (11:40 -0700)
BugLink: http://bugs.launchpad.net/bugs/761134

commit f62d816fc4324afbb7cf90110c70b6a14139b225 upstream.

When the chip is still asleep when ath9k_start is called,
ath9k_hw_configpcipowersave can trigger a data bus error.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

drivers/net/wireless/ath/ath9k/main.c

index a09d15f..0848e09 100644 (file)
@@ -1063,6 +1063,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
                "Starting driver with initial channel: %d MHz\n",
                curchan->center_freq);
 
+       ath9k_ps_wakeup(sc);
+
        mutex_lock(&sc->mutex);
 
        if (ath9k_wiphy_started(sc)) {
@@ -1179,6 +1181,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
 mutex_unlock:
        mutex_unlock(&sc->mutex);
 
+       ath9k_ps_restore(sc);
+
        return r;
 }