Ashish Patro | 30 Jan 20:33 2015
Picon

Frequency translators for Atheros USB 9271 WiFi cards

Hi, 

Has anyone tried using a frequency translator with an Atheros USB card (chipsets 7010 or 9271)? There are frequency translators such as Wide Band Digital Radio (WDR) which can be used with the mini-PCI versions of the WiFi card but wanted to know whether it is possible to do the USB WiFi card.

Thanks!
Ashish


_______________________________________________
ath9k-devel mailing list
ath9k-devel <at> lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Joe Qiao | 30 Jan 09:02 2015

Bug 16201 - SIOCGIWFREQ ioctl fails to get frequency info

Dear all,

 

Recently, I was encountered same issue with BUG16201, which cannot call SIOCGIWFREQ to get frequency from driver within error ENODATA.

https://bugzilla.kernel.org/show_bug.cgi?id=16201

 

I’m using ath9k v3.18-rc1-1 and hostapd 2.3 to setup AP with ACS.

[   65.671899] Backport generated by backports.git v3.18-rc1-1-0-g1f4af51

 

I added some debug info in ieee80211_cfg_get_channel() and enable driver debug with 0x200. The log is attached.

 

1).when I tried to use iwlist to show frequency, it looks the condition of comparing “open_count” and “monitors” is always failed. And I can’t see current frequency.

 

[ 1693.292593]  local->open_count = 2

[ 1693.296063]  local->monitors = 0

[ 1693.299351]  local->use_chanctx = 0

[ 1693.302866]  sdata->vif.type = 6

[ 1693.306097]  NL80211_IFTYPE_MONITOR = 6

[ 1693.309955]  chanctx_conf = 0

 

 

       if (chanctx_conf) {

              *chandef = chanctx_conf->def;

              ret = 0;

       } else if (local->open_count > 0 &&

                 local->open_count == local->monitors &&                    <<<<<< always failed

                 sdata->vif.type == NL80211_IFTYPE_MONITOR) {

              if (local->use_chanctx)

                     *chandef = local->monitor_chandef;

              else

                     *chandef = local->_oper_chandef;

              ret = 0;

       }

 

2). From the log, I can see the “vif.type” is changed finally.

 

[  207.897437]  local->open_count = 0                         <<<<<< 0

[  207.900864]  local->monitors = 0

[  207.904164]  local->use_chanctx = 0

[  207.907684]  sdata->vif.type = 6                           <<<<<< MONITOR

[  207.910942]  NL80211_IFTYPE_MONITOR = 6

[  207.914814]  chanctx_conf = 0

[  207.918186] ath: phy0: Starting driver with initial channel: 2452 MHz

[  207.933692] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff

[  207.944088] ath: phy0: Monitor mode is disabled

[  207.948670] ath: phy0: Set channel: 2452 MHz width: 0

[  207.953868] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0

[  207.962537] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff

[  207.972412] ath: phy0: Set power: 20

[  207.976631] ath: phy0: Set HW RX filter: 0x207

[  207.981531] ath: phy0: Set HW RX filter: 0x207

[  208.005020]  local->open_count = 1                         <<<<<< 1

[  208.008433]  local->monitors = 0

[  208.011690]  local->use_chanctx = 0

[  208.015211]  sdata->vif.type = 3                           <<<<<< AP

[  208.018457]  NL80211_IFTYPE_MONITOR = 6

[  208.022311]  chanctx_conf = 0

 

I guess below function will be called and it skip to reduce “open_count”, but reduce the “monitors”.

 

ieee80211_runtime_change_iftype() ==> ieee80211_do_stop(sdata, false)

 

       if (going_down)

              local->open_count--;

 

3). When I remove the condition of comparing “open_count” and “monitors”, it works. I’m able to use iwlist to show current frequency.

 

mon.ath1  22 channels in total; available frequencies :

          Channel 01 : 2.412 GHz

          Channel 02 : 2.417 GHz

          Channel 03 : 2.422 GHz

          Channel 04 : 2.427 GHz

          Channel 05 : 2.432 GHz

          Channel 06 : 2.437 GHz

          Channel 07 : 2.442 GHz

          Channel 08 : 2.447 GHz

          Channel 09 : 2.452 GHz

          Channel 10 : 2.457 GHz

          Channel 11 : 2.462 GHz

          Channel 12 : 2.467 GHz

          Channel 13 : 2.472 GHz

          Channel 36 : 5.18 GHz

          Channel 40 : 5.2 GHz

          Channel 44 : 5.22 GHz

          Channel 48 : 5.24 GHz

          Channel 149 : 5.745 GHz

          Channel 153 : 5.765 GHz

          Channel 157 : 5.785 GHz

          Channel 161 : 5.805 GHz

          Channel 165 : 5.825 GHz

          Current Frequency:2.412 GHz (Channel 1)     <<<<<< able to show

 

Would you please give some suggestions based on your rich experience?

 

Highly appreciate your feedback!

 

Thanks,

-Joe

