linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Cahill@vger.kernel.org,
	Ben M <ben.m.cahill@intel.com>, Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 28/28] iwlwifi: Streamline irq_tasklet() when ISR debug not used
Date: Wed,  8 Aug 2007 15:33:45 +0800	[thread overview]
Message-ID: <11865584913031-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <11865584891294-git-send-email-yi.zhu@intel.com>

From: Cahill, Ben M <ben.m.cahill@intel.com>

This patch streamlines irq_tasklet() when ISR debug is not used.
It also reports MAC_CLK_ACTV interrupt bit and enhance comments.

Signed-off-by: Cahill, Ben M <ben.m.cahill@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwl-base.c |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c
index 881945d..15965fc 100644
--- a/drivers/net/wireless/iwl-base.c
+++ b/drivers/net/wireless/iwl-base.c
@@ -5125,10 +5125,13 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
 	inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
 	iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
 
-	inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */
-	IWL_DEBUG_ISR
-	    ("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
-	     inta, inta_mask, inta_fh);
+#ifdef CONFIG_IWLWIFI_DEBUG
+	if (iwl_debug_level & IWL_DL_ISR) {
+		inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */
+		IWL_DEBUG_ISR("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
+			      inta, inta_mask, inta_fh);
+	}
+#endif
 
 	/* Since CSR_INT and CSR_FH_INT_STATUS reads and clears are not
 	 * atomic, make sure that inta covers all the interrupts that
@@ -5155,6 +5158,21 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
 		return;
 	}
 
+#ifdef CONFIG_IWLWIFI_DEBUG
+	if (iwl_debug_level & (IWL_DL_ISR)) {
+		/* NIC fires this, but we don't use it, redundant with WAKEUP */
+		if (inta & BIT_INT_MAC_CLK_ACTV)
+			IWL_DEBUG_ISR("Microcode started or stopped.\n");
+
+		/* Alive notification via Rx interrupt will do the real work */
+		if (inta & BIT_INT_ALIVE)
+			IWL_DEBUG_ISR("Alive interrupt\n");
+	}
+#endif
+	/* Safely ignore these bits for debug checks below */
+	inta &= ~(BIT_INT_MAC_CLK_ACTV | BIT_INT_ALIVE);
+
+	/* HW RF KILL switch toggled (4965 only) */
 	if (inta & BIT_INT_RF_KILL) {
 		int hw_rf_kill = 0;
 		if (!(iwl_read32(priv, CSR_GP_CNTRL) &
@@ -5175,11 +5193,13 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
 		handled |= BIT_INT_RF_KILL;
 	}
 
+	/* Chip got too hot and stopped itself (4965 only) */
 	if (inta & BIT_INT_CT_KILL) {
 		IWL_ERROR("Microcode CT kill error detected.\n");
 		handled |= BIT_INT_CT_KILL;
 	}
 
+	/* Error detected by uCode */
 	if (inta & BIT_INT_SWERROR) {
 		IWL_ERROR("Microcode SW error detected.  Restarting 0x%X.\n",
 			  inta);
@@ -5187,6 +5207,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
 		handled |= BIT_INT_SWERROR;
 	}
 
+	/* uCode wakes up after power-down sleep */
 	if (inta & BIT_INT_WAKEUP) {
 		IWL_DEBUG_ISR("Wakeup interrupt\n");
 		iwl_rx_queue_update_write_ptr(priv, &priv->rxq);
@@ -5200,12 +5221,6 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
 		handled |= BIT_INT_WAKEUP;
 	}
 
-	/* Alive notification via Rx interrupt will do the real work */
-	if (inta & BIT_INT_ALIVE) {
-		IWL_DEBUG_ISR("Alive interrupt\n");
-		handled |= BIT_INT_ALIVE;
-	}
-
 	/* All uCode command responses, including Tx command responses,
 	 * Rx "responses" (frame-received notification), and other
 	 * notifications from uCode come through here*/
-- 
1.5.2

      reply	other threads:[~2007-08-08  7:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11865584251026-git-send-email-yi.zhu@intel.com>
2007-08-08  7:33 ` [PATCH 01/28] iwlwifi: fix a lot of checkpatch.pl warnings Zhu Yi
2007-08-08  7:33   ` [PATCH 02/28] iwlwifi: add more Kconfig options Zhu Yi
2007-08-08  7:33     ` [PATCH 03/28] iwlwifi: Endianity fix for 4965 rate scaling Zhu Yi
2007-08-08  7:33       ` [PATCH 04/28] iwlwifi: Endianity fix for 4965 rx chain selection Zhu Yi
2007-08-08  7:33         ` [PATCH 05/28] iwlwifi: optimize iwl_queue_{inc|dec}_wrap implementation Zhu Yi
2007-08-08  7:33           ` [PATCH 06/28] iwlwifi: use mask operation to replace '%' for index calculation Zhu Yi
2007-08-08  7:33             ` [PATCH 07/28] iwlwifi: make local functions static Zhu Yi
2007-08-08  7:33               ` [PATCH 08/28] iwlwifi: some coding styles cleanup Zhu Yi
2007-08-08  7:33                 ` [PATCH 09/28] iwlwifi: replace unnecessary GFP_ATOMIC with GFP_KERNEL Zhu Yi
2007-08-08  7:33                   ` [PATCH 10/28] iwlwifi: remove priv stuff zeroing in iwl_pci_probe Zhu Yi
2007-08-08  7:33                     ` [PATCH 11/28] iwlwifi: add name for some PCI configuration space registers Zhu Yi
2007-08-08  7:33                       ` [PATCH 12/28] iwlwifi: shorten some structure and function names Zhu Yi
2007-08-08  7:33                         ` [PATCH 13/28] iwlwifi: define iwl_rx_reply_scan only when CONFIG_IWLWIFI_DEBUG enabled Zhu Yi
2007-08-08  7:33                           ` [PATCH 14/28] iwlwifi: remove redundant quotes Zhu Yi
2007-08-08  7:33                             ` [PATCH 15/28] iwlwifi: Endianity fix for rxon host commands Zhu Yi
2007-08-08  7:33                               ` [PATCH 16/28] iwlwifi: Endianity fix for beacon host command Zhu Yi
2007-08-08  7:33                                 ` [PATCH 17/28] iwlwifi: Endianity fix for channel number Zhu Yi
2007-08-08  7:33                                   ` [PATCH 18/28] iwlwifi: shorten more function names Zhu Yi
2007-08-08  7:33                                     ` [PATCH 19/28] iwlwifi: make iwl_get_bits inline function from macro Zhu Yi
2007-08-08  7:33                                       ` [PATCH 20/28] iwlwifi: remove BIT_FMT and BIT_ARG Zhu Yi
2007-08-08  7:33                                         ` [PATCH 21/28] iwlwifi: remove WLAN_FC_GET_TYPE macros Zhu Yi
2007-08-08  7:33                                           ` [PATCH 22/28] iwlwifi: replace private snprint_line with common hex_dump_xxx Zhu Yi
2007-08-08  7:33                                             ` [PATCH 23/28] iwlwifi: Endianity fix for frame control Zhu Yi
2007-08-08  7:33                                               ` [PATCH 24/28] iwlwifi: Endianity fix for ct kill configuration Zhu Yi
2007-08-08  7:33                                                 ` [PATCH 25/28] iwlwifi: remove unused snprint_line Zhu Yi
2007-08-08  7:33                                                   ` [PATCH 26/28] iwlwifi: Enhance ISR/RX/CMD debug messages Zhu Yi
2007-08-08  7:33                                                     ` [PATCH 27/28] iwlwifi: Correct missing hardware detection in iwl_isr() Zhu Yi
2007-08-08  7:33                                                       ` Zhu Yi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11865584913031-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=Cahill@vger.kernel.org \
    --cc=ben.m.cahill@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).