1. 05 Apr, 2022 3 commits
  2. 01 Apr, 2022 4 commits
  3. 30 Mar, 2022 3 commits
    • Wen Gong's avatar
      ath11k: reduce the wait time of 11d scan and hw scan while add interface · 1f682dc9
      Wen Gong authored
      Currently ath11k will wait 11d scan complete while add interface in
      ath11k_mac_op_add_interface(), when system resume without enable
      wowlan, ath11k_mac_op_add_interface() is called for each resume, thus
      it increase the resume time of system. And ath11k_mac_op_hw_scan()
      after ath11k_mac_op_add_interface() also needs some time cost because
      the previous 11d scan need more than 5 seconds when 6 GHz is enabled,
      then the scan started event will indicated to ath11k after the 11d
      scan completed.
      
      While 11d scan/hw scan is running in firmware, if ath11k update channel
      list to firmware by WMI_SCAN_CHAN_LIST_CMDID, then firmware will cancel
      the current scan which is running, it lead the scan failed. The patch
      commit 9dcf6808 ("ath11k: add 11d scan offload support") used
      finish_11d_scan/finish_11d_ch_list/pending_11d to synchronize the 11d
      scan/hw scan/channel list between ath11k/firmware/mac80211 and to avoid
      the scan fail.
      
      Add wait operation before ath11k update channel list, function
      ath11k_reg_update_chan_list() will wait until the current 11d scan/hw
      scan completed. And remove the wait operation of start 11d scan and
      waiting channel list complete in hw scan. After these changes, resume
      time cost reduce about 5 seconds and also hw scan time cost reduced
      obviously, and scan failed not seen.
      
      The 11d scan is sent to firmware only one time for each interface added
      in mac.c, and it is moved after the 1st hw scan because 11d scan will
      cost some time and thus leads the AP scan result update to UI delay.
      Currently priority of ath11k's hw scan is WMI_SCAN_PRIORITY_LOW, and
      priority of 11d scan in firmware is WMI_SCAN_PRIORITY_MEDIUM, then the
      11d scan which sent after hw scan will cancel the hw scan in firmware,
      so change the priority to WMI_SCAN_PRIORITY_MEDIUM for the hw scan which
      is in front of the 11d scan, thus it will not happen scan cancel in
      firmware.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
      
      Fixes: 9dcf6808 ("ath11k: add 11d scan offload support")
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220328035832.14122-1-quic_wgong@quicinc.com
      1f682dc9
    • Wen Gong's avatar
      ath11k: add support to search regdb data in board-2.bin for WCN6855 · 801cb1d2
      Wen Gong authored
      Currently ath11k only download the same regdb.bin file for all WCN6855
      chips, actually ath11k needs to distinguish all different WCN6855 chips.
      
      This is to re-use the string type which include bus, chip id, board id,
      vendor, device, subsystem-vendor, subsystem-device and variant for
      WCN6855 to distinguish different regdb in board-2.bin.
      
      ath11k will first load board-2.bin and search in it for the regdb data
      with the above parameters, if matched one regdb data, then download it
      to firmware, if not matched any one, then ath11k will download the file
      regdb.bin to firmware.
      
      Add enum value ATH11K_BD_IE_REGDB and enum type ath11k_bd_ie_regdb_type
      to distinguish regdb data and board data since they are in the same file
      board-2.bin.
      
      This only take effect for WCN6855 which supports regdb in hardware parameters.
      
      Test log:
      [ 3833.091948] ath11k_pci 0000:05:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [ 3833.092072] ath11k_pci 0000:05:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 205316
      [ 3833.092079] ath11k_pci 0000:05:00.0: board name
      [ 3833.092083] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092088] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 31                                   -id=1
      [ 3833.092091] ath11k_pci 0000:05:00.0: board name
      [ 3833.092095] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092099] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 32                                   -id=2
      [ 3833.092102] ath11k_pci 0000:05:00.0: board name
      [ 3833.092105] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092109] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 33                                   -id=3
      [ 3833.092112] ath11k_pci 0000:05:00.0: board name
      [ 3833.092116] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [ 3833.092119] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [ 3833.092123] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [ 3833.092126] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [ 3833.092130] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [ 3833.092133] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [ 3833.092137] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36 2c 76 61 72 69 61  ard-id=266,varia
      [ 3833.092140] ath11k_pci 0000:05:00.0: 00000070: 6e 74 3d 48 50 5f 47 38 5f 4c 61 6e 63 69 61 31  nt=HP_G8_Lancia1
      [ 3833.092144] ath11k_pci 0000:05:00.0: 00000080: 35                                               5
      [ 3833.092147] ath11k_pci 0000:05:00.0: board name
      [ 3833.092150] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [ 3833.092154] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [ 3833.092157] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [ 3833.092161] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [ 3833.092165] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [ 3833.092168] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [ 3833.092172] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36                    ard-id=266
      [ 3833.092206] ath11k_pci 0000:05:00.0: board name
      [ 3833.092209] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [ 3833.092213] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [ 3833.092216] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [ 3833.092220] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [ 3833.092223] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [ 3833.092227] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [ 3833.092230] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32                    ard-id=262
      [ 3833.092234] ath11k_pci 0000:05:00.0: boot found match regdb data for name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [ 3833.092238] ath11k_pci 0000:05:00.0: board name
      [ 3833.092241] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092245] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 31 31                                -id=11
      [ 3833.092248] ath11k_pci 0000:05:00.0: board name
      [ 3833.092251] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092255] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 32 32                                -id=22
      [ 3833.092258] ath11k_pci 0000:05:00.0: board name
      [ 3833.092261] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092265] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 33 33                                -id=33
      [ 3833.092268] ath11k_pci 0000:05:00.0: boot found regdb data for 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [ 3833.092272] ath11k_pci 0000:05:00.0: fetched regdb
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220319023543.14288-4-quic_wgong@quicinc.com
      801cb1d2
    • Edmond Gagnon's avatar
      wcn36xx: Implement tx_rate reporting · 1216c4d3
      Edmond Gagnon authored
      Currently, the driver reports a tx_rate of 6.0 MBit/s no matter the true
      rate:
      
      root@linaro-developer:~# iw wlan0 link
      Connected to 6c:f3:7f:eb:9b:92 (on wlan0)
              SSID: SQ-DEVICETEST
              freq: 5200
              RX: 4141 bytes (32 packets)
              TX: 2082 bytes (15 packets)
              signal: -77 dBm
              rx bitrate: 135.0 MBit/s MCS 6 40MHz short GI
              tx bitrate: 6.0 MBit/s
      
              bss flags:      short-slot-time
              dtim period:    1
              beacon int:     100
      
      This patch requests HAL_GLOBAL_CLASS_A_STATS_INFO via a hal_get_stats
      firmware message and reports it via ieee80211_ops::sta_statistics.
      
      root@linaro-developer:~# iw wlan0 link
      Connected to 6c:f3:7f:eb:73:b2 (on wlan0)
              SSID: SQ-DEVICETEST
              freq: 5700
              RX: 26788094 bytes (19859 packets)
              TX: 1101376 bytes (12119 packets)
              signal: -75 dBm
              rx bitrate: 135.0 MBit/s MCS 6 40MHz short GI
              tx bitrate: 108.0 MBit/s VHT-MCS 5 40MHz VHT-NSS 1
      
              bss flags:      short-slot-time
              dtim period:    1
              beacon int:     100
      
      Tested on MSM8939 with WCN3680B running firmware CNSS-PR-2-0-1-2-c1-00083,
      and verified by sniffing frames over the air with Wireshark to ensure the
      MCS indices match.
      Signed-off-by: default avatarEdmond Gagnon <egagnon@squareup.com>
      Reviewed-by: default avatarBenjamin Li <benl@squareup.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220325224212.159690-1-egagnon@squareup.com
      1216c4d3
  4. 28 Mar, 2022 1 commit
  5. 25 Mar, 2022 9 commits
    • Wenli Looi's avatar
      ath9k: add functions to get paprd rate mask · 673424ce
      Wenli Looi authored
      This removes some code duplication with le32_to_cpu. This may also be
      required for QCN550x support, to provide an abstraction over the
      underlying EEPROM format.
      Signed-off-by: default avatarWenli Looi <wlooi@ucalgary.ca>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220320233010.123106-7-wlooi@ucalgary.ca
      673424ce
    • Wenli Looi's avatar
      ath9k: refactor ar9003_hw_spur_mitigate_ofdm · 19302537
      Wenli Looi authored
      Similar to ar9003_hw_spur_mitigate_mrc_cck, simplify the code by using
      ar9003_get_spur_chan_ptr. This may also be required for QCN550x support,
      to provide an abstraction over the underlying EEPROM format.
      Signed-off-by: default avatarWenli Looi <wlooi@ucalgary.ca>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220320233010.123106-6-wlooi@ucalgary.ca
      19302537
    • Wenli Looi's avatar
      ath9k: fix ar9003_get_eepmisc · 9aaff386
      Wenli Looi authored
      The current implementation is reading the wrong eeprom type.
      
      Fixes: d8ec2e2a ("ath9k: Add an eeprom_ops callback for retrieving the eepmisc value")
      Signed-off-by: default avatarWenli Looi <wlooi@ucalgary.ca>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220320233010.123106-5-wlooi@ucalgary.ca
      9aaff386
    • Wenli Looi's avatar
      ath9k: use AR9300_MAX_CHAINS when appropriate · 3096a4d9
      Wenli Looi authored
      Replace other constants with AR9300_MAX_CHAINS when appropriate.
      
      This change does not appear to affect the final binary.
      Signed-off-by: default avatarWenli Looi <wlooi@ucalgary.ca>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220320233010.123106-4-wlooi@ucalgary.ca
      3096a4d9
    • Wenli Looi's avatar
      ath9k: split set11nRateFlags and set11nChainSel · a96474a7
      Wenli Looi authored
      This makes the code clearer since set11nRateFlags currently sets
      both the rate flags and chain sel. This may also be required for
      QCN550x support, where the rate flags and chain sel are in separate
      fields.
      
      This change does not appear to affect the final binary.
      Signed-off-by: default avatarWenli Looi <wlooi@ucalgary.ca>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220320233010.123106-3-wlooi@ucalgary.ca
      a96474a7
    • Wenli Looi's avatar
      ath9k: make ATH_SREV macros more consistent · 26c31016
      Wenli Looi authored
      This makes the macros more consistent and removes hidden dependencies on
      ah for macros that take _ah as a parameter.
      
      This change does not appear to affect the final binary.
      Signed-off-by: default avatarWenli Looi <wlooi@ucalgary.ca>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220320233010.123106-2-wlooi@ucalgary.ca
      26c31016
    • Karthikeyan Periyasamy's avatar
      ath11k: Add peer rhash table support · 7b0c70d9
      Karthikeyan Periyasamy authored
      When more clients (128) are connected, the UL data traffic
      KPI measurement is low compared to single client. This issue
      is due to more CPU cycles spent on the peer lookup operation
      with more clients. So reduce the peer lookup operation by
      modifying the linear based lookup operation into the rhash
      based lookup operation. This improve the peak throughput
      measurement. Since this is a software algorithm change, it is
      applicable for all the platforms.
      
      TCP UL 128 Clients test case Observation (64bit system):
      Previous: ~550 Mbps
      Now	: ~860 Mbps
      
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/1644036628-5334-1-git-send-email-quic_periyasa@quicinc.com
      7b0c70d9
    • Wen Gong's avatar
      ath11k: add read variant from SMBIOS for download board data · 9d97114d
      Wen Gong authored
      This is to read variant from SMBIOS such as read from DT, the variant
      string will be used to one part of string which used to search board
      data from board-2.bin.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220315104721.26649-3-quic_wgong@quicinc.com
      9d97114d
    • Wen Gong's avatar
      ath11k: add fallback board name without variant while searching board-2.bin · 62abdc06
      Wen Gong authored
      Sometimes it has a variant value which read from DT or SMBIOS by
      ath11k, and meanwhile it does not have the matched board name in
      board-2.bin, then it will failed at boot up phase.
      
      Add fallback board name which removed variant value and search again
      in board-2.bin when failed with variant and try to load the board
      data again to increase boot up success rate.
      
      dmesg log after this patch:
      [169547.248472] ath11k_pci 0000:05:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262,variant=test'
      [169547.248565] ath11k_pci 0000:05:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 180324
      [169547.248568] ath11k_pci 0000:05:00.0: board name
      [169547.248570] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248571] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248572] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248574] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248575] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248576] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [169547.248577] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32                    ard-id=262
      [169547.248578] ath11k_pci 0000:05:00.0: board name
      [169547.248579] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248581] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248582] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248583] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248584] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248585] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [169547.248587] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36                    ard-id=266
      [169547.248588] ath11k_pci 0000:05:00.0: board name
      [169547.248589] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248590] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248591] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248592] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248594] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248595] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 31 38 2c 71 6d 69 2d 62  chip-id=18,qmi-b
      [169547.248596] ath11k_pci 0000:05:00.0: 00000060: 6f 61 72 64 2d 69 64 3d 32 36 36                 oard-id=266
      [169547.248597] ath11k_pci 0000:05:00.0: failed to fetch board data for bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262,variant=test from ath11k/WCN6855/hw2.0/board-2.bin
      [169547.248476] ath11k_pci 0000:05:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [169547.248634] ath11k_pci 0000:05:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 180324
      [169547.248636] ath11k_pci 0000:05:00.0: board name
      [169547.248637] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248638] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248639] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248641] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248642] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248643] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [169547.248645] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32                    ard-id=262
      [169547.248646] ath11k_pci 0000:05:00.0: boot found match for name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [169547.248647] ath11k_pci 0000:05:00.0: boot found board data for 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [169547.248649] ath11k_pci 0000:05:00.0: using board api 2
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220315104721.26649-2-quic_wgong@quicinc.com
      62abdc06
  6. 23 Mar, 2022 8 commits
    • Baochen Qiang's avatar
      ath11k: enable PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability · 1e4ac717
      Baochen Qiang authored
      In Qualcomm ARM platforms there is WL_EN pin and other power regulators
      which can be controlled at platform side to completely reset the chip.
      For most of x86 and other platforms, the chip is connected via PCIe M.2
      interface, and there is no way to control WL_EN pin. Instead the host
      driver needs to reset the chip via PCIE_SOC_GLOBAL_RESET hardware
      register, just like ath11k does currently.
      
      But when using PCIE_SOC_GLOBAL_RESET there are some hardware registers
      which are not cleared/restored. To handle those cases we can enable
      PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability to tell the firmware
      to do some platform specific operations after firmware download.
      
      This does not fix any known issues, but is recommended by the firmware
      team, so enable the capability on QCA6390 and WCN6855 PCI devices. It is
      currently unclear if this should be enabled also on QCN9074, so leave it
      disabled for now. On AHB devices this is not needed as they don't use
      PCIE_SOC_GLOBAL_RESET.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Signed-off-by: default avatarBaochen Qiang <bqiang@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20211011055602.77342-1-bqiang@codeaurora.org
      1e4ac717
    • Wen Gong's avatar
      ath11k: fix the warning of dev_wake in mhi_pm_disable_transition() · 0d7a8a62
      Wen Gong authored
      When test device recovery with below command, it has warning in message
      as below.
      echo assert > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash
      echo assert > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash
      
      warning message:
      [ 1965.642121] ath11k_pci 0000:06:00.0: simulating firmware assert crash
      [ 1968.471364] ieee80211 phy0: Hardware restart was requested
      [ 1968.511305] ------------[ cut here ]------------
      [ 1968.511368] WARNING: CPU: 3 PID: 1546 at drivers/bus/mhi/core/pm.c:505 mhi_pm_disable_transition+0xb37/0xda0 [mhi]
      [ 1968.511443] Modules linked in: ath11k_pci ath11k mac80211 libarc4 cfg80211 qmi_helpers qrtr_mhi mhi qrtr nvme nvme_core
      [ 1968.511563] CPU: 3 PID: 1546 Comm: kworker/u17:0 Kdump: loaded Tainted: G        W         5.17.0-rc3-wt-ath+ #579
      [ 1968.511629] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0067.2021.0528.1339 05/28/2021
      [ 1968.511704] Workqueue: mhi_hiprio_wq mhi_pm_st_worker [mhi]
      [ 1968.511787] RIP: 0010:mhi_pm_disable_transition+0xb37/0xda0 [mhi]
      [ 1968.511870] Code: a9 fe ff ff 4c 89 ff 44 89 04 24 e8 03 46 f6 e5 44 8b 04 24 41 83 f8 01 0f 84 21 fe ff ff e9 4c fd ff ff 0f 0b e9 af f8 ff ff <0f> 0b e9 5c f8 ff ff 48 89 df e8 da 9e ee e3 e9 12 fd ff ff 4c 89
      [ 1968.511923] RSP: 0018:ffffc900024efbf0 EFLAGS: 00010286
      [ 1968.511969] RAX: 00000000ffffffff RBX: ffff88811d241250 RCX: ffffffffc0176922
      [ 1968.512014] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff888118a90a24
      [ 1968.512059] RBP: ffff888118a90800 R08: 0000000000000000 R09: ffff888118a90a27
      [ 1968.512102] R10: ffffed1023152144 R11: 0000000000000001 R12: ffff888118a908ac
      [ 1968.512229] R13: ffff888118a90928 R14: dffffc0000000000 R15: ffff888118a90a24
      [ 1968.512310] FS:  0000000000000000(0000) GS:ffff888234200000(0000) knlGS:0000000000000000
      [ 1968.512405] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1968.512493] CR2: 00007f5538f443a8 CR3: 000000016dc28001 CR4: 00000000003706e0
      [ 1968.512587] Call Trace:
      [ 1968.512672]  <TASK>
      [ 1968.512751]  ? _raw_spin_unlock_irq+0x1f/0x40
      [ 1968.512859]  mhi_pm_st_worker+0x3ac/0x790 [mhi]
      [ 1968.512959]  ? mhi_pm_mission_mode_transition.isra.0+0x7d0/0x7d0 [mhi]
      [ 1968.513063]  process_one_work+0x86a/0x1400
      [ 1968.513184]  ? pwq_dec_nr_in_flight+0x230/0x230
      [ 1968.513312]  ? move_linked_works+0x125/0x290
      [ 1968.513416]  worker_thread+0x6db/0xf60
      [ 1968.513536]  ? process_one_work+0x1400/0x1400
      [ 1968.513627]  kthread+0x241/0x2d0
      [ 1968.513733]  ? kthread_complete_and_exit+0x20/0x20
      [ 1968.513821]  ret_from_fork+0x22/0x30
      [ 1968.513924]  </TASK>
      
      Reason is mhi_deassert_dev_wake() from mhi_device_put() is called
      but mhi_assert_dev_wake() from __mhi_device_get_sync() is not called
      in progress of recovery. Commit 8e055992 ("bus: mhi: core:
      Skip device wake in error or shutdown state") add check for the
      pm_state of mhi in __mhi_device_get_sync(), and the pm_state is not
      the normal state untill recovery is completed, so it leads the
      dev_wake is not 0 and above warning print in mhi_pm_disable_transition()
      while checking mhi_cntrl->dev_wake.
      
      Add check in ath11k_pci_write32()/ath11k_pci_read32() to skip call
      mhi_device_put() if mhi_device_get_sync() does not really do wake,
      then the warning gone.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220228064606.8981-5-quic_wgong@quicinc.com
      0d7a8a62
    • Wen Gong's avatar
      ath11k: Add hw-restart option to simulate_fw_crash · 78e3e609
      Wen Gong authored
      Add hw-restart to directly restart wlan. Like UTF mode start it will
      restart hardware and download firmware again.
      
      Usage:
      1. Run command:
         echo hw-restart > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash
         echo hw-restart > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash
      2. wlan will be restart and do recovery process and success.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220228064606.8981-4-quic_wgong@quicinc.com
      78e3e609
    • Wen Gong's avatar
      ath11k: add synchronization operation between reconfigure of mac80211 and ath11k_base · 38194f3a
      Wen Gong authored
      ieee80211_reconfig() of mac80211 is the main function for recovery of
      each ieee80211_hw and ath11k, and ath11k_core_reconfigure_on_crash()
      is the main function for recovery of ath11k_base, it has more than
      one ieee80211_hw and ath11k for each ath11k_base, so it need to add
      synchronization between them, otherwise it has many issue.
      
      For example, when ath11k_core_reconfigure_on_crash() is not complete,
      mac80211 send a hw scan request to ath11k, it leads firmware crash,
      because firmware has not been initialized at that moment, firmware
      is only finished downloaded and loaded, it can not receive scan
      command.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220228064606.8981-3-quic_wgong@quicinc.com
      38194f3a
    • Wen Gong's avatar
      ath11k: add support for device recovery for QCA6390/WCN6855 · 13da397f
      Wen Gong authored
      Currently ath11k has device recovery logic, it is introduced by this
      patch "ath11k: Add support for subsystem recovery" which is upstream
      by https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=ath11k-bringup&id=3a7b4838b6f6f234239f263ef3dc02e612a083ad.
      
      The patch is for AHB devices such as IPQ8074, it has remote proc module
      which is used to download the firmware and boots the processor which
      firmware is running on. If firmware crashed, remote proc module will
      detect it and download and boot firmware again. Below command will
      trigger a firmware crash, and then user can test feature of device
      recovery.
      
      Test command:
      echo assert > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash
      echo assert > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash
      
      Unfortunately, QCA6390 is PCIe bus, it does not have the remote proc
      module, it use mhi module to communicate between firmware and ath11k.
      So ath11k does not support device recovery for QCA6390 currently.
      
      This patch is to add the extra logic which is different for QCA6390.
      When firmware crashed, MHI_CB_EE_RDDM event will be indicate by
      firmware and then ath11k_mhi_op_status_cb which is the callback of
      mhi_controller will receive the MHI_CB_EE_RDDM event, then ath11k
      will start to do recovery process, ath11k_core_reset() calls
      ath11k_hif_power_down()/ath11k_hif_power_up(), then the mhi/ath11k
      will start to download and boot firmware. There are some logic to
      avoid deadloop recovery and two simultaneous recovery operations.
      And because it has muti-radios for the soc, so it add some logic
      in ath11k_mac_op_reconfig_complete() to make sure all radios has
      reconfig complete and then complete the device recovery.
      
      Also it add workqueue_aux, because ab->workqueue is used when receive
      ATH11K_QMI_EVENT_FW_READY in recovery process(queue_work(ab->workqueue,
      &ab->restart_work)), and ath11k_core_reset will wait for max
      ATH11K_RESET_TIMEOUT_HZ for the previous restart_work finished, if
      ath11k_core_reset also queued in ab->workqueue, then it will delay
      restart_work of previous recovery and lead previous recovery fail.
      
      ath11k recovery success for QCA6390/WCN6855 after apply this patch.
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220228064606.8981-2-quic_wgong@quicinc.com
      13da397f
    • Wen Gong's avatar
      ath11k: disable regdb support for QCA6390 · 0c104b61
      Wen Gong authored
      Currently it does not have regdb files for QCA6390, so disable its regdb
      support feature now.
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-05266-QCAHSTSWPLZ_V2_TO_X86-1
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220319023543.14288-3-quic_wgong@quicinc.com
      0c104b61
    • Wen Gong's avatar
      ath11k: remove unused ATH11K_BD_IE_BOARD_EXT · 7fb376ad
      Wen Gong authored
      Currently ATH11K_BD_IE_BOARD_EXT is not used, so remove it.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220319023543.14288-2-quic_wgong@quicinc.com
      7fb376ad
    • Niels Dossche's avatar
      ath11k: acquire ab->base_lock in unassign when finding the peer by addr · 2db80f93
      Niels Dossche authored
      ath11k_peer_find_by_addr states via lockdep that ab->base_lock must be
      held when calling that function in order to protect the list. All
      callers except ath11k_mac_op_unassign_vif_chanctx have that lock
      acquired when calling ath11k_peer_find_by_addr. That lock is also not
      transitively held by a path towards ath11k_mac_op_unassign_vif_chanctx.
      The solution is to acquire the lock when calling
      ath11k_peer_find_by_addr inside ath11k_mac_op_unassign_vif_chanctx.
      
      I am currently working on a static analyser to detect missing locks and
      this was a reported case. I manually verified the report by looking at
      the code, but I do not have real hardware so this is compile tested
      only.
      
      Fixes: 701e48a4 ("ath11k: add packet log support for QCA6390")
      Signed-off-by: default avatarNiels Dossche <dossche.niels@gmail.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220314215253.92658-1-dossche.niels@gmail.com
      2db80f93
  7. 21 Mar, 2022 4 commits
  8. 18 Mar, 2022 8 commits