Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: Fix ASPM for AR9462

If the L1 entrance latency is not calibrated properly
in the EEPROM in WB222 boards, there could be problems
in connectivity. Check and correct the calibrated value
if it doesn't match the optimal value for WB222, 4us.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Sujith Manoharan and committed by
John W. Linville
b380a43b 587b36d3

+31
+14
drivers/net/wireless/ath/ath9k/ar9003_hw.c
··· 745 745 static void ar9003_hw_configpcipowersave(struct ath_hw *ah, 746 746 bool power_off) 747 747 { 748 + /* 749 + * Increase L1 Entry Latency. Some WB222 boards don't have 750 + * this change in eeprom/OTP. 751 + * 752 + */ 753 + if (AR_SREV_9462(ah)) { 754 + u32 val = ah->config.aspm_l1_fix; 755 + if ((val & 0xff000000) == 0x17000000) { 756 + val &= 0x00ffffff; 757 + val |= 0x27000000; 758 + REG_WRITE(ah, 0x570c, val); 759 + } 760 + } 761 + 748 762 /* Nothing to do on restore for 11N */ 749 763 if (!power_off /* !restore */) { 750 764 /* set bit 19 to allow forcing of pcie core into L1 state */
+1
drivers/net/wireless/ath/ath9k/hw.h
··· 311 311 u16 ani_poll_interval; /* ANI poll interval in ms */ 312 312 313 313 /* Platform specific config */ 314 + u32 aspm_l1_fix; 314 315 u32 xlna_gpio; 315 316 u32 ant_ctrl_comm2g_switch_enable; 316 317 bool xatten_margin_cfg;
+16
drivers/net/wireless/ath/ath9k/pci.c
··· 314 314 return; 315 315 } 316 316 317 + /* 318 + * 0x70c - Ack Frequency Register. 319 + * 320 + * Bits 27:29 - DEFAULT_L1_ENTRANCE_LATENCY. 321 + * 322 + * 000 : 1 us 323 + * 001 : 2 us 324 + * 010 : 4 us 325 + * 011 : 8 us 326 + * 100 : 16 us 327 + * 101 : 32 us 328 + * 110/111 : 64 us 329 + */ 330 + if (AR_SREV_9462(ah)) 331 + pci_read_config_dword(pdev, 0x70c, &ah->config.aspm_l1_fix); 332 + 317 333 pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm); 318 334 if (aspm & (PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1)) { 319 335 ah->aspm_enabled = true;