From patchwork Mon Aug 31 12:18:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 44883 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7VCQtCu002432 for ; Mon, 31 Aug 2009 12:26:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751105AbZHaM0v (ORCPT ); Mon, 31 Aug 2009 08:26:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751152AbZHaM0v (ORCPT ); Mon, 31 Aug 2009 08:26:51 -0400 Received: from mail.atheros.com ([12.36.123.2]:44622 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbZHaM0u (ORCPT ); Mon, 31 Aug 2009 08:26:50 -0400 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Mon, 31 Aug 2009 05:26:53 -0700 Received: from localhost.localdomain (10.12.4.14) by SC1EXHC-02.global.atheros.com (10.10.20.106) with Microsoft SMTP Server id 8.0.813.0; Mon, 31 Aug 2009 05:26:52 -0700 From: Vasanthakumar Thiagarajan To: CC: , , , Subject: [PATCH] ath9k: Do an AHB reset before doing RTC reset Date: Mon, 31 Aug 2009 17:48:36 +0530 Message-ID: <1251721116-25758-1-git-send-email-vasanth@atheros.com> X-Mailer: git-send-email 1.5.5.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Doing an RTC reset when DMA is active may corrupt memory, make sure no DMA is active at this moment by doing an AHB reset. Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath9k/hw.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index e340dac..71f27f3 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -1712,8 +1712,15 @@ static bool ath9k_hw_set_reset_power_on(struct ath_hw *ah) REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT); + if (!AR_SREV_9100(ah)) + REG_WRITE(ah, AR_RC, AR_RC_AHB); + REG_WRITE(ah, AR_RTC_RESET, 0); udelay(2); + + if (!AR_SREV_9100(ah)) + REG_WRITE(ah, AR_RC, 0); + REG_WRITE(ah, AR_RTC_RESET, 1); if (!ath9k_hw_wait(ah,