linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k_hw: Handle AR_INTR_SYNC_HOST1_(FATAL|PERR) on AR9003
@ 2012-09-27 14:41 Sven Eckelmann
  2012-10-02 10:33 ` [PATCHv2] ath9k_hw: Handle AR_INTR_SYNC_HOST1_FATAL " Sven Eckelmann
  0 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2012-09-27 14:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: ath9k-devel, linville, mcgrof, Sven Eckelmann, Simon Wunderlich

Interrupts with the sync_cause AR_INTR_SYNC_HOST1_FATAL and
AR_INTR_SYNC_HOST1_PERR have to be handled using a chip reset. Otherwise a
interrupt storm with unhandled interrupts will cause a hang or crash of the
machine.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
I don't have any hardware documentation. So I need someone who checks the
flags whether this is really like AR9002 and not another thing which only
gets fixed by accident using this patch.

 drivers/net/wireless/ath/ath9k/ar9003_mac.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index d5b2e0e..301bf72 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -182,6 +182,7 @@ static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
 	struct ath9k_hw_capabilities *pCap = &ah->caps;
 	struct ath_common *common = ath9k_hw_common(ah);
 	u32 sync_cause = 0, async_cause, async_mask = AR_INTR_MAC_IRQ;
+	bool fatal_int;
 
 	if (ath9k_hw_mci_is_enabled(ah))
 		async_mask |= AR_INTR_ASYNC_MASK_MCI;
@@ -310,6 +311,22 @@ static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
 
 	if (sync_cause) {
 		ath9k_debug_sync_cause(common, sync_cause);
+		fatal_int =
+			(sync_cause &
+			 (AR_INTR_SYNC_HOST1_FATAL | AR_INTR_SYNC_HOST1_PERR))
+			? true : false;
+
+		if (fatal_int) {
+			if (sync_cause & AR_INTR_SYNC_HOST1_FATAL) {
+				ath_dbg(common, ANY,
+					"received PCI FATAL interrupt\n");
+			}
+			if (sync_cause & AR_INTR_SYNC_HOST1_PERR) {
+				ath_dbg(common, ANY,
+					"received PCI PERR interrupt\n");
+			}
+			*masked |= ATH9K_INT_FATAL;
+		}
 
 		if (sync_cause & AR_INTR_SYNC_RADM_CPL_TIMEOUT) {
 			REG_WRITE(ah, AR_RC, AR_RC_HOSTIF);
-- 
1.7.10.4


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

end of thread, other threads:[~2013-02-21 11:26 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-27 14:41 [PATCH] ath9k_hw: Handle AR_INTR_SYNC_HOST1_(FATAL|PERR) on AR9003 Sven Eckelmann
2012-10-02 10:33 ` [PATCHv2] ath9k_hw: Handle AR_INTR_SYNC_HOST1_FATAL " Sven Eckelmann
2012-10-02 13:13   ` Adrian Chadd
2012-10-02 13:33     ` [ath9k-devel] " Felix Fietkau
2012-10-02 13:35     ` Simon Wunderlich
2012-10-02 14:06       ` Adrian Chadd
2012-10-02 15:02         ` Sven Eckelmann
2012-10-02 15:20           ` [ath9k-devel] " Felix Fietkau
2012-10-03 14:51             ` Adrian Chadd
2012-10-05 11:08               ` Sven Eckelmann
2012-10-05 12:34                 ` Felix Fietkau
2012-10-05 13:07                   ` Sven Eckelmann
2012-10-05 13:24                     ` Felix Fietkau
2012-10-05 15:03                       ` Sven Eckelmann
2012-10-05 15:15                         ` Felix Fietkau
2012-10-05 16:05                           ` Sven Eckelmann
2012-10-05 16:21                   ` Adrian Chadd
2012-10-05 16:51                     ` Sven Eckelmann
2012-10-05 23:48                       ` Adrian Chadd
2012-10-06  9:03                         ` Felix Fietkau
2013-02-21 11:14                           ` Felix Liao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).