From amura@tomato.sakura.ne.jp  Mon Jun  7 07:25:06 2010
Return-Path: <amura@tomato.sakura.ne.jp>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D04B0106567C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  7 Jun 2010 07:25:06 +0000 (UTC)
	(envelope-from amura@tomato.sakura.ne.jp)
Received: from tomato.sakura.ne.jp (tomato.sakura.ne.jp [210.188.226.72])
	by mx1.freebsd.org (Postfix) with ESMTP id 80F238FC1D
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  7 Jun 2010 07:25:06 +0000 (UTC)
Received: from looxu.amura.dyndns.org (118x236x200x29.ap118.gyao.ne.jp [118.236.200.29])
	(authenticated bits=0)
	by tomato.sakura.ne.jp (8.14.2/8.14.2/[SAKURA-WEB]/20080708) with ESMTP id o577P42e078637
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 7 Jun 2010 16:25:05 +0900 (JST)
	(envelope-from amura@tomato.sakura.ne.jp)
Received: by looxu.amura.dyndns.org (Postfix, from userid 1001)
	id 8932A46; Mon,  7 Jun 2010 16:25:03 +0900 (JST)
Message-Id: <20100607072503.8932A46@looxu.amura.dyndns.org>
Date: Mon,  7 Jun 2010 16:25:03 +0900 (JST)
From: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
Reply-To: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] [ath] Atheros R9280 has probrem at 8.1-PRERELEASE
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         147638
>Category:       kern
>Synopsis:       [PATCH] [ath] Atheros R9280 has probrem at 8.1-PRERELEASE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    adrian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 07 07:30:04 UTC 2010
>Closed-Date:    Fri Dec 10 14:49:32 UTC 2010
>Last-Modified:  Fri Dec 10 14:49:32 UTC 2010
>Originator:     MURAMATSU Atsushi
>Release:        FreeBSD 8.1-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD looxu.amura.dyndns.org 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #1 r208809M: Sun Jun 6 00:38:12 JST 2010 root@looxu.amura.dyndns.org:/usr/obj/usr/src/sys/LOOXU i386

>Description:

I have notebook which has Atheros 9280 for Wi-fi.  It worked correctly
with 8-stable before 2nd March, but It doesn't work well with 8-stable at
6th June.

>How-To-Repeat:
	
>Fix:

I found this probrem is caused by changing sys/dev/ath/ath_hal/ar5416reg.h 
at r204580. In this change, AR_SERV_MERLIN_20 macro is changed to return false
with Merlin 2.1 chip.  I seemed my notebook has Merlin 2.1 chip from kernel
messages, so I got problem.

I wrote patch for this bug, and attach it this send-pr.

I think PR146517 is a same probrem, this patch can fix it.
	


--- ath.patch begins here ---
Index: ath_hal/ar5416/ar9280_attach.c
===================================================================
--- ath_hal/ar5416/ar9280_attach.c	(revision 208809)
+++ ath_hal/ar5416/ar9280_attach.c	(working copy)
@@ -346,7 +346,7 @@
 	regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common,
 	    1, regWrites);
 
