All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-rt-users@vger.kernel.org
Cc: linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [RFC 08/10] iwlwifi: pcie: no need to save inta in trans_pcie
Date: Wed, 11 Dec 2013 10:33:44 +0200	[thread overview]
Message-ID: <1386750826-25219-10-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1386750826-25219-1-git-send-email-emmanuel.grumbach@intel.com>

This was useful when the handling was not in the same
context as the interrupt cause retrieval: we could have
several hard interrupts until the handler gets called.
Since we retrieve the interrupt cause in the handler itself,
there is no need to OR the interrupt causes.

Change-Id: I043ea25c4ba1add17d20d26da23148437114981c
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/pcie/internal.h |  1 -
 drivers/net/wireless/iwlwifi/pcie/rx.c       | 21 +++++++--------------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index c790df6..f959308 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -273,7 +273,6 @@ struct iwl_trans_pcie {
 	__le32 *ict_tbl;
 	dma_addr_t ict_tbl_dma;
 	int ict_index;
-	u32 inta;
 	bool use_ict;
 	struct isr_statistics isr_stats;
 
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index 3ddf012..3f247da 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -838,17 +838,16 @@ static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans)
 		 * the handler can be scheduled because of a previous
 		 * interrupt.
 		 */
-		if (test_bit(STATUS_INT_ENABLED, &trans->status) &&
-		    !trans_pcie->inta)
+		if (test_bit(STATUS_INT_ENABLED, &trans->status) && !inta)
 			iwl_enable_interrupts(trans);
-		return trans_pcie->inta;
+		return inta;
 	}
 
 	if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
 		/* Hardware disappeared. It might have already raised
 		 * an interrupt */
 		IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta);
-		return trans_pcie->inta;
+		return inta;
 	}
 
 	if (iwl_have_debug_level(IWL_DL_ISR))
@@ -857,9 +856,8 @@ static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans)
 			      inta, trans_pcie->inta_mask,
 			      iwl_read32(trans, CSR_FH_INT_STATUS));
 
-	trans_pcie->inta |= inta;
 	/* the thread will service interrupts and re-enable them */
-	return trans_pcie->inta;
+	return inta;
 }
 
 /* a device (PCI-E) page is 4096 bytes long */
@@ -933,21 +931,19 @@ static u32 iwl_pcie_int_cause_ict(struct iwl_trans *trans)
 			      iwl_read32(trans, CSR_INT_MASK));
 
 	inta &= trans_pcie->inta_mask;
-	trans_pcie->inta |= inta;
 
 	/* iwl_pcie_tasklet() will service interrupts and re-enable them */
 	if (likely(inta))
-		return trans_pcie->inta;
+		return inta;
 
  none:
 	/* re-enable interrupts here since we don't have anything to service.
 	 * only Re-enable if disabled by irq.
 	 */
-	if (test_bit(STATUS_INT_ENABLED, &trans->status) &&
-	    !trans_pcie->inta)
+	if (test_bit(STATUS_INT_ENABLED, &trans->status) && !inta)
 		iwl_enable_interrupts(trans);
 
-	return trans_pcie->inta;
+	return inta;
 }
 
 irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
@@ -994,9 +990,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
 		IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n",
 			      inta, iwl_read32(trans, CSR_INT_MASK));
 
-	/* saved interrupt in inta variable now we can reset trans_pcie->inta */
-	trans_pcie->inta = 0;
-
 	spin_unlock_irqrestore(&trans_pcie->irq_lock, flags);
 
 	/* Now service all interrupt bits discovered above. */
-- 
1.8.3.2


WARNING: multiple messages have this Message-ID (diff)
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-rt-users@vger.kernel.org
Cc: linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [RFC 08/10] iwlwifi: pcie: no need to save inta in trans_pcie
Date: Wed, 11 Dec 2013 10:33:44 +0200	[thread overview]
Message-ID: <1386750826-25219-10-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1386750826-25219-1-git-send-email-emmanuel.grumbach@intel.com>

This was useful when the handling was not in the same
context as the interrupt cause retrieval: we could have
several hard interrupts until the handler gets called.
Since we retrieve the interrupt cause in the handler itself,
there is no need to OR the interrupt causes.

Change-Id: I043ea25c4ba1add17d20d26da23148437114981c
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/pcie/internal.h |  1 -
 drivers/net/wireless/iwlwifi/pcie/rx.c       | 21 +++++++--------------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index c790df6..f959308 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -273,7 +273,6 @@ struct iwl_trans_pcie {
 	__le32 *ict_tbl;
 	dma_addr_t ict_tbl_dma;
 	int ict_index;
-	u32 inta;
 	bool use_ict;
 	struct isr_statistics isr_stats;
 
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index 3ddf012..3f247da 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -838,17 +838,16 @@ static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans)
 		 * the handler can be scheduled because of a previous
 		 * interrupt.
 		 */