[  197.958168] ath: phy0: Set HW Key 1
[  197.961862] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  197.973695] ath: phy0: Set channel: 2452 MHz width: 0
[  197.978951] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  197.987598] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  197.998081] ath: phy0: Detach Interface
[  198.001965] ath: phy0: Removing interface at beacon slot: 0
[  198.007600] ath: phy0: Set HW RX filter: 0x4017
[  200.375726] ath: phy0: Driver halt
[  206.303166]  local->open_count = 0
[  206.306660]  local->monitors = 0
[  206.309986]  local->use_chanctx = 0
[  206.313485]  sdata->vif.type = 2
[  206.316743]  NL80211_IFTYPE_MONITOR = 6
[  206.320610]  chanctx_conf = 0
[  206.350558]  local->open_count = 0
[  206.354112]  local->monitors = 0
[  206.357354]  local->use_chanctx = 0
[  206.360875]  sdata->vif.type = 2
[  206.364133]  NL80211_IFTYPE_MONITOR = 6
[  206.368014]  chanctx_conf = 0
[  206.403713]  local->open_count = 0
[  206.407202]  local->monitors = 0
[  206.410470]  local->use_chanctx = 0
[  206.414001]  sdata->vif.type = 2
[  206.417239]  NL80211_IFTYPE_MONITOR = 6
[  206.421109]  chanctx_conf = 0
[  206.457851]  local->open_count = 0
[  206.461291]  local->monitors = 0
[  206.464583]  local->use_chanctx = 0
[  206.468109]  sdata->vif.type = 2
[  206.471358]  NL80211_IFTYPE_MONITOR = 6
[  206.475221]  chanctx_conf = 0
[  207.835707]  local->open_count = 0
[  207.839182]  local->monitors = 0
[  207.842432]  local->use_chanctx = 0
[  207.845975]  sdata->vif.type = 3
[  207.849224]  NL80211_IFTYPE_MONITOR = 6
[  207.853082]  chanctx_conf = 0
[  207.858201]  local->open_count = 0
[  207.861675]  local->monitors = 0
[  207.864907]  local->use_chanctx = 0
[  207.868417]  sdata->vif.type = 3
[  207.871665]  NL80211_IFTYPE_MONITOR = 6
[  207.875522]  chanctx_conf = 0
[  207.897437]  local->open_count = 0
[  207.900864]  local->monitors = 0
[  207.904164]  local->use_chanctx = 0
[  207.907684]  sdata->vif.type = 6
[  207.910942]  NL80211_IFTYPE_MONITOR = 6
[  207.914814]  chanctx_conf = 0
[  207.918186] ath: phy0: Starting driver with initial channel: 2452 MHz
[  207.933692] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  207.944088] ath: phy0: Monitor mode is disabled
[  207.948670] ath: phy0: Set channel: 2452 MHz width: 0
[  207.953868] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  207.962537] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  207.972412] ath: phy0: Set power: 20
[  207.976631] ath: phy0: Set HW RX filter: 0x207
[  207.981531] ath: phy0: Set HW RX filter: 0x207
[  208.005020]  local->open_count = 1
[  208.008433]  local->monitors = 0
[  208.011690]  local->use_chanctx = 0
[  208.015211]  sdata->vif.type = 3
[  208.018457]  NL80211_IFTYPE_MONITOR = 6
[  208.022311]  chanctx_conf = 0
[  208.025432] ath: phy0: Attach a VIF of type: 3
[  208.029918] ath: phy0: Added interface at beacon slot: 0
[  208.035283] ath: phy0: Set HW RX filter: 0x4287
[  208.039890] ath: phy0: Configure tx [queue/halq] [0/0], aifs: 2, cw_min: 3, cw_max: 7, txop: 47
[  208.048664] ath: phy0: Configure tx [queue/halq] [1/1], aifs: 2, cw_min: 7, cw_max: 15, txop: 94
[  208.057514] ath: phy0: Configure tx [queue/halq] [2/2], aifs: 3, cw_min: 15, cw_max: 1023, txop: 0
[  208.066536] ath: phy0: Configure tx [queue/halq] [3/3], aifs: 7, cw_min: 15, cw_max: 1023, txop: 0
[  208.075591] ath: phy0: Set HW RX filter: 0x4287
[  208.080462] ath: phy0: Set HW RX filter: 0x4287
[  208.085708] ath: phy0: Set HW RX filter: 0x4287
[  208.086710] ADDRCONF(NETDEV_UP): ath1: link is not ready
[  208.098950] ath: phy0: Set channel: 2452 MHz width: 0
[  208.104200] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  208.112892] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  208.122862] ath: phy0: Set HW RX filter: 0x4097
[  208.127496] ath: phy0: Set channel: 2412 MHz width: 0
[  208.133056] ath: phy0: Reset to 2412 MHz, HT40: 0 fastcc: 1
[  208.139477] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  208.256922] ath: phy0: Set channel: 2417 MHz width: 0
[  208.262164] ath: phy0: Reset to 2417 MHz, HT40: 0 fastcc: 1
[  208.268566] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  208.384776] ath: phy0: Set channel: 2422 MHz width: 0
[  208.389992] ath: phy0: Reset to 2422 MHz, HT40: 0 fastcc: 1
[  208.396402] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  208.512741] ath: phy0: Set channel: 2427 MHz width: 0
[  208.517955] ath: phy0: Reset to 2427 MHz, HT40: 0 fastcc: 1
[  208.524373] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  208.640649] ath: phy0: Set channel: 2432 MHz width: 0
[  208.645864] ath: phy0: Reset to 2432 MHz, HT40: 0 fastcc: 1
[  208.652275] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  208.768620] ath: phy0: Set channel: 2437 MHz width: 0
[  208.773822] ath: phy0: Reset to 2437 MHz, HT40: 0 fastcc: 1
[  208.780219] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  208.896566] ath: phy0: Set channel: 2442 MHz width: 0
[  208.901767] ath: phy0: Reset to 2442 MHz, HT40: 0 fastcc: 1
[  208.908254] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.024826] ath: phy0: Set channel: 2447 MHz width: 0
[  209.030875] ath: phy0: Reset to 2447 MHz, HT40: 0 fastcc: 1
[  209.037345] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.152442] ath: phy0: Set channel: 2452 MHz width: 0
[  209.162856] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  209.171551] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.288349] ath: phy0: Set channel: 2457 MHz width: 0
[  209.294056] ath: phy0: Reset to 2457 MHz, HT40: 0 fastcc: 1
[  209.300519] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.416256] ath: phy0: Set channel: 2462 MHz width: 0
[  209.421466] ath: phy0: Reset to 2462 MHz, HT40: 0 fastcc: 1
[  209.427904] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.546020] ath: phy0: Set channel: 2467 MHz width: 0
[  209.551262] ath: phy0: Reset to 2467 MHz, HT40: 0 fastcc: 1
[  209.557708] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.672155] ath: phy0: Set channel: 2472 MHz width: 0
[  209.677356] ath: phy0: Reset to 2472 MHz, HT40: 0 fastcc: 1
[  209.683787] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.800110] ath: phy0: Set channel: 2452 MHz width: 0
[  209.805469] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  209.814160] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.823983] ath: phy0: Set HW RX filter: 0x4097
[  209.828826] ath: phy0: Set channel: 2452 MHz width: 0
[  209.834214] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  209.842904] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.852923] ath: phy0: Set HW RX filter: 0x4097
[  209.857544] ath: phy0: Set channel: 2412 MHz width: 0
[  209.863846] ath: phy0: Reset to 2412 MHz, HT40: 0 fastcc: 1
[  209.870292] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  209.988025] ath: phy0: Set channel: 2417 MHz width: 0
[  209.993529] ath: phy0: Reset to 2417 MHz, HT40: 0 fastcc: 1
[  209.999959] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  210.115924] ath: phy0: Set channel: 2422 MHz width: 0
[  210.121322] ath: phy0: Reset to 2422 MHz, HT40: 0 fastcc: 1
[  210.127738] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  210.243847] ath: phy0: Set channel: 2427 MHz width: 0
[  210.249070] ath: phy0: Reset to 2427 MHz, HT40: 0 fastcc: 1
[  210.255481] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  210.371788] ath: phy0: Set channel: 2432 MHz width: 0
[  210.377084] ath: phy0: Reset to 2432 MHz, HT40: 0 fastcc: 1
[  210.383504] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  210.499713] ath: phy0: Set channel: 2437 MHz width: 0
[  210.504934] ath: phy0: Reset to 2437 MHz, HT40: 0 fastcc: 1
[  210.511344] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  210.627653] ath: phy0: Set channel: 2442 MHz width: 0
[  210.632981] ath: phy0: Reset to 2442 MHz, HT40: 0 fastcc: 1
[  210.639408] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  210.757737] ath: phy0: Set channel: 2447 MHz width: 0
[  210.768707] ath: phy0: Reset to 2447 MHz, HT40: 0 fastcc: 1
[  210.775199] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  210.895175] ath: phy0: Set channel: 2452 MHz width: 0
[  210.900449] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  210.909099] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.023505] ath: phy0: Set channel: 2457 MHz width: 0
[  211.028726] ath: phy0: Reset to 2457 MHz, HT40: 0 fastcc: 1
[  211.035177] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.151373] ath: phy0: Set channel: 2462 MHz width: 0
[  211.156588] ath: phy0: Reset to 2462 MHz, HT40: 0 fastcc: 1
[  211.163026] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.279317] ath: phy0: Set channel: 2467 MHz width: 0
[  211.284546] ath: phy0: Reset to 2467 MHz, HT40: 0 fastcc: 1
[  211.290996] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.407250] ath: phy0: Set channel: 2472 MHz width: 0
[  211.412462] ath: phy0: Reset to 2472 MHz, HT40: 0 fastcc: 1
[  211.418903] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.535242] ath: phy0: Set channel: 2452 MHz width: 0
[  211.540702] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  211.549373] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.559248] ath: phy0: Set HW RX filter: 0x4097
[  211.563984] ath: phy0: Set channel: 2452 MHz width: 0
[  211.569264] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  211.577935] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.587869] ath: phy0: Set HW RX filter: 0x4097
[  211.592516] ath: phy0: Set channel: 2412 MHz width: 0
[  211.598368] ath: phy0: Reset to 2412 MHz, HT40: 0 fastcc: 1
[  211.604795] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.719086] ath: phy0: Set channel: 2417 MHz width: 0
[  211.724295] ath: phy0: Reset to 2417 MHz, HT40: 0 fastcc: 1
[  211.730700] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.847063] ath: phy0: Set channel: 2422 MHz width: 0
[  211.852281] ath: phy0: Reset to 2422 MHz, HT40: 0 fastcc: 1
[  211.858684] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  211.974954] ath: phy0: Set channel: 2427 MHz width: 0
[  211.980163] ath: phy0: Reset to 2427 MHz, HT40: 0 fastcc: 1
[  211.986567] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.102908] ath: phy0: Set channel: 2432 MHz width: 0
[  212.108134] ath: phy0: Reset to 2432 MHz, HT40: 0 fastcc: 1
[  212.114548] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.230856] ath: phy0: Set channel: 2437 MHz width: 0
[  212.236064] ath: phy0: Reset to 2437 MHz, HT40: 0 fastcc: 1
[  212.242469] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.358776] ath: phy0: Set channel: 2442 MHz width: 0
[  212.363994] ath: phy0: Reset to 2442 MHz, HT40: 0 fastcc: 1
[  212.370403] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.486698] ath: phy0: Set channel: 2447 MHz width: 0
[  212.491906] ath: phy0: Reset to 2447 MHz, HT40: 0 fastcc: 1
[  212.498310] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.614669] ath: phy0: Set channel: 2452 MHz width: 0
[  212.619891] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  212.628548] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.742616] ath: phy0: Set channel: 2457 MHz width: 0
[  212.747834] ath: phy0: Reset to 2457 MHz, HT40: 0 fastcc: 1
[  212.754278] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.870574] ath: phy0: Set channel: 2462 MHz width: 0
[  212.875832] ath: phy0: Reset to 2462 MHz, HT40: 0 fastcc: 1
[  212.882280] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  212.998451] ath: phy0: Set channel: 2467 MHz width: 0
[  213.003659] ath: phy0: Reset to 2467 MHz, HT40: 0 fastcc: 1
[  213.010093] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.126409] ath: phy0: Set channel: 2472 MHz width: 0
[  213.131611] ath: phy0: Reset to 2472 MHz, HT40: 0 fastcc: 1
[  213.138044] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.254396] ath: phy0: Set channel: 2452 MHz width: 0
[  213.259881] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  213.268549] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.278415] ath: phy0: Set HW RX filter: 0x4097
[  213.283181] ath: phy0: Set channel: 2452 MHz width: 0
[  213.288475] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  213.297106] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.307141] ath: phy0: Set HW RX filter: 0x4097
[  213.312264] ath: phy0: Set channel: 2412 MHz width: 0
[  213.317495] ath: phy0: Reset to 2412 MHz, HT40: 0 fastcc: 1
[  213.323915] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.438263] ath: phy0: Set channel: 2417 MHz width: 0
[  213.443468] ath: phy0: Reset to 2417 MHz, HT40: 0 fastcc: 1
[  213.449881] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.566168] ath: phy0: Set channel: 2422 MHz width: 0
[  213.571414] ath: phy0: Reset to 2422 MHz, HT40: 0 fastcc: 1
[  213.577828] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.694107] ath: phy0: Set channel: 2427 MHz width: 0
[  213.699309] ath: phy0: Reset to 2427 MHz, HT40: 0 fastcc: 1
[  213.705709] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.822097] ath: phy0: Set channel: 2432 MHz width: 0
[  213.827306] ath: phy0: Reset to 2432 MHz, HT40: 0 fastcc: 1
[  213.833712] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  213.950057] ath: phy0: Set channel: 2437 MHz width: 0
[  213.955270] ath: phy0: Reset to 2437 MHz, HT40: 0 fastcc: 1
[  213.961672] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.077961] ath: phy0: Set channel: 2442 MHz width: 0
[  214.083167] ath: phy0: Reset to 2442 MHz, HT40: 0 fastcc: 1
[  214.089568] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.205910] ath: phy0: Set channel: 2447 MHz width: 0
[  214.211122] ath: phy0: Reset to 2447 MHz, HT40: 0 fastcc: 1
[  214.217531] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.333811] ath: phy0: Set channel: 2452 MHz width: 0
[  214.339039] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  214.347700] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.461774] ath: phy0: Set channel: 2457 MHz width: 0
[  214.466988] ath: phy0: Reset to 2457 MHz, HT40: 0 fastcc: 1
[  214.473430] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.589659] ath: phy0: Set channel: 2462 MHz width: 0
[  214.594894] ath: phy0: Reset to 2462 MHz, HT40: 0 fastcc: 1
[  214.601346] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.717633] ath: phy0: Set channel: 2467 MHz width: 0
[  214.722835] ath: phy0: Reset to 2467 MHz, HT40: 0 fastcc: 1
[  214.729267] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.853616] ath: phy0: Set channel: 2472 MHz width: 0
[  214.858957] ath: phy0: Reset to 2472 MHz, HT40: 0 fastcc: 1
[  214.865446] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  214.984701] ath: phy0: Set channel: 2452 MHz width: 0
[  214.990028] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  214.998718] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.008646] ath: phy0: Set HW RX filter: 0x4097
[  215.013472] ath: phy0: Set channel: 2452 MHz width: 0
[  215.018788] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  215.027517] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.037539] ath: phy0: Set HW RX filter: 0x4097
[  215.043080] ath: phy0: Set channel: 2412 MHz width: 0
[  215.049613] ath: phy0: Reset to 2412 MHz, HT40: 0 fastcc: 1
[  215.056090] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.173409] ath: phy0: Set channel: 2417 MHz width: 0
[  215.178714] ath: phy0: Reset to 2417 MHz, HT40: 0 fastcc: 1
[  215.185165] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.301349] ath: phy0: Set channel: 2422 MHz width: 0
[  215.306628] ath: phy0: Reset to 2422 MHz, HT40: 0 fastcc: 1
[  215.313059] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.429249] ath: phy0: Set channel: 2427 MHz width: 0
[  215.434498] ath: phy0: Reset to 2427 MHz, HT40: 0 fastcc: 1
[  215.440908] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.558963] ath: phy0: Set channel: 2432 MHz width: 0
[  215.564196] ath: phy0: Reset to 2432 MHz, HT40: 0 fastcc: 1
[  215.570618] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.685113] ath: phy0: Set channel: 2437 MHz width: 0
[  215.690319] ath: phy0: Reset to 2437 MHz, HT40: 0 fastcc: 1
[  215.696721] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.813093] ath: phy0: Set channel: 2442 MHz width: 0
[  215.818301] ath: phy0: Reset to 2442 MHz, HT40: 0 fastcc: 1
[  215.824704] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  215.940988] ath: phy0: Set channel: 2447 MHz width: 0
[  215.946268] ath: phy0: Reset to 2447 MHz, HT40: 0 fastcc: 1
[  215.952689] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.068936] ath: phy0: Set channel: 2452 MHz width: 0
[  216.074147] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  216.082806] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.196904] ath: phy0: Set channel: 2457 MHz width: 0
[  216.202114] ath: phy0: Reset to 2457 MHz, HT40: 0 fastcc: 1
[  216.208555] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.324801] ath: phy0: Set channel: 2462 MHz width: 0
[  216.330024] ath: phy0: Reset to 2462 MHz, HT40: 0 fastcc: 1
[  216.336471] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.452759] ath: phy0: Set channel: 2467 MHz width: 0
[  216.457965] ath: phy0: Reset to 2467 MHz, HT40: 0 fastcc: 1
[  216.464400] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.580659] ath: phy0: Set channel: 2472 MHz width: 0
[  216.585885] ath: phy0: Reset to 2472 MHz, HT40: 0 fastcc: 1
[  216.592337] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.710545] ath: phy0: Set channel: 2452 MHz width: 0
[  216.715797] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  216.724447] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.734258] ath: phy0: Set HW RX filter: 0x4097
[  216.739011] ath: phy0: Set channel: 2452 MHz width: 0
[  216.744374] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  216.753031] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.762943] ath: phy0: Set HW RX filter: 0x4097
[  216.767573] ath: phy0: Set channel: 2437 MHz width: 0
[  216.773095] ath: phy0: Reset to 2437 MHz, HT40: 0 fastcc: 1
[  216.779516] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  216.896556] ath: phy0: Set channel: 2442 MHz width: 0
[  216.901812] ath: phy0: Reset to 2442 MHz, HT40: 0 fastcc: 1
[  216.908222] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.024493] ath: phy0: Set channel: 2447 MHz width: 0
[  217.029729] ath: phy0: Reset to 2447 MHz, HT40: 0 fastcc: 1
[  217.036133] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.152420] ath: phy0: Set channel: 2452 MHz width: 0
[  217.157659] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  217.166311] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.280332] ath: phy0: Set channel: 2457 MHz width: 0
[  217.285563] ath: phy0: Reset to 2457 MHz, HT40: 0 fastcc: 1
[  217.292012] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.408273] ath: phy0: Set channel: 2462 MHz width: 0
[  217.413484] ath: phy0: Reset to 2462 MHz, HT40: 0 fastcc: 1
[  217.419924] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.536231] ath: phy0: Set channel: 2467 MHz width: 0
[  217.541432] ath: phy0: Reset to 2467 MHz, HT40: 0 fastcc: 1
[  217.547867] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.664165] ath: phy0: Set channel: 2472 MHz width: 0
[  217.669394] ath: phy0: Reset to 2472 MHz, HT40: 0 fastcc: 1
[  217.675840] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.793932] ath: phy0: Set channel: 2452 MHz width: 0
[  217.799205] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  217.807889] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.817709] ath: phy0: Set HW RX filter: 0x4097
[  217.943846] ath: phy0: Set channel: 2452 MHz width: 0
[  217.949142] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  217.957795] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.967664] ath: phy0: Set channel: 2452 MHz width: 1
[  217.972872] ath: phy0: Reset to 2452 MHz, HT40: 0 fastcc: 0
[  217.981472] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  217.991364] ath: phy0: macaddr: 00:90:7f:8a:96:75, bssid: 00:00:00:00:00:00, bssidmask: ff:ff:ff:ff:ff:ff
[  218.002168] ADDRCONF(NETDEV_CHANGE): ath1: link becomes ready
[  218.017316] ath: phy0: Set HW Key 0
[  218.021276] ath: phy0: Configure tx [queue/halq] [0/0], aifs: 1, cw_min: 3, cw_max: 7, txop: 47
[  218.033299] ath: phy0: Configure tx [queue/halq] [1/1], aifs: 1, cw_min: 7, cw_max: 15, txop: 94
[  218.042396] ath: phy0: Configure tx [queue/halq] [2/2], aifs: 3, cw_min: 15, cw_max: 63, txop: 0
[  218.051481] ath: phy0: Configure tx [queue/halq] [3/3], aifs: 7, cw_min: 15, cw_max: 1023, txop: 0
_______________________________________________
ath9k-devel mailing list
ath9k-devel <at> lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
郑玉伟 | 29 Jan 05:18 2015
Picon

[PATCH] Repair soft lockup with monitor mode of ath9k_htc card


From: Yuwei Zheng <zhengyuwei <at> 360.cn>

In the environment with heavy wifi traffic, set the ar9271 into monitor mode, will trigger a deadloop
panic. 

The ath9k_hif_usb_rx_cb function excute on  the interrupt context, and ath9k_rx_tasklet excute on the
soft irq context. In other words, the ath9k_hif_usb_rx_cb have more chance to excute than
ath9k_rx_tasklet.  So in the worst condition,  the rx.rxbuf receive list is always full, and the do
{}while(true) loop will not be break. The kernel get a soft lockup panic.  

[59011.007210] BUG: soft lockup - CPU#0 stuck for 23s! 
[kworker/0:0:30609]
[59011.030560] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100 [59013.804486] BUG:
scheduling while atomic: kworker/0:0/30609/0x40010100 [59013.858522] Kernel panic - not syncing:
softlockup: hung tasks

[59014.038891] Exception stack(0xdf4bbc38 to 0xdf4bbc80)
[59014.046834] bc20:                                                       de57b950 60000113
[59014.059579] bc40: 00000000 bb32bb32 60000113 de57b948 de57b500 dc7bb440 df4bbcd0 00000000
[59014.072337] bc60: de57b950 60000113 df4bbcd0 df4bbc80 c04c259d c04c25a0 60000133 ffffffff
[59014.085233] [<c04c28db>] (__irq_svc+0x3b/0x5c) from [<c04c25a0>] (_raw_spin_unlock_irqrestore+0xc/0x10)
[59014.100437] [<c04c25a0>] (_raw_spin_unlock_irqrestore+0xc/0x10) from [<bf9c2089>]
(ath9k_rx_tasklet+0x290/0x490 [ath9k_htc]) [59014.118267] [<bf9c2089>]
(ath9k_rx_tasklet+0x290/0x490 [ath9k_htc]) from [<c0036d23>] (tasklet_action+0x3b/0x98)
[59014.134132] [<c0036d23>] (tasklet_action+0x3b/0x98) from [<c0036709>]
(__do_softirq+0x99/0x16c) [59014.147784] [<c0036709>] (__do_softirq+0x99/0x16c) from
[<c00369f7>] (irq_exit+0x5b/0x5c) [59014.160653] [<c00369f7>] (irq_exit+0x5b/0x5c) from
[<c000cfc3>] (handle_IRQ+0x37/0x78) [59014.173124] [<c000cfc3>] (handle_IRQ+0x37/0x78) from
[<c00085df>] (omap3_intc_handle_irq+0x5f/0x68) [59014.187225] [<c00085df>]
(omap3_intc_handle_irq+0x5f/0x68) from [<c04c28db>](__irq_svc+0x3b/0x5c)

This bug can be see with low performance board, such as uniprocessor beagle bone board.

Signed-off-by: Yuwei Zheng <zhengyuwei <at> 360.cn>

---
 drivers/net/wireless/ath/ath9k/hif_usb.c       | 53 ++++++++++++++++++++++----
 drivers/net/wireless/ath/ath9k/hif_usb.h       |  5 +++
 drivers/net/wireless/ath/ath9k/htc.h           | 13 +++++++
 drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 49 ++++++++++++++++++++++++ 
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c  | 26 +++++++++++++
 5 files changed, 139 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 8e7153b..febea5e 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
 <at>  <at>  -658,7 +658,6  <at>  <at>  static void ath9k_hif_usb_rx_cb(struct urb *urb)
 	default:
 		goto resubmit;
 	}
-
 	if (likely(urb->actual_length != 0)) {
 		skb_put(skb, urb->actual_length);
 		ath9k_hif_usb_rx_stream(hif_dev, skb);  <at>  <at>  -667,12 +666,18  <at>  <at>  static void
ath9k_hif_usb_rx_cb(struct urb *urb)
 resubmit:
 	skb_reset_tail_pointer(skb);
 	skb_trim(skb, 0);
-
-	usb_anchor_urb(urb, &hif_dev->rx_submitted);
-	ret = usb_submit_urb(urb, GFP_ATOMIC);
-	if (ret) {
-		usb_unanchor_urb(urb);
-		goto free;
+	if (atomic_read(&hif_dev->rx_urb_submit_delay) > 0) {
+		usb_anchor_urb(urb, &hif_dev->rx_delayed_submitted);
+		ret = tasklet_hrtimer_start(&hif_dev->rx_submit_timer,
+					    ktime_set(0, atomic_read(&hif_dev->rx_urb_submit_delay)*1000),
+					    HRTIMER_MODE_REL);
+	} else {
+		usb_anchor_urb(urb, &hif_dev->rx_submitted);
+		ret = usb_submit_urb(urb, GFP_ATOMIC);
+		if (ret) {
+			usb_unanchor_urb(urb);
+			goto free;
+		}
 	}

 	return;
 <at>  <at>  -818,9 +823,37  <at>  <at>  err:
 	return -ENOMEM;
 }

+static enum hrtimer_restart rx_urb_submit_timer_handler(struct hrtimer 
+*me) {
+	struct tasklet_hrtimer *thr = container_of(me, struct tasklet_hrtimer, timer);
+	struct  hif_device_usb *hif_dev = container_of(thr, struct hif_device_usb, rx_submit_timer);
+	struct urb *urb = NULL;
+	struct sk_buff *skb = NULL;
+	int ret;
+
+	while (true) {
+		urb = usb_get_from_anchor(&hif_dev->rx_delayed_submitted);
+		if (urb != NULL) {
+			skb = (struct sk_buff *)urb->context;
+			ret = usb_submit_urb(urb, GFP_ATOMIC);
+			if (ret != -EBUSY) {
+				usb_unanchor_urb(urb);
+				dev_kfree_skb_any(skb);
+				urb->context = NULL;
+			}
+		} else {
+			break;
+		}
+	}
+
+	return HRTIMER_NORESTART;
+}
+
 static void ath9k_hif_usb_dealloc_rx_urbs(struct hif_device_usb *hif_dev)  {
 	usb_kill_anchored_urbs(&hif_dev->rx_submitted);
+	usb_kill_anchored_urbs(&hif_dev->rx_delayed_submitted);
+	tasklet_hrtimer_cancel(&hif_dev->rx_submit_timer);
 }

 static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)  <at>  <at>  -830,6 +863,8  <at>  <at>  static
int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
 	int i, ret;

 	init_usb_anchor(&hif_dev->rx_submitted);
+	init_usb_anchor(&hif_dev->rx_delayed_submitted);
+
 	spin_lock_init(&hif_dev->rx_lock);

 	for (i = 0; i < MAX_RX_URB_NUM; i++) {  <at>  <at>  -871,6 +906,10  <at>  <at>  static int
ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
 		usb_free_urb(urb);
 	}

+	/* add for flow control*/
+	atomic_set(&hif_dev->rx_urb_submit_delay, 0);
+	tasklet_hrtimer_init(&hif_dev->rx_submit_timer, 
+rx_urb_submit_timer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+
 	return 0;

 err_submit:
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h
index 51496e7..56d6be8 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.h
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.h
 <at>  <at>  -98,9 +98,14  <at>  <at>  struct hif_device_usb {
 	struct hif_usb_tx tx;
 	struct usb_anchor regout_submitted;
 	struct usb_anchor rx_submitted;
+	struct usb_anchor rx_delayed_submitted; /* delayed submit anchor */
 	struct usb_anchor reg_in_submitted;
 	struct usb_anchor mgmt_submitted;
 	struct sk_buff *remain_skb;
+
+	struct tasklet_hrtimer  rx_submit_timer;/* delayed submit hrtimer */
+	atomic_t  rx_urb_submit_delay; /*us*/
+
 	const char *fw_name;
 	int rx_remain_len;
 	int rx_pkt_len;
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 9dde265..453d0a8 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
 <at>  <at>  -331,6 +331,10  <at>  <at>  static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb)

 #define TX_QSTAT_INC(q) (priv->debug.tx_stats.queue_stats[q]++)

+#define TASKLETRX_STAT_INC(c) 
+(hif_dev->htc_handle->drv_priv->debug.taskletrx_stats.c++)
+#define TASKLETRX_STAT_ADD(c, a) 
+(hif_dev->htc_handle->drv_priv->debug.taskletrx_stats.c += a) #define 
+TASKLETRX_STAT_SET(c, a) 
+(hif_dev->htc_handle->drv_priv->debug.taskletrx_stats.c = a)
+
 void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
 			   struct ath_rx_status *rs);

 <at>  <at>  -352,11 +356,20  <at>  <at>  struct ath_skbrx_stats {
 	u32 skb_dropped;
 };

+struct ath_taskletrx_stats {
+	u32 taskletrx_looptimes;
+	u32 taskletrx_highwater;
+	u32 taskletrx_lowwater;
+	u32 taskletrx_watermark_triggered;
+	u32 taskletrx_urb_submit_delay;
+};
+
 struct ath9k_debug {
 	struct dentry *debugfs_phy;
 	struct ath_tx_stats tx_stats;
 	struct ath_rx_stats rx_stats;
 	struct ath_skbrx_stats skbrx_stats;
+	struct ath_taskletrx_stats taskletrx_stats;
 };

 void ath9k_htc_get_et_strings(struct ieee80211_hw *hw, diff --git
a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index 8cef1ed..7c8322e 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
 <at>  <at>  -286,6 +286,51  <at>  <at>  static const struct file_operations fops_skb_rx = {
 	.llseek = default_llseek,
 };

+static ssize_t read_file_tasklet_rx(struct file *file, char __user *user_buf,
+				    size_t count, loff_t *ppos)
+{
+	struct ath9k_htc_priv *priv = file->private_data;
+	char *buf;
+	unsigned int len = 0, size = 1500;
+	ssize_t retval = 0;
+
+	buf = kzalloc(size, GFP_KERNEL);
+	if (buf == NULL)
+		return -ENOMEM;
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "Loop times",
+			priv->debug.taskletrx_stats.taskletrx_looptimes);
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "High watermark",
+			priv->debug.taskletrx_stats.taskletrx_highwater);
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "Low watermark",
+			priv->debug.taskletrx_stats.taskletrx_lowwater);
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "WM triggered",
+			priv->debug.taskletrx_stats.taskletrx_watermark_triggered);
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "URB delay",
+			priv->debug.taskletrx_stats.taskletrx_urb_submit_delay);
+	if (len > size)
+		len = size;
+
+	retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+	kfree(buf);
+
+	return retval;
+}
+
+static const struct file_operations fops_tasklet_rx = {
+	.read = read_file_tasklet_rx,
+	.open = simple_open,
+	.owner = THIS_MODULE,
+	.llseek = default_llseek,
+};
+
 static ssize_t read_file_slot(struct file *file, char __user *user_buf,
 			      size_t count, loff_t *ppos)
 {
 <at>  <at>  -518,7 +563,11  <at>  <at>  int ath9k_htc_init_debug(struct ath_hw *ah)
 	debugfs_create_file("skb_rx", S_IRUSR, priv->debug.debugfs_phy,
 			    priv, &fops_skb_rx);

+	debugfs_create_file("tasklet_rx", S_IRUSR, priv->debug.debugfs_phy,
+			    priv, &fops_tasklet_rx);
+
 	ath9k_cmn_debug_recv(priv->debug.debugfs_phy, &priv->debug.rx_stats);
+
 	ath9k_cmn_debug_phy_err(priv->debug.debugfs_phy, &priv->debug.rx_stats);

 	debugfs_create_file("slot", S_IRUSR, priv->debug.debugfs_phy, diff --git
a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index a0f58e2..f5e6217 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
 <at>  <at>  -1061,7 +1061,28  <at>  <at>  void ath9k_rx_tasklet(unsigned long data)
 	unsigned long flags;
 	struct ieee80211_hdr *hdr;

+	/* add for adaptive flow control*/
+	int looptimes = 0;
+	int highwatermark = ATH9K_HTC_RXBUF*3/4;
+	int lowwatermark = ATH9K_HTC_RXBUF/4;
+	unsigned int delay = 0;
+
+	struct htc_target *htc = priv->htc;
+	struct hif_device_usb *hif_dev = htc->hif_dev;
+
+	TASKLETRX_STAT_SET(taskletrx_highwater, highwatermark);
+	TASKLETRX_STAT_SET(taskletrx_lowwater, lowwatermark);
+
 	do {
+		looptimes++;
+		TASKLETRX_STAT_SET(taskletrx_looptimes, looptimes);
+		if (looptimes > highwatermark) {
+			delay = looptimes*10;
+			atomic_set(&hif_dev->rx_urb_submit_delay, delay);
+			TASKLETRX_STAT_INC(taskletrx_watermark_triggered);
+			TASKLETRX_STAT_SET(taskletrx_urb_submit_delay, delay);
+		}
+
 		spin_lock_irqsave(&priv->rx.rxbuflock, flags);
 		list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
 			if (tmp_buf->in_process) {
 <at>  <at>  -1072,6 +1093,11  <at>  <at>  void ath9k_rx_tasklet(unsigned long data)

 		if (rxbuf == NULL) {
 			spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
+			if (looptimes < lowwatermark) {
+				atomic_set(&hif_dev->rx_urb_submit_delay, 0);
+				TASKLETRX_STAT_SET(taskletrx_urb_submit_delay, 0);
+			}
+
 			break;
 		}

--
1.9.1
zhengyuwei | 29 Jan 05:09 2015
Picon

[PATCH] Repair soft lockup with monitor mode of ath9k_htc card

From: Yuwei Zheng <zhengyuwei <at> 360.cn>

In the environment with heavy wifi traffic, set the ar9271 into monitor mode, will
trigger a deadloop panic. 

The ath9k_hif_usb_rx_cb function excute on  the interrupt context, and ath9k_rx_tasklet excute
on the soft irq context. In other words, the ath9k_hif_usb_rx_cb have more chance to excute than
ath9k_rx_tasklet.  So in the worst condition,  the rx.rxbuf receive list is always full,
and the do {}while(true) loop will not be break. The kernel get a soft lockup panic.  

[59011.007210] BUG: soft lockup - CPU#0 stuck for 23s! 
[kworker/0:0:30609]
[59011.030560] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
[59013.804486] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
[59013.858522] Kernel panic - not syncing: softlockup: hung tasks

[59014.038891] Exception stack(0xdf4bbc38 to 0xdf4bbc80)
[59014.046834] bc20:                                                       de57b950 60000113
[59014.059579] bc40: 00000000 bb32bb32 60000113 de57b948 de57b500 dc7bb440 df4bbcd0 00000000
[59014.072337] bc60: de57b950 60000113 df4bbcd0 df4bbc80 c04c259d c04c25a0 60000133 ffffffff
[59014.085233] [<c04c28db>] (__irq_svc+0x3b/0x5c) from [<c04c25a0>] (_raw_spin_unlock_irqrestore+0xc/0x10)
[59014.100437] [<c04c25a0>] (_raw_spin_unlock_irqrestore+0xc/0x10) from [<bf9c2089>]
(ath9k_rx_tasklet+0x290/0x490 [ath9k_htc])
[59014.118267] [<bf9c2089>] (ath9k_rx_tasklet+0x290/0x490 [ath9k_htc]) from [<c0036d23>] (tasklet_action+0x3b/0x98)
[59014.134132] [<c0036d23>] (tasklet_action+0x3b/0x98) from [<c0036709>] (__do_softirq+0x99/0x16c)
[59014.147784] [<c0036709>] (__do_softirq+0x99/0x16c) from [<c00369f7>] (irq_exit+0x5b/0x5c)
[59014.160653] [<c00369f7>] (irq_exit+0x5b/0x5c) from [<c000cfc3>] (handle_IRQ+0x37/0x78)
[59014.173124] [<c000cfc3>] (handle_IRQ+0x37/0x78) from [<c00085df>] (omap3_intc_handle_irq+0x5f/0x68)
[59014.187225] [<c00085df>] (omap3_intc_handle_irq+0x5f/0x68) from [<c04c28db>](__irq_svc+0x3b/0x5c)

This bug can be see with low performance board, such as uniprocessor beagle bone board.

Signed-off-by: Yuwei Zheng <zhengyuwei <at> 360.cn>

---
 drivers/net/wireless/ath/ath9k/hif_usb.c       | 53 ++++++++++++++++++++++----
 drivers/net/wireless/ath/ath9k/hif_usb.h       |  5 +++
 drivers/net/wireless/ath/ath9k/htc.h           | 13 +++++++
 drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 49 ++++++++++++++++++++++++
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c  | 26 +++++++++++++
 5 files changed, 139 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 8e7153b..febea5e 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
 <at>  <at>  -658,7 +658,6  <at>  <at>  static void ath9k_hif_usb_rx_cb(struct urb *urb)
 	default:
 		goto resubmit;
 	}
-
 	if (likely(urb->actual_length != 0)) {
 		skb_put(skb, urb->actual_length);
 		ath9k_hif_usb_rx_stream(hif_dev, skb);
 <at>  <at>  -667,12 +666,18  <at>  <at>  static void ath9k_hif_usb_rx_cb(struct urb *urb)
 resubmit:
 	skb_reset_tail_pointer(skb);
 	skb_trim(skb, 0);
-
-	usb_anchor_urb(urb, &hif_dev->rx_submitted);
-	ret = usb_submit_urb(urb, GFP_ATOMIC);
-	if (ret) {
-		usb_unanchor_urb(urb);
-		goto free;
+	if (atomic_read(&hif_dev->rx_urb_submit_delay) > 0) {
+		usb_anchor_urb(urb, &hif_dev->rx_delayed_submitted);
+		ret = tasklet_hrtimer_start(&hif_dev->rx_submit_timer,
+					    ktime_set(0, atomic_read(&hif_dev->rx_urb_submit_delay)*1000),
+					    HRTIMER_MODE_REL);
+	} else {
+		usb_anchor_urb(urb, &hif_dev->rx_submitted);
+		ret = usb_submit_urb(urb, GFP_ATOMIC);
+		if (ret) {
+			usb_unanchor_urb(urb);
+			goto free;
+		}
 	}

 	return;
 <at>  <at>  -818,9 +823,37  <at>  <at>  err:
 	return -ENOMEM;
 }

+static enum hrtimer_restart rx_urb_submit_timer_handler(struct hrtimer *me)
+{
+	struct tasklet_hrtimer *thr = container_of(me, struct tasklet_hrtimer, timer);
+	struct  hif_device_usb *hif_dev = container_of(thr, struct hif_device_usb, rx_submit_timer);
+	struct urb *urb = NULL;
+	struct sk_buff *skb = NULL;
+	int ret;
+
+	while (true) {
+		urb = usb_get_from_anchor(&hif_dev->rx_delayed_submitted);
+		if (urb != NULL) {
+			skb = (struct sk_buff *)urb->context;
+			ret = usb_submit_urb(urb, GFP_ATOMIC);
+			if (ret != -EBUSY) {
+				usb_unanchor_urb(urb);
+				dev_kfree_skb_any(skb);
+				urb->context = NULL;
+			}
+		} else {
+			break;
+		}
+	}
+
+	return HRTIMER_NORESTART;
+}
+
 static void ath9k_hif_usb_dealloc_rx_urbs(struct hif_device_usb *hif_dev)
 {
 	usb_kill_anchored_urbs(&hif_dev->rx_submitted);
+	usb_kill_anchored_urbs(&hif_dev->rx_delayed_submitted);
+	tasklet_hrtimer_cancel(&hif_dev->rx_submit_timer);
 }

 static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
 <at>  <at>  -830,6 +863,8  <at>  <at>  static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
 	int i, ret;

 	init_usb_anchor(&hif_dev->rx_submitted);
+	init_usb_anchor(&hif_dev->rx_delayed_submitted);
+
 	spin_lock_init(&hif_dev->rx_lock);

 	for (i = 0; i < MAX_RX_URB_NUM; i++) {
 <at>  <at>  -871,6 +906,10  <at>  <at>  static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
 		usb_free_urb(urb);
 	}

+	/* add for flow control*/
+	atomic_set(&hif_dev->rx_urb_submit_delay, 0);
+	tasklet_hrtimer_init(&hif_dev->rx_submit_timer, rx_urb_submit_timer_handler,
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+
 	return 0;

 err_submit:
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h
index 51496e7..56d6be8 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.h
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.h
 <at>  <at>  -98,9 +98,14  <at>  <at>  struct hif_device_usb {
 	struct hif_usb_tx tx;
 	struct usb_anchor regout_submitted;
 	struct usb_anchor rx_submitted;
+	struct usb_anchor rx_delayed_submitted; /* delayed submit anchor */
 	struct usb_anchor reg_in_submitted;
 	struct usb_anchor mgmt_submitted;
 	struct sk_buff *remain_skb;
+
+	struct tasklet_hrtimer  rx_submit_timer;/* delayed submit hrtimer */
+	atomic_t  rx_urb_submit_delay; /*us*/
+
 	const char *fw_name;
 	int rx_remain_len;
 	int rx_pkt_len;
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 9dde265..453d0a8 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
 <at>  <at>  -331,6 +331,10  <at>  <at>  static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb)

 #define TX_QSTAT_INC(q) (priv->debug.tx_stats.queue_stats[q]++)

+#define TASKLETRX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.taskletrx_stats.c++)
+#define TASKLETRX_STAT_ADD(c, a) (hif_dev->htc_handle->drv_priv->debug.taskletrx_stats.c += a)
+#define TASKLETRX_STAT_SET(c, a) (hif_dev->htc_handle->drv_priv->debug.taskletrx_stats.c = a)
+
 void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
 			   struct ath_rx_status *rs);

 <at>  <at>  -352,11 +356,20  <at>  <at>  struct ath_skbrx_stats {
 	u32 skb_dropped;
 };

+struct ath_taskletrx_stats {
+	u32 taskletrx_looptimes;
+	u32 taskletrx_highwater;
+	u32 taskletrx_lowwater;
+	u32 taskletrx_watermark_triggered;
+	u32 taskletrx_urb_submit_delay;
+};
+
 struct ath9k_debug {
 	struct dentry *debugfs_phy;
 	struct ath_tx_stats tx_stats;
 	struct ath_rx_stats rx_stats;
 	struct ath_skbrx_stats skbrx_stats;
+	struct ath_taskletrx_stats taskletrx_stats;
 };

 void ath9k_htc_get_et_strings(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index 8cef1ed..7c8322e 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
 <at>  <at>  -286,6 +286,51  <at>  <at>  static const struct file_operations fops_skb_rx = {
 	.llseek = default_llseek,
 };

+static ssize_t read_file_tasklet_rx(struct file *file, char __user *user_buf,
+				    size_t count, loff_t *ppos)
+{
+	struct ath9k_htc_priv *priv = file->private_data;
+	char *buf;
+	unsigned int len = 0, size = 1500;
+	ssize_t retval = 0;
+
+	buf = kzalloc(size, GFP_KERNEL);
+	if (buf == NULL)
+		return -ENOMEM;
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "Loop times",
+			priv->debug.taskletrx_stats.taskletrx_looptimes);
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "High watermark",
+			priv->debug.taskletrx_stats.taskletrx_highwater);
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "Low watermark",
+			priv->debug.taskletrx_stats.taskletrx_lowwater);
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "WM triggered",
+			priv->debug.taskletrx_stats.taskletrx_watermark_triggered);
+
+	len += scnprintf(buf + len, size - len,
+			"%20s : %10u\n", "URB delay",
+			priv->debug.taskletrx_stats.taskletrx_urb_submit_delay);
+	if (len > size)
+		len = size;
+
+	retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+	kfree(buf);
+
+	return retval;
+}
+
+static const struct file_operations fops_tasklet_rx = {
+	.read = read_file_tasklet_rx,
+	.open = simple_open,
+	.owner = THIS_MODULE,
+	.llseek = default_llseek,
+};
+
 static ssize_t read_file_slot(struct file *file, char __user *user_buf,
 			      size_t count, loff_t *ppos)
 {
 <at>  <at>  -518,7 +563,11  <at>  <at>  int ath9k_htc_init_debug(struct ath_hw *ah)
 	debugfs_create_file("skb_rx", S_IRUSR, priv->debug.debugfs_phy,
 			    priv, &fops_skb_rx);

+	debugfs_create_file("tasklet_rx", S_IRUSR, priv->debug.debugfs_phy,
+			    priv, &fops_tasklet_rx);
+
 	ath9k_cmn_debug_recv(priv->debug.debugfs_phy, &priv->debug.rx_stats);
+
 	ath9k_cmn_debug_phy_err(priv->debug.debugfs_phy, &priv->debug.rx_stats);

 	debugfs_create_file("slot", S_IRUSR, priv->debug.debugfs_phy,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index a0f58e2..f5e6217 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
 <at>  <at>  -1061,7 +1061,28  <at>  <at>  void ath9k_rx_tasklet(unsigned long data)
 	unsigned long flags;
 	struct ieee80211_hdr *hdr;

+	/* add for adaptive flow control*/
+	int looptimes = 0;
+	int highwatermark = ATH9K_HTC_RXBUF*3/4;
+	int lowwatermark = ATH9K_HTC_RXBUF/4;
+	unsigned int delay = 0;
+
+	struct htc_target *htc = priv->htc;
+	struct hif_device_usb *hif_dev = htc->hif_dev;
+
+	TASKLETRX_STAT_SET(taskletrx_highwater, highwatermark);
+	TASKLETRX_STAT_SET(taskletrx_lowwater, lowwatermark);
+
 	do {
+		looptimes++;
+		TASKLETRX_STAT_SET(taskletrx_looptimes, looptimes);
+		if (looptimes > highwatermark) {
+			delay = looptimes*10;
+			atomic_set(&hif_dev->rx_urb_submit_delay, delay);
+			TASKLETRX_STAT_INC(taskletrx_watermark_triggered);
+			TASKLETRX_STAT_SET(taskletrx_urb_submit_delay, delay);
+		}
+
 		spin_lock_irqsave(&priv->rx.rxbuflock, flags);
 		list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
 			if (tmp_buf->in_process) {
 <at>  <at>  -1072,6 +1093,11  <at>  <at>  void ath9k_rx_tasklet(unsigned long data)

 		if (rxbuf == NULL) {
 			spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
+			if (looptimes < lowwatermark) {
+				atomic_set(&hif_dev->rx_urb_submit_delay, 0);
+				TASKLETRX_STAT_SET(taskletrx_urb_submit_delay, 0);
+			}
+
 			break;
 		}

--

-- 
1.9.1
Heiko Lechner | 21 Jan 13:50 2015
Picon

AR9103(AR9132) Antenna diversity

Hi there!

I have a question about ath9k and AR9103(AR9132):
is antenna diversity available for that chipset?

TIA,
Heiko
Heiko Lechner | 21 Jan 15:27 2015
Picon

AR9103(AR9132) Antenna diversity

Hi there!

I have a question about ath9k and AR9103(AR9132):
is antenna diversity available for that chipset?

TIA,
Heiko
John W. Linville | 19 Jan 20:02 2015

[PATCH] ath9k_htc: remove dead code in error path of ath9k_htc_txcompletion_cb

This clause is conditioned on htc_hdr != NULL, but it will only be NULL
when that check is reached.

Coverity: CID 114318

Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
---
 drivers/net/wireless/ath/ath9k/htc_hst.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index a0ff5b637054..d2408da38c1c 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
 <at>  <at>  -351,11 +351,7  <at>  <at>  void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle,

 	return;
 ret:
-	/* HTC-generated packets are freed here. */
-	if (htc_hdr && htc_hdr->endpoint_id != ENDPOINT0)
-		dev_kfree_skb_any(skb);
-	else
-		kfree_skb(skb);
+	kfree_skb(skb);
 }

 static void ath9k_htc_fw_panic_report(struct htc_target *htc_handle,
--

-- 
2.1.0
Sekou DIAKITE | 13 Jan 06:47 2015
Picon

Re: Bluetooth not working on AR9462/0489:e076

:~$ dmesg | grep -i dfu
[    0.032074] Yama: becoming mindful.
The card is a QCNFA222.
I've taken pictures of the card, tell me if it is usefull to send it
to the list.

2015-01-13 0:19 GMT+01:00 Jeremy <jeremy.bomkamp <at> gmail.com>:
> Can you include the results from: dmesg | grep dfu
> And is your wifi/bluetooth card a QCNFA card?
Jeremy .... | 12 Jan 23:56 2015
Picon

Any chance for support for bluetooth on Atheros QCNFA wifi/bluetooth combos?

It looks like the firmware needed has changed, at least the file names

The lsusb shows: Bus 001 Device 003: ID 0cf3:3004 Atheros Communications, Inc, which is supported but the dmesg shows: Bluetooth: Configuration file not found ar3k/ramps_0x00000200_0.dfu and I imagine it would need the AthrBT_0x00000200_0.dfu
_______________________________________________
ath9k-devel mailing list
ath9k-devel <at> lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Hong Xu | 11 Jan 08:09 2015
Picon

[PATCH] ath9k_htc: Add a module parameter to disable blink

Add an option "blink" to enable or disable the LED blink. The default
value is set to 1 so that existing users would not experience any
unexpected changes.
---
 drivers/net/wireless/ath/ath9k/htc.h          | 1 +
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 4 ++++
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 9dde265..5697097 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
 <at>  <at>  -44,6 +44,7  <at>  <at> 

 extern struct ieee80211_ops ath9k_htc_ops;
 extern int htc_modparam_nohwcrypt;
+extern int led_blink;

 enum htc_phymode {
 	HTC_MODE_11NA		= 0,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
index 50f74a2..998b558 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
 <at>  <at>  -279,6 +279,10  <at>  <at>  void ath9k_init_leds(struct ath9k_htc_priv *priv)
 	else
 		priv->ah->led_pin = ATH_LED_PIN_DEF;

+	if (!led_blink)
+		priv->led_cdev.default_trigger =
+			ieee80211_get_radio_led_name(priv->hw);
+
 	ath9k_configure_leds(priv);

 	snprintf(priv->led_name, sizeof(priv->led_name),
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index e8fa944..c762d84 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
 <at>  <at>  -38,6 +38,10  <at>  <at>  static int ath9k_ps_enable;
 module_param_named(ps_enable, ath9k_ps_enable, int, 0444);
 MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave");

+int led_blink = 1;
+module_param_named(blink, led_blink, int, 0444);
+MODULE_PARM_DESC(blink, "Enable LED blink on activity");
+
 #ifdef CONFIG_MAC80211_LEDS
 static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = {
 	{ .throughput = 0 * 1024, .blink_time = 334 },
--

-- 
2.2.1
Hong Xu | 11 Jan 07:30 2015
Picon

[PATCH] ath9k_htc: Add a module parameter to disable blink


Hi all,

The attached patch adds a module parameter to disable blink for ath9k_htc. Much of it imitates how
ath9k makes its blink parameter.

Best,
Hong

_______________________________________________
ath9k-devel mailing list
ath9k-devel <at> lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Gmane