All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: Reset keycache on resume
@ 2010-12-22  6:50 Mohammed Shafi Shajakhan
  2011-01-01  9:33 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Mohammed Shafi Shajakhan @ 2010-12-22  6:50 UTC (permalink / raw)
  To: linville
  Cc: Jouni.Malinen, linux-wireless, lrodriguez, Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

It looks like some hardware registers are left into undefined state
after suspend/resume. At minimum, this can cause odd issues related to
key cache and hardware trying to encrypt/decrypt frames unexpectedly.
This seems to happen even when there is no keys configured, i.e., hardware
can end up touching TX frames just based of invalid key cache context
even if the driver is not asking a specific entry to be used. In
addition, RX can likely be affected. This patch fixes this issue.

Signed-off-by: Jouni Malinen <Jouni.Malinen@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ath9k.h |    1 +
 drivers/net/wireless/ath/ath9k/init.c  |    2 +-
 drivers/net/wireless/ath/ath9k/pci.c   |    8 ++++++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 2c31f51..12e60bb 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -669,6 +669,7 @@ extern int led_blink;
 extern int ath9k_pm_qos_value;
 
 irqreturn_t ath_isr(int irq, void *dev);
+void ath9k_init_crypto(struct ath_softc *sc);
 int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
 		    const struct ath_bus_ops *bus_ops);
 void ath9k_deinit_device(struct ath_softc *sc);
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index b0e5e71..91cb422 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -372,7 +372,7 @@ fail:
 #undef DS2PHYS
 }
 
-static void ath9k_init_crypto(struct ath_softc *sc)
+void ath9k_init_crypto(struct ath_softc *sc)
 {
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	int i = 0;
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 7ca8499..af34d05 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -309,6 +309,14 @@ static int ath_pci_resume(struct device *device)
 			    AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
 	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
 
+	  /*
+	   * Reset key cache to sane defaults (all entries cleared) instead of
+	   * semi-random values after suspend/resume.
+	   */
+	ath9k_ps_wakeup(sc);
+	ath9k_init_crypto(sc);
+	ath9k_ps_restore(sc);
+
 	sc->ps_idle = true;
 	ath_radio_disable(sc, hw);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath9k: Reset keycache on resume
  2010-12-22  6:50 [PATCH] ath9k: Reset keycache on resume Mohammed Shafi Shajakhan
@ 2011-01-01  9:33 ` Kalle Valo
  2011-01-03  4:56   ` Mohammed Shafi
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2011-01-01  9:33 UTC (permalink / raw)
  To: Mohammed Shafi Shajakhan
  Cc: linville, Jouni.Malinen, linux-wireless, lrodriguez

Hi,

a minor nitpick:

Mohammed Shafi Shajakhan <mshajakhan@atheros.com> writes:

> From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

This means that Mohammed is the author of the patch.

[...]

> Signed-off-by: Jouni Malinen <Jouni.Malinen@Atheros.com>
> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

But here the author's sob line should be first one, the order is from
top to bottom. If Mohammed is the author, the sob lines should be
reversed. But if Jouni actually is the author, the From line should be
fixed.

Of course this is just a style issue and doesn't matter that much, but
it's still nice to get it right.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath9k: Reset keycache on resume
  2011-01-01  9:33 ` Kalle Valo
@ 2011-01-03  4:56   ` Mohammed Shafi
  0 siblings, 0 replies; 3+ messages in thread
From: Mohammed Shafi @ 2011-01-03  4:56 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Jouni Malinen, linux-wireless, Luis Rodriguez, linville

On Saturday 01 January 2011 03:03 PM, Kalle Valo wrote:
> Hi,
>
> a minor nitpick:
>    
Thanks for pointing it out.
> Mohammed Shafi Shajakhan<mshajakhan@atheros.com>  writes:
>
>    
>> From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>      
> This means that Mohammed is the author of the patch.
>
> [...]
>    
Jouni is the author.
>    
>> Signed-off-by: Jouni Malinen<Jouni.Malinen@Atheros.com>
>> Signed-off-by: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>      
> But here the author's sob line should be first one, the order is from
> top to bottom. If Mohammed is the author, the sob lines should be
> reversed. But if Jouni actually is the author, the From line should be
> fixed.
>
> Of course this is just a style issue and doesn't matter that much, but
> it's still nice to get it right.
>
>    

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-03  4:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-22  6:50 [PATCH] ath9k: Reset keycache on resume Mohammed Shafi Shajakhan
2011-01-01  9:33 ` Kalle Valo
2011-01-03  4:56   ` Mohammed Shafi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.