ath9k: fix missing ath9k_ps_wakeup/ath9k_ps_restore calls

These missing chip wakeups mainly cause crashes on AR5416 cards in MIPS
boards, but have also been reported to cause radio stability issues on
AR9285.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by Felix Fietkau and committed by John W. Linville 96f372c9 bd39a274

+10 -2
+10 -2
drivers/net/wireless/ath/ath9k/main.c
··· 1376 1376 1377 1377 ath9k_calculate_iter_data(hw, vif, &iter_data); 1378 1378 1379 - ath9k_ps_wakeup(sc); 1380 1379 /* Set BSSID mask. */ 1381 1380 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); 1382 1381 ath_hw_setbssidmask(common); ··· 1410 1411 } 1411 1412 1412 1413 ath9k_hw_set_interrupts(ah, ah->imask); 1413 - ath9k_ps_restore(sc); 1414 1414 1415 1415 /* Set up ANI */ 1416 1416 if ((iter_data.naps + iter_data.nadhocs) > 0) { ··· 1455 1457 struct ath_vif *avp = (void *)vif->drv_priv; 1456 1458 int ret = 0; 1457 1459 1460 + ath9k_ps_wakeup(sc); 1458 1461 mutex_lock(&sc->mutex); 1459 1462 1460 1463 switch (vif->type) { ··· 1502 1503 ath9k_do_vif_add_setup(hw, vif); 1503 1504 out: 1504 1505 mutex_unlock(&sc->mutex); 1506 + ath9k_ps_restore(sc); 1505 1507 return ret; 1506 1508 } 1507 1509 ··· 1517 1517 1518 1518 ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); 1519 1519 mutex_lock(&sc->mutex); 1520 + ath9k_ps_wakeup(sc); 1520 1521 1521 1522 /* See if new interface type is valid. */ 1522 1523 if ((new_type == NL80211_IFTYPE_ADHOC) && ··· 1547 1546 1548 1547 ath9k_do_vif_add_setup(hw, vif); 1549 1548 out: 1549 + ath9k_ps_restore(sc); 1550 1550 mutex_unlock(&sc->mutex); 1551 1551 return ret; 1552 1552 } ··· 1560 1558 1561 1559 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1562 1560 1561 + ath9k_ps_wakeup(sc); 1563 1562 mutex_lock(&sc->mutex); 1564 1563 1565 1564 sc->nvifs--; ··· 1572 1569 ath9k_calculate_summary_state(hw, NULL); 1573 1570 1574 1571 mutex_unlock(&sc->mutex); 1572 + ath9k_ps_restore(sc); 1575 1573 } 1576 1574 1577 1575 static void ath9k_enable_ps(struct ath_softc *sc) ··· 1813 1809 1814 1810 txq = sc->tx.txq_map[queue]; 1815 1811 1812 + ath9k_ps_wakeup(sc); 1816 1813 mutex_lock(&sc->mutex); 1817 1814 1818 1815 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); ··· 1837 1832 ath_beaconq_config(sc); 1838 1833 1839 1834 mutex_unlock(&sc->mutex); 1835 + ath9k_ps_restore(sc); 1840 1836 1841 1837 return ret; 1842 1838 } ··· 1900 1894 int slottime; 1901 1895 int error; 1902 1896 1897 + ath9k_ps_wakeup(sc); 1903 1898 mutex_lock(&sc->mutex); 1904 1899 1905 1900 if (changed & BSS_CHANGED_BSSID) { ··· 2001 1994 } 2002 1995 2003 1996 mutex_unlock(&sc->mutex); 1997 + ath9k_ps_restore(sc); 2004 1998 } 2005 1999 2006 2000 static u64 ath9k_get_tsf(struct ieee80211_hw *hw)