Bug 154220

Summary: [ath] AR9280 based Ubiquiti SR71-12/15 panics on interface up (on mips)
Product: Base System Reporter: Adrian Chadd <adrian>
Component: kernAssignee: Adrian Chadd <adrian>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Adrian Chadd freebsd_committer freebsd_triage 2011-01-22 16:10:10 UTC
The AR9220 is detected:

ath0: <Atheros 9280> irq 0 at device 17.0 on pci0
ath0: AR9280 mac 128.2 RF5133 phy 13.0

But the mips kernel panics when the interface is brought up.

Fix: This was obtained from a linux ath9k patch:

https://patchwork.kernel.org/patch/90926/

Some AR9220 parts require a tweak to the inivals based on the contents of the EEPROM.

There's also a register which, at least at the reset time, generates a bus error when read.

Here's how to fix it enough for testing:

[adrian@pcbsd-3114]/data/freebsd/mips/head/src/sys/dev/ath/ath_hal(252)% svn diff .
How-To-Repeat: # ifconfig wlan0 create wlandev ath0
# ifconfig wlan0 up
Comment 1 dfilter service freebsd_committer freebsd_triage 2011-01-27 02:56:15 UTC
Author: adrian
Date: Thu Jan 27 02:56:03 2011
New Revision: 217921
URL: http://svn.freebsd.org/changeset/base/217921

Log:
  Writing to the analog registers on the AR9220 (Merlin PCI) seems to require a delay.
  
  This, along with an initval change which will appear in a subsequent commit,
  fixes bus panics that I have been seing with the AR9220 on a Routerstation Pro
  (AR7161 MIPS board.)
  
  Obtained from: Linux ath9k
  PR: kern/154220

Modified:
  head/sys/dev/ath/ath_hal/ah.c

Modified: head/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.c	Thu Jan 27 02:27:17 2011	(r217920)
+++ head/sys/dev/ath/ath_hal/ah.c	Thu Jan 27 02:56:03 2011	(r217921)
@@ -858,6 +858,11 @@ ath_hal_ini_write(struct ath_hal *ah, co
 	for (r = 0; r < ia->rows; r++) {
 		OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0),
 		    HAL_INI_VAL(ia, r, col));
+
+		/* Analog shift register delay seems needed for Merlin - PR kern/154220 */
+		if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0)
+			OS_DELAY(100);
+
 		DMA_YIELD(regWr);
 	}
 	return regWr;
@@ -881,6 +886,10 @@ ath_hal_ini_bank_write(struct ath_hal *a
 
 	for (r = 0; r < ia->rows; r++) {
 		OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), data[r]);
+
+		/* Analog shift register delay seems needed for Merlin - PR kern/154220 */
+		if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0)
+			OS_DELAY(100);
 		DMA_YIELD(regWr);
 	}
 	return regWr;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 2 Adrian Chadd freebsd_committer freebsd_triage 2011-01-27 06:46:29 UTC
Responsible Changed
From-To: freebsd-bugs->adrian

My bug
Comment 3 Adrian Chadd freebsd_committer freebsd_triage 2011-04-09 04:04:52 UTC
State Changed
From-To: open->closed

This has been committed to -HEAD and verifies to work.