]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.3/ath9k-fix-suspend-by-waking-device-prior-to-stop.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.3 / ath9k-fix-suspend-by-waking-device-prior-to-stop.patch
1 From 3867cf6a8c699846e928e8f5a9f31013708df192 Mon Sep 17 00:00:00 2001
2 From: Sujith <Sujith.Manoharan@atheros.com>
3 Date: Wed, 23 Dec 2009 20:03:27 -0500
4 Subject: ath9k: fix suspend by waking device prior to stop
5
6 From: Sujith <Sujith.Manoharan@atheros.com>
7
8 commit 3867cf6a8c699846e928e8f5a9f31013708df192 upstream.
9
10 Ensure the device is awake prior to trying to tell hardware
11 to stop it. Impact of not doing this is we can likely leave
12 the device in an undefined state likely causing issues with
13 suspend and resume. This patch ensures harware is where it
14 should be prior to suspend.
15
16 Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
17 Signed-off-by: John W. Linville <linville@tuxdriver.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
19
20 ---
21 drivers/net/wireless/ath/ath9k/main.c | 6 ++++++
22 1 file changed, 6 insertions(+)
23
24 --- a/drivers/net/wireless/ath/ath9k/main.c
25 +++ b/drivers/net/wireless/ath/ath9k/main.c
26 @@ -2147,6 +2147,9 @@ static void ath9k_stop(struct ieee80211_
27 return; /* another wiphy still in use */
28 }
29
30 + /* Ensure HW is awake when we try to shut it down. */
31 + ath9k_ps_wakeup(sc);
32 +
33 if (sc->sc_flags & SC_OP_BTCOEX_ENABLED) {
34 ath9k_hw_btcoex_disable(sc->sc_ah);
35 if (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_3WIRE)
36 @@ -2167,6 +2170,9 @@ static void ath9k_stop(struct ieee80211_
37 /* disable HAL and put h/w to sleep */
38 ath9k_hw_disable(sc->sc_ah);
39 ath9k_hw_configpcipowersave(sc->sc_ah, 1, 1);
40 + ath9k_ps_restore(sc);
41 +
42 + /* Finally, put the chip in FULL SLEEP mode */
43 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
44
45 sc->sc_flags |= SC_OP_INVALID;