1. 24 4月, 2018 1 次提交
  2. 20 4月, 2018 4 次提交
    • G
      ath10k: fix fw path name for WCN3990 target · 6da2b2d4
      Govind Singh 提交于
      FW path is mapped incorrectly for the WCN3990
      hw version. Fix fw path with correct hw1.0 name.
      Signed-off-by: NGovind Singh <govinds@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      6da2b2d4
    • E
      ath10k: add inlined wrappers for htt rx ops · 9a5511d5
      Erik Stromdahl 提交于
      Added for the same reason as the TX wrappers.
      Signed-off-by: NErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      9a5511d5
    • E
      ath10k: add inlined wrappers for htt tx ops · 5df6e131
      Erik Stromdahl 提交于
      These wrappers makes the HTT ops align better with the HIF ops
      (where similar wrappers are used).
      
      It also makes it easier for a target to have unsupported ops
      (by letting the corresponding function pointer be NULL).
      Signed-off-by: NErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      5df6e131
    • T
      ath10k: search all IEs for variant before falling back · c8489668
      Thomas Hebb 提交于
      commit f2593cb1 ("ath10k: Search SMBIOS for OEM board file
      extension") added a feature to ath10k that allows Board Data File
      (BDF) conflicts between multiple devices that use the same device IDs
      but have different calibration requirements to be resolved by allowing
      a "variant" string to be stored in SMBIOS [and later device tree, added
      by commit d06f26c5 ("ath10k: search DT for qcom,ath10k-calibration-
      variant")] that gets appended to the ID stored in board-2.bin.
      
      This original patch had a regression, however. Namely that devices with
      a variant present in SMBIOS that didn't need custom BDFs could no longer
      find the default BDF, which has no variant appended. The patch was
      reverted and re-applied with a fix for this issue in commit 1657b8f8
      ("search SMBIOS for OEM board file extension").
      
      But the fix to fall back to a default BDF introduced another issue: the
      driver currently parses IEs in board-2.bin one by one, and for each one
      it first checks to see if it matches the ID with the variant appended.
      If it doesn't, it checks to see if it matches the "fallback" ID with no
      variant. If a matching BDF is found at any point during this search, the
      search is terminated and that BDF is used. The issue is that it's very
      possible (and is currently the case for board-2.bin files present in the
      ath10k-firmware repository) for the default BDF to occur in an earlier
      IE than the variant-specific BDF. In this case, the current code will
      happily choose the default BDF even though a better-matching BDF is
      present later in the file.
      
      This patch fixes the issue by first searching the entire file for the ID
      with variant, and searching for the fallback ID only if that search
      fails. It also includes some code cleanup in the area, as
      ath10k_core_fetch_board_data_api_n() no longer does its own string
      mangling to remove the variant from an ID, instead leaving that job to a
      new flag passed to ath10k_core_create_board_name().
      
      I've tested this patch on a QCA4019 and verified that the driver behaves
      correctly for 1) both fallback and variant BDFs present, 2) only fallback
      BDF present, and 3) no matching BDFs present.
      
      Fixes: 1657b8f8 ("ath10k: search SMBIOS for OEM board file extension")
      Signed-off-by: NThomas Hebb <tommyhebb@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      c8489668
  3. 19 4月, 2018 16 次提交
  4. 10 4月, 2018 3 次提交
  5. 29 3月, 2018 13 次提交
    • R
      ath10k: fix vdev stats for 10.4 firmware · 1b3fdb50
      Rajkumar Manoharan 提交于
      Currently vdev stats displayed in fw_stats are applicable
      only for TLV based firmware and fix it for 10.4 firmware
      as of now. The vdev stats in 10.4 firmware is split into two
      parts (vdev_stats, vdev_stats_extended). The actual stats
      are captured only in extended vdev stats. In order to enable
      vdev stats, appropriate feature bit will be set on extended
      resource config. As FTM related counters are available only on
      newer 10.4 based firmware, these counters will be displayed
      only on valid data.
      Signed-off-by: NRajkumar Manoharan <rmanohar@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      1b3fdb50
    • C
      ath10k: fix recent bandwidth conversion bug · 91493e8e
      Christian Lamparter 提交于
      The commit "cfg80211: make RATE_INFO_BW_20 the default" changed
      the index of RATE_INFO_BW_20, but the updates to ath10k missed
      the special bandwidth calculation case in
      ath10k_update_per_peer_tx_stats().
      
      This will fix below warning,
      
       WARNING: CPU: 0 PID: 609 at net/wireless/util.c:1254
       cfg80211_calculate_bitrate+0x174/0x220
       invalid rate bw=1, mcs=9, nss=2
      
       (unwind_backtrace) from
       (cfg80211_calculate_bitrate+0x174/0x220)
       (cfg80211_calculate_bitrate) from
       (nl80211_put_sta_rate+0x44/0x1dc)from
       (nl80211_put_sta_rate) from
       (nl80211_send_station+0x388/0xaf0)
       (nl80211_get_station+0xa8/0xec)
       [ end trace da8257d6a850e91a ]
      
      Fixes: 842be75c ("cfg80211: make RATE_INFO_BW_20 the default")
      Signed-off-by: NChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: NAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      91493e8e
    • A
      ath10k: advertize beacon_int_min_gcd · 8ebee73b
      Anilkumar Kolli 提交于
      This patch fixes regression caused by 0c317a02
      ("cfg80211: support virtual interfaces with different beacon intervals"),
      with this change cfg80211 expects the driver to advertize
      'beacon_int_min_gcd' to support different beacon intervals in multivap
      scenario. This support is added for, QCA988X/QCA99X0/QCA9984/QCA4019.
      
      Verifed AP + mesh bring up on QCA9984 with beacon interval 100msec and
      1000msec respectively.
      Frimware: firmware-5.bin_10.4-3.5.3-00053
      
      Fixes: 0c317a02 ("cfg80211: support virtual interfaces with different beacon intervals")
      Signed-off-by: NAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      8ebee73b
    • Y
      ath10k: fix TDLS peer TX data failure issue on encryped AP · 9cdd0057
      Yingying Tang 提交于
      For WPA encryption, QCA6174 firmware(version: WLAN.RM.4.4) will unblock
      data when M4 was sent successfully. For other encryption which didn't need
      4-way handshake firmware will unblock the data when peer authorized. Since
      TDLS is 3-way handshake host need send authorize cmd to firmware to unblock
      data.
      Signed-off-by: NYingying Tang <yintang@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      9cdd0057
    • Y
      ath10k: avoid to set WEP key for TDLS peer · c3816c9e
      Yingying Tang 提交于
      TDLS peer do not need WEP key. Setting WEP key will lead
      to TDLS setup failure. Add fix to avoid setting WEP key
      for TDLS peer.
      Signed-off-by: NYingying Tang <yintang@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      c3816c9e
    • Y
      ath10k: enable TDLS peer inactivity detection · 4c9f8d11
      Yingying Tang 提交于
      Enable TDLS peer inactivity detetion feature.
      QCA6174 firmware(version: WLAN.RM.4.4) support TDLS link inactivity detecting.
      Set related parameters in TDLS WMI command to enable this feature.
      Signed-off-by: NYingying Tang <yintang@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      4c9f8d11
    • Y
      ath10k: enable TDLS peer buffer STA feature · 802ca335
      Yingying Tang 提交于
      Enable TDLS peer buffer STA feature.
      QCA6174 firmware(version: WLAN.RM.4.4) support TDLS peer buffer STA,
      it reports this capability through wmi service map in wmi service ready
      event. Set related parameter in TDLS WMI command to enable this feature.
      Signed-off-by: NYingying Tang <yintang@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      802ca335
    • A
      ath10k: add memory dump support QCA9984 · 219cc084
      Anilkumar Kolli 提交于
      QCA9984/QCA99X0/QCA4019 chipsets have 8 memory regions, dump all of them to the
      firmware coredump file. Some of the regions need to be read using ioread() so
      add new region types for them.
      Signed-off-by: NAnilkumar Kolli <akolli@codeaurora.org>
      [kvalo: refactoring etc]
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      219cc084
    • K
      ath10k: refactor ath10k_pci_dump_memory() in preparation for QCA9984 support · 10c22884
      Kalle Valo 提交于
      As QCA9984 needs two region types refactor the code to make it easier add the
      new types. No functional changes.
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      10c22884
    • S
      ath10k: suppress "Unknown eventid: 36925" warnings · 606204bb
      Sathishkumar Muruganandam 提交于
      FW has Smart Logging feature enabled by default for detecting failures
      and processing FATAL_CONDITION_EVENTID (36925 - 0x903D) back to host.
      
      Since ath10k doesn't implement the Smart Logging and FATAL CONDITION
      EVENT processing yet, suppressing the unknown event ID warning by moving
      this under ATH10K_DBG_WMI.
      
      Simulated the same issue by having associated STA powered off when
      ping flood was running from AP backbone. This triggerd STA KICKOUT
      in AP followed by FATAL CONDITION event 36925.
      
      Issue was reproduced and verified in below DUT
      ------------------------------------------------
      AP mode of OpenWRT QCA9984 running 6.0.8 with FW ver 10.4-3.5.3-00053
      Signed-off-by: NSathishkumar Muruganandam <murugana@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      606204bb
    • R
      ath10k: add FW API 6 firmware image for QCA9377 · e3814bec
      Ryan Hsu 提交于
      Firmware WLAN.TF.2.1-00014-QCARMSWP-1 now supports reading the board ID
      information and also required 9 IRAM bank, which older ath10k version
      don't have the support will fail to be enabled, so in order to maintain
      the backward compatibility, we need to update the FW API to 6.
      Signed-off-by: NRyan Hsu <ryanhsu@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      e3814bec
    • R
      ath10k: enable QCA6174/QCA9377 to read the chip temperature · e98199a8
      Ryan Hsu 提交于
      The firmware of QCA6174/QCA9377 already support the feature, just enable
      it to be able to handle the get_temperature command and process the event.
      
      You can read the temperature by using the hwmon interface,
      
      cat /sys/class/ieee80211/phy*/device/hwmon/hwmon2/temp1_input
      
      Verified with the following hardware and software combination,
      QCA6174, only firmware-4.bin doesn't support this, otherwise all support.
      QCA9377, all the firmwares upstreamed support this command
      Signed-off-by: NRyan Hsu <ryanhsu@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      e98199a8
    • K
      Revert "ath10k: send (re)assoc peer command when NSS changed" · 55cc11da
      Karthikeyan Periyasamy 提交于
      This reverts commit 55884c04.
      
      When Ath10k is in AP mode and an unassociated STA sends a VHT action frame
      (Operating Mode Notification for the NSS change) periodically to AP this causes
      ath10k to call ath10k_station_assoc() which sends WMI_PEER_ASSOC_CMDID during
      NSS update. Over the time (with a certain client it can happen within 15 mins
      when there are over 500 of these VHT action frames) continuous calls of
      WMI_PEER_ASSOC_CMDID cause firmware to assert due to resource exhaust.
      
      To my knowledge setting WMI_PEER_NSS peer param itself enough to handle NSS
      updates and no need to call ath10k_station_assoc(). So revert the original
      commit from 2014 as it's unclear why the change was really needed.
      Now the firmware assert doesn't happen anymore.
      
      Issue observed in QCA9984 platform with firmware version:10.4-3.5.3-00053.
      This Change tested in QCA9984 with firmware version: 10.4-3.5.3-00053 and
      QCA988x platform with firmware version: 10.2.4-1.0-00036.
      
      Firmware Assert log:
      
      ath10k_pci 0002:01:00.0: firmware crashed! (guid e61f1274-9acd-4c5b-bcca-e032ea6e723c)
      ath10k_pci 0002:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
      ath10k_pci 0002:01:00.0: kconfig debug 1 debugfs 1 tracing 0 dfs 1 testmode 1
      ath10k_pci 0002:01:00.0: firmware ver 10.4-3.5.3-00053 api 5 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast crc32 4c56a386
      ath10k_pci 0002:01:00.0: board_file api 2 bmi_id 0:4 crc32 c2271344
      ath10k_pci 0002:01:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal otp max-sta 512 raw 0 hwcrypto 1
      ath10k_pci 0002:01:00.0: firmware register dump:
      ath10k_pci 0002:01:00.0: [00]: 0x0000000A 0x000015B3 0x00981E5F 0x00975B31
      ath10k_pci 0002:01:00.0: [04]: 0x00981E5F 0x00060530 0x00000011 0x00446C60
      ath10k_pci 0002:01:00.0: [08]: 0x0042F1FC 0x00458080 0x00000017 0x00000000
      ath10k_pci 0002:01:00.0: [12]: 0x00000009 0x00000000 0x00973ABC 0x00973AD2
      ath10k_pci 0002:01:00.0: [16]: 0x00973AB0 0x00960E62 0x009606CA 0x00000000
      ath10k_pci 0002:01:00.0: [20]: 0x40981E5F 0x004066DC 0x00400000 0x00981E34
      ath10k_pci 0002:01:00.0: [24]: 0x80983B48 0x0040673C 0x000000C0 0xC0981E5F
      ath10k_pci 0002:01:00.0: [28]: 0x80993DEB 0x0040676C 0x00431AB8 0x0045D0C4
      ath10k_pci 0002:01:00.0: [32]: 0x80993E5C 0x004067AC 0x004303C0 0x0045D0C4
      ath10k_pci 0002:01:00.0: [36]: 0x80994AAB 0x004067DC 0x00000000 0x0045D0C4
      ath10k_pci 0002:01:00.0: [40]: 0x809971A0 0x0040681C 0x004303C0 0x00441B00
      ath10k_pci 0002:01:00.0: [44]: 0x80991904 0x0040688C 0x004303C0 0x0045D0C4
      ath10k_pci 0002:01:00.0: [48]: 0x80963AD3 0x00406A7C 0x004303C0 0x009918FC
      ath10k_pci 0002:01:00.0: [52]: 0x80960E80 0x00406A9C 0x0000001F 0x00400000
      ath10k_pci 0002:01:00.0: [56]: 0x80960E51 0x00406ACC 0x00400000 0x00000000
      ath10k_pci 0002:01:00.0: Copy Engine register dump:
      ath10k_pci 0002:01:00.0: index: addr: sr_wr_idx: sr_r_idx: dst_wr_idx: dst_r_idx:
      ath10k_pci 0002:01:00.0: [00]: 0x0004a000 15 15 3 3
      ath10k_pci 0002:01:00.0: [01]: 0x0004a400 17 17 212 213
      ath10k_pci 0002:01:00.0: [02]: 0x0004a800 21 21 20 21
      ath10k_pci 0002:01:00.0: [03]: 0x0004ac00 25 25 27 25
      ath10k_pci 0002:01:00.0: [04]: 0x0004b000 515 515 144 104
      ath10k_pci 0002:01:00.0: [05]: 0x0004b400 28 28 155 156
      ath10k_pci 0002:01:00.0: [06]: 0x0004b800 12 12 12 12
      ath10k_pci 0002:01:00.0: [07]: 0x0004bc00 1 1 1 1
      ath10k_pci 0002:01:00.0: [08]: 0x0004c000 0 0 127 0
      ath10k_pci 0002:01:00.0: [09]: 0x0004c400 1 1 1 1
      ath10k_pci 0002:01:00.0: [10]: 0x0004c800 0 0 0 0
      ath10k_pci 0002:01:00.0: [11]: 0x0004cc00 0 0 0 0
      ath10k_pci 0002:01:00.0: CE[1] write_index 212 sw_index 213 hw_index 0 nentries_mask 0x000001ff
      ath10k_pci 0002:01:00.0: CE[2] write_index 20 sw_index 21 hw_index 0 nentries_mask 0x0000007f
      ath10k_pci 0002:01:00.0: CE[5] write_index 155 sw_index 156 hw_index 0 nentries_mask 0x000001ff
      ath10k_pci 0002:01:00.0: DMA addr: nbytes: meta data: byte swap: gather:
      ath10k_pci 0002:01:00.0: [455]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [456]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [457]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [458]: 0x594a0038 0 0 0 1
      ath10k_pci 0002:01:00.0: [459]: 0x580c0a42 0 0 0 0
      ath10k_pci 0002:01:00.0: [460]: 0x594a0060 0 0 0 1
      ath10k_pci 0002:01:00.0: [461]: 0x580c0c42 0 0 0 0
      ath10k_pci 0002:01:00.0: [462]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [463]: 0x580c0c42 0 0 0 0
      ath10k_pci 0002:01:00.0: [464]: 0x594a0038 0 0 0 1
      ath10k_pci 0002:01:00.0: [465]: 0x580c0a42 0 0 0 0
      ath10k_pci 0002:01:00.0: [466]: 0x594a0060 0 0 0 1
      ath10k_pci 0002:01:00.0: [467]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [468]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [469]: 0x580c1c42 0 0 0 0
      ath10k_pci 0002:01:00.0: [470]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [471]: 0x580c1c42 0 0 0 0
      ath10k_pci 0002:01:00.0: [472]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [473]: 0x580c1c42 0 0 0 0
      ath10k_pci 0002:01:00.0: [474]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [475]: 0x580c0642 0 0 0 0
      ath10k_pci 0002:01:00.0: [476]: 0x594a0038 0 0 0 1
      ath10k_pci 0002:01:00.0: [477]: 0x580c0842 0 0 0 0
      ath10k_pci 0002:01:00.0: [478]: 0x594a0060 0 0 0 1
      ath10k_pci 0002:01:00.0: [479]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [480]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [481]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [482]: 0x594a0038 0 0 0 1
      ath10k_pci 0002:01:00.0: [483]: 0x580c0842 0 0 0 0
      ath10k_pci 0002:01:00.0: [484]: 0x594a0060 0 0 0 1
      ath10k_pci 0002:01:00.0: [485]: 0x580c0642 0 0 0 0
      ath10k_pci 0002:01:00.0: [486]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [487]: 0x580c0642 0 0 0 0
      ath10k_pci 0002:01:00.0: [488]: 0x594a0038 0 0 0 1
      ath10k_pci 0002:01:00.0: [489]: 0x580c0842 0 0 0 0
      ath10k_pci 0002:01:00.0: [490]: 0x594a0060 0 0 0 1
      ath10k_pci 0002:01:00.0: [491]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [492]: 0x58174040 0 1 0 0
      ath10k_pci 0002:01:00.0: [493]: 0x5a946040 0 1 0 0
      ath10k_pci 0002:01:00.0: [494]: 0x59909040 0 1 0 0
      ath10k_pci 0002:01:00.0: [495]: 0x5ae5a040 0 1 0 0
      ath10k_pci 0002:01:00.0: [496]: 0x58096040 0 1 0 0
      ath10k_pci 0002:01:00.0: [497]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [498]: 0x580c0642 0 0 0 0
      ath10k_pci 0002:01:00.0: [499]: 0x5c1e0040 0 1 0 0
      ath10k_pci 0002:01:00.0: [500]: 0x58153040 0 1 0 0
      ath10k_pci 0002:01:00.0: [501]: 0x58129040 0 1 0 0
      ath10k_pci 0002:01:00.0: [502]: 0x5952f040 0 1 0 0
      ath10k_pci 0002:01:00.0: [503]: 0x59535040 0 1 0 0
      ath10k_pci 0002:01:00.0: [504]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [505]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [506]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [507]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [508]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [509]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [510]: 0x594a0010 0 0 0 1
      ath10k_pci 0002:01:00.0: [511]: 0x580c0042 0 0 0 0
      ath10k_pci 0002:01:00.0: [512]: 0x5adcc040 0 1 0 0
      ath10k_pci 0002:01:00.0: [513]: 0x5cf3d040 0 1 0 0
      ath10k_pci 0002:01:00.0: [514]: 0x5c1e9040 64 1 0 0
      ath10k_pci 0002:01:00.0: [515]: 0x00000000 0 0 0 0
      Signed-off-by: NKarthikeyan Periyasamy <periyasa@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      55cc11da
  6. 26 3月, 2018 3 次提交
    • K
      ath10k: Fix kernel panic while using worker (ath10k_sta_rc_update_wk) · 8b2d93dd
      Karthikeyan Periyasamy 提交于
      When attempt to run worker (ath10k_sta_rc_update_wk) after the station object
      (ieee80211_sta) delete will trigger the kernel panic.
      
      This problem arise in AP + Mesh configuration, Where the current node AP VAP
      and neighbor node mesh VAP MAC address are same. When the current mesh node
      try to establish the mesh link with neighbor node, driver peer creation for
      the neighbor mesh node fails due to duplication MAC address. Already the AP
      VAP created with same MAC address.
      
      It is caused by the following scenario steps.
      
      Steps:
      1. In above condition, ath10k driver sta_state callback (ath10k_sta_state)
         fails to do the state change for a station from IEEE80211_STA_NOTEXIST
         to IEEE80211_STA_NONE due to peer creation fails. Sta_state callback is
         called from ieee80211_add_station() to handle the new station
         (neighbor mesh node) request from the wpa_supplicant.
      2. Concurrently ath10k receive the sta_rc_update callback notification from
         the mesh_neighbour_update() to handle the beacon frames of the above
         neighbor mesh node. since its atomic callback, ath10k driver queue the
         work (ath10k_sta_rc_update_wk) to handle rc update.
      3. Due to driver sta_state callback fails (step 1), mac80211 free the station
         object.
      4. When the worker (ath10k_sta_rc_update_wk) scheduled to run, it will access
         the station object which is already deleted. so it will trigger kernel
         panic.
      
      Added the peer exist check in sta_rc_update callback before queue the work.
      
      Kernel Panic log:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = c0204000
      [00000000] *pgd=00000000
      Internal error: Oops: 17 [#1] PREEMPT SMP ARM
      CPU: 1 PID: 1833 Comm: kworker/u4:2 Not tainted 3.14.77 #1
      task: dcef0000 ti: d72b6000 task.ti: d72b6000
      PC is at pwq_activate_delayed_work+0x10/0x40
      LR is at pwq_activate_delayed_work+0xc/0x40
      pc : [<c023f988>]    lr : [<c023f984>]    psr: 40000193
      sp : d72b7f18  ip : 0000007a  fp : d72b6000
      r10: 00000000  r9 : dd404414  r8 : d8c31998
      r7 : d72b6038  r6 : 00000004  r5 : d4907ec8  r4 : dcee1300
      r3 : ffffffe0  r2 : 00000000  r1 : 00000001  r0 : 00000000
      Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5787d  Table: 595bc06a  DAC: 00000015
      ...
      Process kworker/u4:2 (pid: 1833, stack limit = 0xd72b6238)
      Stack: (0xd72b7f18 to 0xd72b8000)
      7f00:                                                       00000001 dcee1300
      7f20: 00000001 c02410dc d8c31980 dd404400 dd404400 c0242790 d8c31980 00000089
      7f40: 00000000 d93e1340 00000000 d8c31980 c0242568 00000000 00000000 00000000
      7f60: 00000000 c02474dc 00000000 00000000 000000f8 d8c31980 00000000 00000000
      7f80: d72b7f80 d72b7f80 00000000 00000000 d72b7f90 d72b7f90 d72b7fac d93e1340
      7fa0: c0247404 00000000 00000000 c0208d20 00000000 00000000 00000000 00000000
      7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
      [<c023f988>] (pwq_activate_delayed_work) from [<c02410dc>] (pwq_dec_nr_in_flight+0x58/0xc4)
      [<c02410dc>] (pwq_dec_nr_in_flight) from [<c0242790>] (worker_thread+0x228/0x360)
      [<c0242790>] (worker_thread) from [<c02474dc>] (kthread+0xd8/0xec)
      [<c02474dc>] (kthread) from [<c0208d20>] (ret_from_fork+0x14/0x34)
      Code: e92d4038 e1a05000 ebffffbc[69210.619376] SMP: failed to stop secondary CPUs
      Rebooting in 3 seconds..
      Signed-off-by: NKarthikeyan Periyasamy <periyasa@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      8b2d93dd
    • C
      ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait · 9ef0f58e
      Carl Huang 提交于
      The skb may be freed in tx completion context before
      trace_ath10k_wmi_cmd is called. This can be easily captured when
      KASAN(Kernel Address Sanitizer) is enabled. The fix is to move
      trace_ath10k_wmi_cmd before the send operation. As the ret has no
      meaning in trace_ath10k_wmi_cmd then, so remove this parameter too.
      Signed-off-by: NCarl Huang <cjhuang@codeaurora.org>
      Tested-by: NBrian Norris <briannorris@chromium.org>
      Reviewed-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      9ef0f58e
    • M
      ath10k: debugfs support to get final TPC stats for 10.4 variants · bc64d052
      Maharaja Kennadyrajan 提交于
      Export the final Transmit Power Control (TPC) value, which is the
      minimum of control power and existing TPC value to user space via
      a new debugfs file "tpc_stats_final" to help with debugging.
      It works with the new wmi cmd and event introduced in 10.4 firmware
      branch.
      
      WMI command ID: WMI_PDEV_GET_TPC_TABLE_CMDID
      WMI event ID: WMI_PDEV_TPC_TABLE_EVENTID
      
      cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
      
      $ cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
      
      TPC config for channel 5180 mode 10
      
      CTL             =  0x 0 Reg. Domain             = 58
      Antenna Gain    =  0 Reg. Max Antenna Gain      =   0
      Power Limit     = 60 Reg. Max Power             = 60
      Num tx chains   =  2 Num supported rates        = 109
      
      ******************* CDD POWER TABLE ****************
      
      No.  Preamble Rate_code tpc_value1 tpc_value2 tpc_value3
      0    CCK      0x40        0          0
      1    CCK      0x41        0          0
      [...]
      107  HTCUP    0x 0       46          46
      108  HTCUP    0x 0       46          46
      
      ******************* STBC POWER TABLE ****************
      
      No.  Preamble Rate_code tpc_value1 tpc_value2 tpc_value3
      0    CCK      0x40        0          0
      1    CCK      0x41        0          0
      [...]
      107  HTCUP    0x 0        46         46
      108  HTCUP    0x 0        46         46
      
      ***********************************
      TXBF not supported
      **********************************
      
      The existing tpc_stats debugfs file provides the dump
      which is minimum of target power and regulatory domain.
      
      cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats
      
      Hardware_used: QCA4019
      Firmware version: firmware-5.bin_10.4-3.0-00209
      Signed-off-by: NMaharaja Kennadyrajan <mkenna@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      bc64d052