-		if (test_bit(STATUS_INT_ENABLED, &trans->status) &&
-		    !trans_pcie->inta)
+		if (test_bit(STATUS_INT_ENABLED, &trans->status) && !inta)
 			iwl_enable_interrupts(trans);
-		return trans_pcie->inta;
+		return inta;
 	}
 
 	if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
 		/* Hardware disappeared. It might have already raised
 		 * an interrupt */
 		IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta);
-		return trans_pcie->inta;
+		return inta;
 	}
 
 	if (iwl_have_debug_level(IWL_DL_ISR))
@@ -857,9 +856,8 @@ static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans)
 			      inta, trans_pcie->inta_mask,
 			      iwl_read32(trans, CSR_FH_INT_STATUS));
 
-	trans_pcie->inta |= inta;
 	/* the thread will service interrupts and re-enable them */
-	return trans_pcie->inta;
+	return inta;
 }
 
 /* a device (PCI-E) page is 4096 bytes long */
@@ -933,21 +931,19 @@ static u32 iwl_pcie_int_cause_ict(struct iwl_trans *trans)
 			      iwl_read32(trans, CSR_INT_MASK));
 
 	inta &= trans_pcie->inta_mask;
-	trans_pcie->inta |= inta;
 
 	/* iwl_pcie_tasklet() will service interrupts and re-enable them */
 	if (likely(inta))
-		return trans_pcie->inta;
+		return inta;
 
  none:
 	/* re-enable interrupts here since we don't have anything to service.
 	 * only Re-enable if disabled by irq.
 	 */
-	if (test_bit(STATUS_INT_ENABLED, &trans->status) &&
-	    !trans_pcie->inta)
+	if (test_bit(STATUS_INT_ENABLED, &trans->status) && !inta)
 		iwl_enable_interrupts(trans);
 
-	return trans_pcie->inta;
+	return inta;
 }
 
 irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
@@ -994,9 +990,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
 		IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n",
 			      inta, iwl_read32(trans, CSR_INT_MASK));
 
-	/* saved interrupt in inta variable now we can reset trans_pcie->inta */
-	trans_pcie->inta = 0;

  parent reply	other threads:[~2013-12-11  8:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11  8:33 [RFC 00/10] make iwlwifi RT friendly Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 01/10] iwlwifi: pcie: clean up ICT allocation code Emmanuel Grumbach
2013-12-11  8:33   ` Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 02/10] iwlwifi: pcie: track interrupt mask in SW Emmanuel Grumbach
2013-12-11  8:33   ` Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 03/10] iwlwifi: pcie: re-organize the PCIe ISR code Emmanuel Grumbach
2013-12-11  9:49   ` Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 04/10] iwlwifi: pcie: move the ICT / non-ICT handling functions Emmanuel Grumbach
2013-12-11  8:33   ` Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 05/10] iwlwifi: pcie: read the interrupt cause from the handler Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 06/10] iwlwifi: pcie: determine the interrupt type in " Emmanuel Grumbach
2013-12-11  8:33   ` Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 07/10] iwlwifi: pcie: return inta from iwl_pcie_int_cause_{non_}ict Emmanuel Grumbach
2013-12-11  8:33   ` Emmanuel Grumbach
2013-12-11  8:33 ` Emmanuel Grumbach
2013-12-11  8:33   ` Emmanuel Grumbach
2013-12-11  8:33 ` Emmanuel Grumbach [this message]
2013-12-11  8:33   ` [RFC 08/10] iwlwifi: pcie: no need to save inta in trans_pcie Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 09/10] iwlwifi: pcie: move interrupt prints to the common handler Emmanuel Grumbach
2013-12-11  8:33 ` [RFC 10/10] iwlwifi: pcie: stop using _irqsave Emmanuel Grumbach
2013-12-11 11:17 ` [RFC 00/10] make iwlwifi RT friendly Emmanuel Grumbach
2013-12-15 15:48 ` Sebastian Andrzej Siewior
2013-12-15 17:45   ` Emmanuel Grumbach
2013-12-15 17:46     ` Sebastian Andrzej Siewior
2013-12-15 17:50       ` Emmanuel Grumbach
2013-12-17  9:21         ` Henrik Austad
2013-12-17  9:32           ` Grumbach, Emmanuel
2013-12-17  9:43             ` Henrik Austad

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=1386750826-25219-10-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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 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.