From patchwork Wed Dec 11 08:33:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 3323041 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7D06EC0D4A for ; Wed, 11 Dec 2013 08:35:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBEFF20714 for ; Wed, 11 Dec 2013 08:35:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B392B20690 for ; Wed, 11 Dec 2013 08:35:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751300Ab3LKIfY (ORCPT ); Wed, 11 Dec 2013 03:35:24 -0500 Received: from mga09.intel.com ([134.134.136.24]:20040 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751438Ab3LKIfI (ORCPT ); Wed, 11 Dec 2013 03:35:08 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Dec 2013 00:31:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,870,1378882800"; d="scan'208";a="450387991" Received: from egrumbaclab.jer.intel.com ([10.12.217.160]) by orsmga002.jf.intel.com with ESMTP; 11 Dec 2013 00:35:07 -0800 From: Emmanuel Grumbach To: linux-rt-users@vger.kernel.org Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [RFC 08/10] iwlwifi: pcie: no need to save inta in trans_pcie Date: Wed, 11 Dec 2013 10:33:44 +0200 Message-Id: <1386750826-25219-10-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386750826-25219-1-git-send-email-emmanuel.grumbach@intel.com> References: <1386750826-25219-1-git-send-email-emmanuel.grumbach@intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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. */