Return-path: Received: from mail-ee0-f50.google.com ([74.125.83.50]:62130 "EHLO mail-ee0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752972Ab3J3LpO (ORCPT ); Wed, 30 Oct 2013 07:45:14 -0400 Received: by mail-ee0-f50.google.com with SMTP id l10so574752eei.9 for ; Wed, 30 Oct 2013 04:45:13 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, greearb@candelatech.com, Michal Kazior Subject: [PATCH/RFT 05/12] ath10k: make sure to mask all CE irqs Date: Wed, 30 Oct 2013 12:42:19 +0100 Message-Id: <1383133346-8135-6-git-send-email-michal.kazior@tieto.com> (sfid-20131030_124607_856865_1F038DA9) In-Reply-To: <1383133346-8135-1-git-send-email-michal.kazior@tieto.com> References: <1383133346-8135-1-git-send-email-michal.kazior@tieto.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: CE error interrupts were not disabled. This could lead to invalid memory accesses / memory corruption. Also make sure CE watermark interrupts are also disabled. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/ce.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 2b99bd4..7a49cde 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -243,6 +243,16 @@ static inline void ath10k_ce_error_intr_enable(struct ath10k *ar, misc_ie_addr | CE_ERROR_MASK); } +static inline void ath10k_ce_error_intr_disable(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + u32 misc_ie_addr = ath10k_pci_read32(ar, + ce_ctrl_addr + MISC_IE_ADDRESS); + + ath10k_pci_write32(ar, ce_ctrl_addr + MISC_IE_ADDRESS, + misc_ie_addr & ~CE_ERROR_MASK); +} + static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int mask) @@ -794,6 +804,8 @@ void ath10k_ce_disable_interrupts(struct ath10k *ar) u32 ctrl_addr = ath10k_ce_base_address(ce_id); ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr); + ath10k_ce_error_intr_disable(ar, ctrl_addr); + ath10k_ce_watermark_intr_disable(ar, ctrl_addr); } ath10k_pci_sleep(ar); } -- 1.8.4.rc3