-	if (AR_SREV_MERLIN_20(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) {
+	if (AR_SREV_MERLIN_2x(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) {
 		/* 5GHz channels w/ Fast Clock use different modal values */
 		regWrites = ath_hal_ini_write(ah, &AH9280(ah)->ah_ini_xmodes,
 		    modesIndex, regWrites);
Index: ath_hal/ar5416/ar5416reg.h
===================================================================
--- ath_hal/ar5416/ar5416reg.h	(revision 208809)
+++ ath_hal/ar5416/ar5416reg.h	(working copy)
@@ -601,8 +601,11 @@
 #define	AR_SREV_MERLIN_20(_ah) \
 	(AR_SREV_MERLIN(_ah) && \
 	 AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_MERLIN_20)
+#define	AR_SREV_MERLIN_2x(_ah) \
+	(AR_SREV_MERLIN(_ah) && \
+	 AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_MERLIN_20)
 #define	AR_SREV_MERLIN_20_OR_LATER(_ah) \
-	(AR_SREV_MERLIN_20(_ah) || \
+	(AR_SREV_MERLIN_2x(_ah) || \
 	 AH_PRIVATE((_ah))->ah_macVersion > AR_XSREV_VERSION_MERLIN)
 
 #define	AR_SREV_KITE(_ah) \
Index: ath_hal/ar5416/ar5416_reset.c
===================================================================
--- ath_hal/ar5416/ar5416_reset.c	(revision 208809)
+++ ath_hal/ar5416/ar5416_reset.c	(working copy)
@@ -627,7 +627,7 @@
 		/* treat channel B as channel G , no  B mode suport in owl */
 		rfMode = IEEE80211_IS_CHAN_CCK(chan) ?
 		    AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM;
-		if (AR_SREV_MERLIN_20(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) {
+		if (AR_SREV_MERLIN_2x(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) {
 			/* phy mode bits for 5GHz channels require Fast Clock */
 			rfMode |= AR_PHY_MODE_DYNAMIC
 			       |  AR_PHY_MODE_DYN_CCK_DISABLE;
@@ -1114,7 +1114,7 @@
 {
 	uint32_t pll;
 
-	if (AR_SREV_MERLIN_20(ah) &&
+	if (AR_SREV_MERLIN_2x(ah) &&
 	    chan != AH_NULL && IEEE80211_IS_CHAN_5GHZ(chan)) {
 		/*
 		 * PLL WAR for Merlin 2.0/2.1
--- ath.patch ends here ---

--- dmesg begins here ---
Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.1-PRERELEASE #1 r208809M: Sun Jun  6 00:38:12 JST 2010
    root@looxu.amura.dyndns.org:/usr/obj/usr/src/sys/LOOXU i386
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Atom(TM) CPU Z530   @ 1.60GHz (1596.01-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x106c2  Family = 6  Model = 1c  Stepping = 2
  Features=0xbfe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x40c3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,xTPR,PDCM,MOVBE>
  AMD Features=0x100000<NX>
  AMD Features2=0x1<LAHF>
  TSC: P-state invariant
real memory  = 1073741824 (1024 MB)
avail memory = 1025736704 (978 MB)
  -- snip --
ath0: <Atheros 9280> mem 0xfd500000-0xfd50ffff irq 17 at device 0.0 on pci8
ath0: [ITHREAD]
ath0: AR9280 mac 128.2 RF5133 phy 13.0
  -- snip --
--- dmesg ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jun 7 18:04:40 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147638 

From: Vincent Hoffman <vince@unsane.co.uk>
To: bug-followup@FreeBSD.org, amura@tomato.sakura.ne.jp
Cc:  
Subject: Re: kern/147638: [PATCH] [ath] Atheros R9280 has probrem at 8.1-PRERELEASE
Date: Wed, 09 Jun 2010 14:00:50 +0100

 This is a multi-part message in MIME format.
 --------------000706050409030501050805
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 I've tested this patch on my problematic ath (AR5B91) wireless card and
 no longer see the timeouts I was getting.
 I've also added this to my pr related to this (kern/146517)
 Thanks for the patch.
 
 --
 regards,
 Vince
 
 --------------000706050409030501050805--
Responsible-Changed-From-To: freebsd-net->rpaulo 
Responsible-Changed-By: rpaulo 
Responsible-Changed-When: Wed Jun 9 13:22:23 UTC 2010 
Responsible-Changed-Why:  
Actually, I think the AR_SREV_MERLIN_20() check should just go away. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147638 
Responsible-Changed-From-To: rpaulo->adrian 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Dec 4 16:15:34 UTC 2010 
Responsible-Changed-Why:  
rpaulo has had his commit bit returned for safekeeping, so pass this along 
to adrian for a look. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147638 

From: Gavin Atkinson <gavin@FreeBSD.org>
To: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/147638: [PATCH] [ath] Atheros R9280 has probrem at
 8.1-PRERELEASE
Date: Sun, 5 Dec 2010 18:14:09 +0000 (GMT)

 Hi,
 
 It looks like this may have been fixed by SVN revisons r209541 and 
 r209548, which were committed before 8.1 was released.  Can you confirm 
 whether or not you still see this issue?
 
 Thanks,
 
 Gavin
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Fri Dec 10 14:48:52 UTC 2010 
State-Changed-Why:  
Submitter reports that he no longer sees the issues. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147638 
>Unformatted:
