linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Sven Eckelmann <sven@narfation.org>
Cc: Adrian Chadd <adrian@freebsd.org>,
	Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>,
	linux-wireless@vger.kernel.org, linville@tuxdriver.com,
	mcgrof@qca.qualcomm.com, ath9k-devel@lists.ath9k.org,
	lindner_marek@yahoo.de
Subject: Re: [ath9k-devel] [PATCHv2] ath9k_hw: Handle AR_INTR_SYNC_HOST1_FATAL on AR9003
Date: Fri, 05 Oct 2012 17:15:01 +0200	[thread overview]
Message-ID: <506EF975.7040909@openwrt.org> (raw)
In-Reply-To: <1661867.OB0LbMnEW9@bentobox>

On 2012-10-05 5:03 PM, Sven Eckelmann wrote:
> On Friday 05 October 2012 15:24:25 Felix Fietkau wrote:
>> On 2012-10-05 3:07 PM, Sven Eckelmann wrote:
>> > On Friday 05 October 2012 14:34:28 Felix Fietkau wrote:
>> >> On 2012-10-05 1:08 PM, Sven Eckelmann wrote:
>> > [...]
>> > 
>> >> Please try this patch to see if it gets rid of these interrupts:
>> >> ---
>> >> --- a/drivers/net/wireless/ath/ath9k/ani.c
>> >> +++ b/drivers/net/wireless/ath/ath9k/ani.c
>> >> @@ -307,7 +307,8 @@ void ath9k_ani_reset(struct ath_hw *ah,
>> >> 
>> >>  		if (IS_CHAN_2GHZ(chan)) {
>> >>  		
>> >>  			ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
>> >>  			
>> >>  					    ATH9K_ANI_FIRSTEP_LEVEL);
>> >> 
>> >> -			if (AR_SREV_9300_20_OR_LATER(ah))
>> >> +			if (AR_SREV_9300_20_OR_LATER(ah) &&
>> >> +			    ah->caps.rx_chainmask != 1)
>> >> 
>> >>  				ah->ani_function |= ATH9K_ANI_MRC_CCK;
>> >>  		
>> >>  		} else
>> >>  		
>> >>  			ah->ani_function = 0;
>> > 
>> > Looks partially good. At least this patch fixed parts my friday :D
>> > 
>> > I have more similar bugs, but at least this one is related to a bandwidth
>> > problem which I also wanted to check today. But it didn't fix _this_
>> > invalid register access on the client device (but I don't see it anymore
>> > on the AP device).
>> 
>> Are you sure that it's still the same register access on the client
>> side? I don't see how it could still access MRC related registers with
>> this part masked out.
> 
> Yes, I am sure. Let's read some code:
> 
> 	if (ah->opmode == NL80211_IFTYPE_AP) {
> 		if (IS_CHAN_2GHZ(chan)) {
> 			ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
> 					    ATH9K_ANI_FIRSTEP_LEVEL);
> 			if (AR_SREV_9300_20_OR_LATER(ah) &&
> 			    ah->caps.rx_chainmask != 1)
> 				ah->ani_function |= ATH9K_ANI_MRC_CCK;
> 		} else
> 			ah->ani_function = 0;
> 	}
> 
> Now raise your hands when you see the "ah->opmode == NL80211_IFTYPE_AP". I've 
> just added following after this block
> 
> 	if (!AR_SREV_9300_20_OR_LATER(ah) || ah->caps.rx_chainmask == 1)
> 		ah->ani_function &= ~ATH9K_ANI_MRC_CCK;
> 
> But maybe it is better to fix the test in __ath9k_hw_init
> 
> 	if (!AR_SREV_9300_20_OR_LATER(ah) || ah->caps.rx_chainmask == 1)
> 		ah->ani_function &= ~ATH9K_ANI_MRC_CCK;
> 
> The problem in __ath9k_hw_init is the value of ah->caps.rx_chainmask ... which 
> is not yet initialized correctly (and therefore ends up as 0).
> 
> I've attached my "please don't enable MRC CCK" version of the patch. Feel free 
> to submit it because you've submitted the initial version... or other things 
> with it ;)
Thanks for testing, but for submitting I'd prefer something simple,
how about this:
---
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -1035,6 +1035,10 @@ static bool ar9003_hw_ani_control(struct
 		 * is_on == 0 means MRC CCK is OFF (more noise imm)
 		 */
 		bool is_on = param ? 1 : 0;
+
+		if (ah->caps.rx_chainmask == 1)
+			break;
+
 		REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
 			      AR_PHY_MRC_CCK_ENABLE, is_on);
 		REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,


  reply	other threads:[~2012-10-05 15:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27 14:41 [PATCH] ath9k_hw: Handle AR_INTR_SYNC_HOST1_(FATAL|PERR) on AR9003 Sven Eckelmann
2012-10-02 10:33 ` [PATCHv2] ath9k_hw: Handle AR_INTR_SYNC_HOST1_FATAL " Sven Eckelmann
2012-10-02 13:13   ` Adrian Chadd
2012-10-02 13:33     ` [ath9k-devel] " Felix Fietkau
2012-10-02 13:35     ` Simon Wunderlich
2012-10-02 14:06       ` Adrian Chadd
2012-10-02 15:02         ` Sven Eckelmann
2012-10-02 15:20           ` [ath9k-devel] " Felix Fietkau
2012-10-03 14:51             ` Adrian Chadd
2012-10-05 11:08               ` Sven Eckelmann
2012-10-05 12:34                 ` Felix Fietkau
2012-10-05 13:07                   ` Sven Eckelmann
2012-10-05 13:24                     ` Felix Fietkau
2012-10-05 15:03                       ` Sven Eckelmann
2012-10-05 15:15                         ` Felix Fietkau [this message]
2012-10-05 16:05                           ` Sven Eckelmann
2012-10-05 16:21                   ` Adrian Chadd
2012-10-05 16:51                     ` Sven Eckelmann
2012-10-05 23:48                       ` Adrian Chadd
2012-10-06  9:03                         ` Felix Fietkau
2013-02-21 11:14                           ` Felix Liao

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=506EF975.7040909@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=adrian@freebsd.org \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=lindner_marek@yahoo.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@qca.qualcomm.com \
    --cc=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=sven@narfation.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 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).