Commit bc1b32d6 authored by Elias Oltmanns's avatar Elias Oltmanns Committed by John W. Linville

ath5k: Reset key cache on interface up, thus fixing resume

After a s2ram / resume cycle, resetting the key cache does not work
unless it is deferred until after the hardware has been reinitialised by
a call to ath5k_hw_reset(). This fixes a regression introduced by
"ath5k: fix suspend-related oops on rmmod".
Signed-off-by: default avatarElias Oltmanns <eo@nebensachen.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 51b94bf0
...@@ -661,8 +661,7 @@ ath5k_pci_resume(struct pci_dev *pdev) ...@@ -661,8 +661,7 @@ ath5k_pci_resume(struct pci_dev *pdev)
{ {
struct ieee80211_hw *hw = pci_get_drvdata(pdev); struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath5k_softc *sc = hw->priv; struct ath5k_softc *sc = hw->priv;
struct ath5k_hw *ah = sc->ah; int err;
int i, err;
pci_restore_state(pdev); pci_restore_state(pdev);
...@@ -688,16 +687,6 @@ ath5k_pci_resume(struct pci_dev *pdev) ...@@ -688,16 +687,6 @@ ath5k_pci_resume(struct pci_dev *pdev)
goto err_irq; goto err_irq;
ath5k_led_enable(sc); ath5k_led_enable(sc);
/*
* Reset the key cache since some parts do not
* reset the contents on initial power up or resume.
*
* FIXME: This may need to be revisited when mac80211 becomes
* aware of suspend/resume.
*/
for (i = 0; i < AR5K_KEYTABLE_SIZE; i++)
ath5k_hw_reset_key(ah, i);
return 0; return 0;
err_irq: err_irq:
free_irq(pdev->irq, sc); free_irq(pdev->irq, sc);
...@@ -718,7 +707,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) ...@@ -718,7 +707,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
struct ath5k_softc *sc = hw->priv; struct ath5k_softc *sc = hw->priv;
struct ath5k_hw *ah = sc->ah; struct ath5k_hw *ah = sc->ah;
u8 mac[ETH_ALEN]; u8 mac[ETH_ALEN];
unsigned int i;
int ret; int ret;
ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device);
...@@ -736,13 +724,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) ...@@ -736,13 +724,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
if (ret > 0) if (ret > 0)
__set_bit(ATH_STAT_MRRETRY, sc->status); __set_bit(ATH_STAT_MRRETRY, sc->status);
/*
* Reset the key cache since some parts do not
* reset the contents on initial power up.
*/
for (i = 0; i < AR5K_KEYTABLE_SIZE; i++)
ath5k_hw_reset_key(ah, i);
/* /*
* Collect the channel list. The 802.11 layer * Collect the channel list. The 802.11 layer
* is resposible for filtering this list based * is resposible for filtering this list based
...@@ -2202,7 +2183,8 @@ ath5k_beacon_config(struct ath5k_softc *sc) ...@@ -2202,7 +2183,8 @@ ath5k_beacon_config(struct ath5k_softc *sc)
static int static int
ath5k_init(struct ath5k_softc *sc, bool is_resume) ath5k_init(struct ath5k_softc *sc, bool is_resume)
{ {
int ret; struct ath5k_hw *ah = sc->ah;
int ret, i;
mutex_lock(&sc->lock); mutex_lock(&sc->lock);
...@@ -2235,10 +2217,17 @@ ath5k_init(struct ath5k_softc *sc, bool is_resume) ...@@ -2235,10 +2217,17 @@ ath5k_init(struct ath5k_softc *sc, bool is_resume)
if (ret) if (ret)
goto done; goto done;
/*
* Reset the key cache since some parts do not reset the
* contents on initial power up or resume from suspend.
*/
for (i = 0; i < AR5K_KEYTABLE_SIZE; i++)
ath5k_hw_reset_key(ah, i);
__set_bit(ATH_STAT_STARTED, sc->status); __set_bit(ATH_STAT_STARTED, sc->status);
/* Set ack to be sent at low bit-rates */ /* Set ack to be sent at low bit-rates */
ath5k_hw_set_ack_bitrate_high(sc->ah, false); ath5k_hw_set_ack_bitrate_high(ah, false);
mod_timer(&sc->calib_tim, round_jiffies(jiffies + mod_timer(&sc->calib_tim, round_jiffies(jiffies +
msecs_to_jiffies(ath5k_calinterval * 1000))); msecs_to_jiffies(ath5k_calinterval * 1000)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment