From patchwork Thu Sep 27 14:41:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 1514641 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8E42340D8F for ; Thu, 27 Sep 2012 14:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754012Ab2I0OlN (ORCPT ); Thu, 27 Sep 2012 10:41:13 -0400 Received: from narfation.org ([79.140.41.39]:34645 "EHLO v3-1039.vlinux.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006Ab2I0OlK (ORCPT ); Thu, 27 Sep 2012 10:41:10 -0400 Received: from sven-desktop.home.narfation.org (drsd-4dbdb108.pool.mediaWays.net [77.189.177.8]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 9744A94092; Thu, 27 Sep 2012 16:41:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=20121; t=1348756868; bh=CLBit0YNRP6yf9jROGU434p3mx5B72oatd51YVQPnWM=; h=From:To:Cc:Subject:Date:From; b=2YsuCnYjFoCbzyf5smRwYTgBRJmyqx0S5Wiwfg9JL7x9G5gIp6aeY7nAOTqBcZ45r kgBV5K40pgHPbdnybYYeJtzUwBPGA6bTArJaquPyaiVUiVjBDbDBnmsaTk6hjviM6z IvDkVw81pR9iWxf8X9Ws110oovJe1ps5sjavtXVs= From: Sven Eckelmann To: linux-wireless@vger.kernel.org Cc: ath9k-devel@lists.ath9k.org, linville@tuxdriver.com, mcgrof@qca.qualcomm.com, Sven Eckelmann , Simon Wunderlich Subject: [PATCH] ath9k_hw: Handle AR_INTR_SYNC_HOST1_(FATAL|PERR) on AR9003 Date: Thu, 27 Sep 2012 16:41:02 +0200 Message-Id: <1348756862-8788-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 Signed-off-by: Simon Wunderlich --- 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);