1. 03 May, 2022 10 commits
  2. 02 May, 2022 15 commits
    • Jakub Kicinski's avatar
      rtw88: remove a copy of the NAPI_POLL_WEIGHT define · 0d3b26c4
      Jakub Kicinski authored
      Defining local versions of NAPI_POLL_WEIGHT with the same
      values in the drivers just makes refactoring harder.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://lore.kernel.org/r/20220429174643.196994-2-kuba@kernel.org
      0d3b26c4
    • Xiaomeng Tong's avatar
      carl9170: tx: fix an incorrect use of list iterator · 54a6f295
      Xiaomeng Tong authored
      If the previous list_for_each_entry_continue_rcu() don't exit early
      (no goto hit inside the loop), the iterator 'cvif' after the loop
      will be a bogus pointer to an invalid structure object containing
      the HEAD (&ar->vif_list). As a result, the use of 'cvif' after that
      will lead to a invalid memory access (i.e., 'cvif->id': the invalid
      pointer dereference when return back to/after the callsite in the
      carl9170_update_beacon()).
      
      The original intention should have been to return the valid 'cvif'
      when found in list, NULL otherwise. So just return NULL when no
      entry found, to fix this bug.
      
      Cc: stable@vger.kernel.org
      Fixes: 1f1d9654 ("carl9170: refactor carl9170_update_beacon")
      Signed-off-by: default avatarXiaomeng Tong <xiam0nd.tong@gmail.com>
      Acked-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220328122820.1004-1-xiam0nd.tong@gmail.com
      54a6f295
    • Jakub Kicinski's avatar
      wil6210: use NAPI_POLL_WEIGHT for napi budget · 3b3299a1
      Jakub Kicinski authored
      The comment next to WIL6210_NAPI_BUDGET says "arbitrary".
      If we're picking arbitrary values let's pick the recommended
      default which is NAPI_POLL_WEIGHT.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429174643.196994-4-kuba@kernel.org
      3b3299a1
    • Jakub Kicinski's avatar
      ath10k: remove a copy of the NAPI_POLL_WEIGHT define · 52bcfd1b
      Jakub Kicinski authored
      Defining local versions of NAPI_POLL_WEIGHT with the same
      values in the drivers just makes refactoring harder.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429174643.196994-3-kuba@kernel.org
      52bcfd1b
    • Manikanta Pubbisetty's avatar
      ath11k: Add support for WCN6750 device · 00402f49
      Manikanta Pubbisetty authored
      WCN6750 is non-DBS 2x2 11AX chipset. Unlike QCA6390 which is a
      DBS (dual band simultaneous) solution (2 LMACs), WCN6750 has a
      single LMAC supporting 2G, 5G and 6G bands but will operate only
      on one band at any given point.
      
      WCN6750 is a PCIe based solution, but it is attached to the WPSS
      (Wireless Processor SubSystem) Q6 processor, hence it is enumerated
      by the Q6 processor. It is registered to the APSS processor
      (Application Processor SubSystem) as a platform device(AHB) and
      remoteproc APIs are used to boot up or shutdown the device like
      other AHB devices.
      
      Also, Device information like BAR and it's size is not known to the
      APSS processor as the chip is enumerated by WPSS Q6. These details
      are fetched over QMI.
      
      STA and AP modes are supported. Verified basic connectivity and ping
      in both the modes.
      
      An important point to note is that though WCN6750 is a PCIe device,
      it cannot be attached to any other platform except on Qualcomm
      Snapdragon SoCs due to the aforementioned reasons.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-10-quic_mpubbise@quicinc.com
      00402f49
    • Manikanta Pubbisetty's avatar
      ath11k: Datapath changes to support WCN6750 · e67ba197
      Manikanta Pubbisetty authored
      HAL RX descriptor for WCN6750 is same as QCN9074, this
      means that the size of the HAL RX decriptor and the DP
      APIs that WCN6750 requires to enable datapath should be
      initialized with that of QCN9074's RX descriptor size
      and the DP APIs respectively. There is one change wrt to
      REO configuration though, REO configuration for WCN6750
      follows WCN6855, therefore use reo_setup() of WCN6855
      for WCN6750.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-9-quic_mpubbise@quicinc.com
      e67ba197
    • Manikanta Pubbisetty's avatar
      ath11k: HAL changes to support WCN6750 · 49890d9c
      Manikanta Pubbisetty authored
      Add HAL changes required to support WCN6750. Offsets of some registers
      for WCN6750 are different from other supported devices; move such
      register offsets to platform specific ath11k_hw_regs.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-8-quic_mpubbise@quicinc.com
      49890d9c
    • Manikanta Pubbisetty's avatar
      ath11k: Add QMI changes for WCN6750 · 73d3e713
      Manikanta Pubbisetty authored
      In the case of WCN6750, FW doesn't request for DDR memory
      via QMI, instead it uses a fixed 12MB reserved Memory region
      in the DDR which is called as MSA region. As a result, QMI
      message sequence is not same as other ath11k supported devices.
      
      Also, M3 firmware will be bundled into the FW and will be
      downloaded to the target as part of Q6 boot.
      
      This is the QMI flow in the case of WCN6750,
      
      1) QMI firmware indication REQ/RESP
      2) QMI host capability REQ/RESP
      3) QMI target capability REQ/RESP
      4) QMI device info REQ/RESP
      5) QMI BDF download
      6) QMI FW ready
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-7-quic_mpubbise@quicinc.com
      73d3e713
    • Manikanta Pubbisetty's avatar
      ath11k: Fetch device information via QMI for WCN6750 · 676f8905
      Manikanta Pubbisetty authored
      Since WPPS Q6 does the PCIe enumeration of WCN6750, device
      information like BAR and BAR size is not known to the APPS
      processor (Application Processor SubSystem). In order to
      fetch these details, a QMI message called device info request
      will be sent to the target. Therefore, add logic to fetch
      BAR details from the target.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-6-quic_mpubbise@quicinc.com
      676f8905
    • Manikanta Pubbisetty's avatar
      ath11k: Add register access logic for WCN6750 · 56c8ccf3
      Manikanta Pubbisetty authored
      WCN6750 uses static window mapping to access the HW registers.
      Unlike QCN9074 which uses 3rd window for UMAC and 2nd window
      for CE register access, WCN6750 uses 1st window for UMAC
      and 2nd window for CE registers.
      
      Also, refactor the code so that WCN6750 can use the existing
      ath11k_pci_read32/write32() APIs for accessing the registers.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-5-quic_mpubbise@quicinc.com
      56c8ccf3
    • Manikanta Pubbisetty's avatar
      ath11k: Add HW params for WCN6750 · d1e1edfd
      Manikanta Pubbisetty authored
      WCN6750 is a PCIe based solution that is attached to and enumerated
      by the WPSS (Wireless Processor SubSystem) Q6 processor.
      
      Though it is a PCIe device, since it is not attached to APSS processor
      (Application Processor SubSystem), APSS will be unaware of such a decice
      and hence it is registered to the APSS processor as a platform device(AHB).
      Because of this hybrid nature, it is called as a hybrid bus device.
      
      A new variable hybrid_bus_type is defined in hw_params to indicate the
      hybrid nature of the device.
      
      Add HW params for WCN6750.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-4-quic_mpubbise@quicinc.com
      d1e1edfd
    • Manikanta Pubbisetty's avatar
      ath11k: Move parameters in bus_params to hw_params · 92c1858e
      Manikanta Pubbisetty authored
      In ath11k, bus_params were added with an intention to hold
      parameters related to bus (AHB/PCI), but this is not true
      as some bus parameters being different between chipsets of
      the same bus.
      
      With the addition of WCN6750 to ath11k, bus parameters are
      going to be entirely different among AHB devices. Therefore,
      it is wise to move bus_params to hw_params and get rid of
      bus_params entirely.
      
      Also, mhi_support parameter is not used anywhere in the driver,
      remove it from bus_params.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-3-quic_mpubbise@quicinc.com
      92c1858e
    • Manikanta Pubbisetty's avatar
      dt: bindings: net: add bindings of WCN6750 for ath11k · 00fd2408
      Manikanta Pubbisetty authored
      WCN6750 is the WLAN chip on Qualcomm Snapdragon SoC SC7280;
      Though being a PCIe based solution, it is not attached to
      the APSS processor (Application Processor SubSystem), it is
      instead attached to another tiny processor called WPSS Q6
      processor (Wireless Processor SubSystem) on the SC7280 MSM,
      where the WLAN firmware runs, and it is the WLAN firmware
      running on the Q6 processor which enumerates WCN6750, as a
      result APPS processor would never know such a device being
      present in the system and would not detect the WCN6750
      hardware unless and otherwise WCN6750 is registered as a
      platform device. This is the reason behind adding WCN6750
      WLAN node in the device tree.
      
      Add WCN6750 wireless driver support, its based on ath11k driver.
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220429170502.20080-2-quic_mpubbise@quicinc.com
      00fd2408
    • Wen Gong's avatar
      ath11k: change management tx queue to avoid connection timed out · 3a597f0d
      Wen Gong authored
      In the phase of wlan load, it has hw scan and 11d scan which sent to
      firmware by ath11k, then hw scan and 11d scan will use about 14 seconds,
      and meanwhile ath11k_reg_update_chan_list() is running in workqueue of
      ath11k_base, and wait for 11d scan/hw scan finished. When the hw scan
      finished, mac80211 will start to connect and send management packet,
      at this moment, ath11k_reg_update_chan_list() is still waiting for 11d
      scan finished, so wmi_mgmt_tx_work of ath11k will not run and thus the
      tx management packet also not send out and lead authentication timed
      out.
      
      log:
      INFO kernel: [  187.885322] wlan0: authenticate with 72:6c:57:43:9f:90
      INFO kernel: [  187.937266] wlan0: send auth to 72:6c:57:43:9f:90 (try 1/3)
      INFO kernel: [  188.626944] wlan0: send auth to 72:6c:57:43:9f:90 (try 2/3)
      INFO kernel: [  189.650999] wlan0: send auth to 72:6c:57:43:9f:90 (try 3/3)
      INFO kernel: [  190.651917] wlan0: authentication with 72:6c:57:43:9f:90 timed out
      
      Change wmi_mgmt_tx_work to another queue workqueue_aux of ath11k_base,
      then connection success.
      
      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/20220428023320.4007-1-quic_wgong@quicinc.com
      3a597f0d
    • Wen Gong's avatar
      ath11k: fix warning of not found station for bssid in message · 7330e1ec
      Wen Gong authored
      When test connect/disconnect to an AP frequently with WCN6855, sometimes
      it show below log.
      
      [  277.040121] wls1: deauthenticating from 8c:21:0a:b3:5a:64 by local choice (Reason: 3=DEAUTH_LEAVING)
      [  277.050906] ath11k_pci 0000:05:00.0: wmi stats vdev id 0 mac 00:03:7f:29:61:11
      [  277.050944] ath11k_pci 0000:05:00.0: wmi stats bssid 8c:21:0a:b3:5a:64 vif         pK-error
      [  277.050954] ath11k_pci 0000:05:00.0: not found station for bssid 8c:21:0a:b3:5a:64
      [  277.050961] ath11k_pci 0000:05:00.0: failed to parse rssi chain -71
      [  277.050967] ath11k_pci 0000:05:00.0: failed to pull fw stats: -71
      [  277.050976] ath11k_pci 0000:05:00.0: wmi stats vdev id 0 mac 00:03:7f:29:61:11
      [  277.050983] ath11k_pci 0000:05:00.0: wmi stats bssid 8c:21:0a:b3:5a:64 vif         pK-error
      [  277.050989] ath11k_pci 0000:05:00.0: not found station for bssid 8c:21:0a:b3:5a:64
      [  277.050995] ath11k_pci 0000:05:00.0: failed to parse rssi chain -71
      [  277.051000] ath11k_pci 0000:05:00.0: failed to pull fw stats: -71
      [  278.064050] ath11k_pci 0000:05:00.0: failed to request fw stats: -110
      
      Reason is:
      When running disconnect operation, sta_info removed from local->sta_hash
      by __sta_info_destroy_part1() from __sta_info_flush(), after this,
      ieee80211_find_sta_by_ifaddr() which called by
      ath11k_wmi_tlv_fw_stats_data_parse() and ath11k_wmi_tlv_rssi_chain_parse()
      cannot find this station, then failed log printed.
      
      steps are like this:
      1. when disconnect from AP, __sta_info_destroy() called __sta_info_destroy_part1()
      and __sta_info_destroy_part2().
      
      2. in __sta_info_destroy_part1(),  it has "sta_info_hash_del(local, sta)"
      and "list_del_rcu(&sta->list)", it will remove the ieee80211_sta from the
      list of ieee80211_hw.
      
      3. in __sta_info_destroy_part2(), it called drv_sta_state()->ath11k_mac_op_sta_state(),
      then peer->sta is clear at this moment.
      
      4. in __sta_info_destroy_part2(), it then called sta_set_sinfo()->drv_sta_statistics()
      ->ath11k_mac_op_sta_statistics(), then WMI_REQUEST_STATS_CMDID sent to firmware.
      
      5. WMI_UPDATE_STATS_EVENTID reported from firmware, at this moment, the
      ieee80211_sta can not be found again because it has remove from list in
      step2 and also peer->sta is clear in step3.
      
      6. in __sta_info_destroy_part2(), it then called cleanup_single_sta()->
      sta_info_free()->kfree(sta), at this moment, the ieee80211_sta is freed
      in memory, then the failed log will not happen because function
      ath11k_mac_op_sta_state() will not be called.
      
      Actually this print log is not a real error, it is only to skip parse the
      info, so change to skip print by default debug setting.
      
      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/20220428022426.2927-1-quic_wgong@quicinc.com
      7330e1ec
  3. 01 May, 2022 4 commits
  4. 29 Apr, 2022 4 commits
    • Baochen Qiang's avatar
      ath11k: Don't use GFP_KERNEL in atomic context · eee645ec
      Baochen Qiang authored
      We are seeing below warning:
      ...
      kernel: [ 5720.362941] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:197
      kernel: [ 5720.362943] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/4
      kernel: [ 5720.362947] CPU: 4 PID: 0 Comm: swapper/4 Tainted: G        W         5.10.90 #18 4fa489e3e5c16043994f416310c2f60eff666320
      kernel: [ 5720.362949] Hardware name: Google Nipperkin/Nipperkin, BIOS Google_Nipperkin.14316.0.0 10/30/2021
      kernel: [ 5720.362950] Call Trace:
      kernel: [ 5720.362953]  <IRQ>
      kernel: [ 5720.362959]  dump_stack+0x9c/0xe7
      kernel: [ 5720.362964]  ___might_sleep+0x14a/0x160
      kernel: [ 5720.362967]  kmem_cache_alloc+0x46/0x226
      kernel: [ 5720.362970]  ? __alloc_skb+0x6c/0x19e
      kernel: [ 5720.362972]  __alloc_skb+0x6c/0x19e
      kernel: [ 5720.362985]  cfg80211_gtk_rekey_notify+0xa2/0x21d [cfg80211 2c8b5aee0416e7d010d70c332a47990fc843c1c5]
      kernel: [ 5720.362995]  ath11k_wmi_gtk_offload_status_event+0x102/0x155 [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838]
      kernel: [ 5720.363002]  ath11k_wmi_tlv_op_rx+0x301/0x51b [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838]
      kernel: [ 5720.363009]  ath11k_htc_rx_completion_handler+0xee/0x3f5 [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838]
      kernel: [ 5720.363017]  ath11k_ce_per_engine_service+0x2aa/0x32c [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838]
      kernel: [ 5720.363024]  ath11k_pci_ce_tasklet+0x1a/0x30 [ath11k_pci 9acc399855ea172aa14a892c0bfdba0ce22d6f07]
      kernel: [ 5720.363028]  tasklet_action_common+0x8d/0x9f
      kernel: [ 5720.363032]  __do_softirq+0x163/0x29a
      kernel: [ 5720.363035]  asm_call_irq_on_stack+0x12/0x20
      kernel: [ 5720.363037]  </IRQ>
      kernel: [ 5720.363041]  do_softirq_own_stack+0x3c/0x48
      kernel: [ 5720.363043]  __irq_exit_rcu+0x9b/0x9d
      kernel: [ 5720.363046]  common_interrupt+0xc9/0x14d
      kernel: [ 5720.363049]  asm_common_interrupt+0x1e/0x40
      kernel: [ 5720.363054] RIP: 0010:cpuidle_enter_state+0x1c5/0x2ac
      kernel: [ 5720.363056] Code: 84 f6 4c 8b 75 c0 74 1e 48 c7 45 c8 00 00 00 00 9c 8f 45 c8 0f ba 65 c8 09 0f 82 d1 00 00 00 31 ff e8 4a bb 6c ff fb 45 85 e4 <78> 47 44 89 e0 48 6b d0 68 49 8b 4c 16 48 48 2b 5d b8 49 89 5d 18
      kernel: [ 5720.363058] RSP: 0018:ffffa7e640157e78 EFLAGS: 00000206
      kernel: [ 5720.363060] RAX: ffff9807ddf29b40 RBX: 00000533e033584c RCX: 00000533e033584c
      kernel: [ 5720.363062] RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000000
      kernel: [ 5720.363063] RBP: ffffa7e640157ec0 R08: 0000000000000002 R09: 00000533e171bb7a
      kernel: [ 5720.363064] R10: 0000000000000900 R11: fffffffffffffffe R12: 0000000000000003
      kernel: [ 5720.363065] R13: ffff9804c2ef6000 R14: ffffffffbe9a7bd0 R15: 0000000000000003
      kernel: [ 5720.363069]  ? cpuidle_enter_state+0x19a/0x2ac
      kernel: [ 5720.363072]  cpuidle_enter+0x2e/0x3d
      kernel: [ 5720.363074]  do_idle+0x163/0x1ee
      kernel: [ 5720.363076]  cpu_startup_entry+0x1d/0x1f
      kernel: [ 5720.363078]  secondary_startup_64_no_verify+0xb1/0xbb
      ...
      
      This is because GFP_KERNEL is used by ath11k_wmi_gtk_offload_status_event
      while in atomic context. Fix it by using GFP_ATOMIC instead.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
      
      Fixes: a16d9b50 ("ath11k: support GTK rekey offload")
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220427120033.1046759-1-quic_bqiang@quicinc.com
      eee645ec
    • Abhishek Kumar's avatar
      ath10k: skip ath10k_halt during suspend for driver state RESTARTING · b72a4aff
      Abhishek Kumar authored
      Double free crash is observed when FW recovery(caused by wmi
      timeout/crash) is followed by immediate suspend event. The FW recovery
      is triggered by ath10k_core_restart() which calls driver clean up via
      ath10k_halt(). When the suspend event occurs between the FW recovery,
      the restart worker thread is put into frozen state until suspend completes.
      The suspend event triggers ath10k_stop() which again triggers ath10k_halt()
      The double invocation of ath10k_halt() causes ath10k_htt_rx_free() to be
      called twice(Note: ath10k_htt_rx_alloc was not called by restart worker
      thread because of its frozen state), causing the crash.
      
      To fix this, during the suspend flow, skip call to ath10k_halt() in
      ath10k_stop() when the current driver state is ATH10K_STATE_RESTARTING.
      Also, for driver state ATH10K_STATE_RESTARTING, call
      ath10k_wait_for_suspend() in ath10k_stop(). This is because call to
      ath10k_wait_for_suspend() is skipped later in
      [ath10k_halt() > ath10k_core_stop()] for the driver state
      ATH10K_STATE_RESTARTING.
      
      The frozen restart worker thread will be cancelled during resume when the
      device comes out of suspend.
      
      Below is the crash stack for reference:
      
      [  428.469167] ------------[ cut here ]------------
      [  428.469180] kernel BUG at mm/slub.c:4150!
      [  428.469193] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
      [  428.469219] Workqueue: events_unbound async_run_entry_fn
      [  428.469230] RIP: 0010:kfree+0x319/0x31b
      [  428.469241] RSP: 0018:ffffa1fac015fc30 EFLAGS: 00010246
      [  428.469247] RAX: ffffedb10419d108 RBX: ffff8c05262b0000
      [  428.469252] RDX: ffff8c04a8c07000 RSI: 0000000000000000
      [  428.469256] RBP: ffffa1fac015fc78 R08: 0000000000000000
      [  428.469276] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  428.469285] Call Trace:
      [  428.469295]  ? dma_free_attrs+0x5f/0x7d
      [  428.469320]  ath10k_core_stop+0x5b/0x6f
      [  428.469336]  ath10k_halt+0x126/0x177
      [  428.469352]  ath10k_stop+0x41/0x7e
      [  428.469387]  drv_stop+0x88/0x10e
      [  428.469410]  __ieee80211_suspend+0x297/0x411
      [  428.469441]  rdev_suspend+0x6e/0xd0
      [  428.469462]  wiphy_suspend+0xb1/0x105
      [  428.469483]  ? name_show+0x2d/0x2d
      [  428.469490]  dpm_run_callback+0x8c/0x126
      [  428.469511]  ? name_show+0x2d/0x2d
      [  428.469517]  __device_suspend+0x2e7/0x41b
      [  428.469523]  async_suspend+0x1f/0x93
      [  428.469529]  async_run_entry_fn+0x3d/0xd1
      [  428.469535]  process_one_work+0x1b1/0x329
      [  428.469541]  worker_thread+0x213/0x372
      [  428.469547]  kthread+0x150/0x15f
      [  428.469552]  ? pr_cont_work+0x58/0x58
      [  428.469558]  ? kthread_blkcg+0x31/0x31
      
      Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00288-QCARMSWPZ-1
      Co-developed-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarAbhishek Kumar <kuabhs@chromium.org>
      Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220426221859.v2.1.I650b809482e1af8d0156ed88b5dc2677a0711d46@changeid
      b72a4aff
    • Wan Jiabing's avatar
      2950833f
    • Yang Li's avatar
      rtw89: remove unneeded semicolon · 11dc130b
      Yang Li authored
      Eliminate the following coccicheck warning:
      ./drivers/net/wireless/realtek/rtw89/rtw8852c.c:2556:2-3: Unneeded
      semicolon
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
      Acked-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://lore.kernel.org/r/20220427003142.107916-1-yang.lee@linux.alibaba.com
      11dc130b
  5. 27 Apr, 2022 7 commits
    • Wan Jiabing's avatar
      wil6210: simplify if-if to if-else · a5f3aed5
      Wan Jiabing authored
      Use if and else instead of if(A) and if (!A).
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220424094552.105466-1-wanjiabing@vivo.com
      a5f3aed5
    • Wan Jiabing's avatar
      ath10k: simplify if-if to if-else · 7471f7d2
      Wan Jiabing authored
      Use if and else instead of if(A) and if (!A).
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220424094522.105262-1-wanjiabing@vivo.com
      7471f7d2
    • Wen Gong's avatar
      ath11k: read country code from SMBIOS for WCN6855/QCA6390 · 66721bb4
      Wen Gong authored
      This read the country code from SMBIOS and send the country code
      to firmware, firmware will indicate the regulatory domain info of the
      country code and then ath11k will use the info.
      
      dmesg:
      [ 1242.637173] ath11k_pci 0000:02:00.0: chip_id 0x2 chip_family 0xb board_id 0xff soc_id 0x400c0200
      [ 1242.637176] ath11k_pci 0000:02:00.0: fw_version 0x110b09e5 fw_build_timestamp 2021-06-22 09:32 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HSP.1.1-02533-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      [ 1242.637253] ath11k_pci 0000:02:00.0: worldwide regdomain setting from SMBIOS
      [ 1242.637259] ath11k_pci 0000:02:00.0: bdf variant name not found.
      [ 1242.637261] ath11k_pci 0000:02:00.0: SMBIOS bdf variant name not set.
      [ 1242.637263] ath11k_pci 0000:02:00.0: DT bdf variant name not set.
      [ 1242.927543] ath11k_pci 0000:02:00.0: set current country pdev id 0 alpha2 00
      
      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/20220421023501.32167-1-quic_wgong@quicinc.com
      66721bb4
    • Hari Chandrakanthan's avatar
      ath11k: disable spectral scan during spectral deinit · 161c64de
      Hari Chandrakanthan authored
      When ath11k modules are removed using rmmod with spectral scan enabled,
      crash is observed. Different crash trace is observed for each crash.
      
      Send spectral scan disable WMI command to firmware before cleaning
      the spectral dbring in the spectral_deinit API to avoid this crash.
      
      call trace from one of the crash observed:
      [ 1252.880802] Unable to handle kernel NULL pointer dereference at virtual address 00000008
      [ 1252.882722] pgd = 0f42e886
      [ 1252.890955] [00000008] *pgd=00000000
      [ 1252.893478] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      [ 1253.093035] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.89 #0
      [ 1253.115261] Hardware name: Generic DT based system
      [ 1253.121149] PC is at ath11k_spectral_process_data+0x434/0x574 [ath11k]
      [ 1253.125940] LR is at 0x88e31017
      [ 1253.132448] pc : [<7f9387b8>]    lr : [<88e31017>]    psr: a0000193
      [ 1253.135488] sp : 80d01bc8  ip : 00000001  fp : 970e0000
      [ 1253.141737] r10: 88e31000  r9 : 970ec000  r8 : 00000080
      [ 1253.146946] r7 : 94734040  r6 : a0000113  r5 : 00000057  r4 : 00000000
      [ 1253.152159] r3 : e18cb694  r2 : 00000217  r1 : 1df1f000  r0 : 00000001
      [ 1253.158755] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [ 1253.165266] Control: 10c0383d  Table: 5e71006a  DAC: 00000055
      [ 1253.172472] Process swapper/0 (pid: 0, stack limit = 0x60870141)
      [ 1253.458055] [<7f9387b8>] (ath11k_spectral_process_data [ath11k]) from [<7f917fdc>] (ath11k_dbring_buffer_release_event+0x214/0x2e4 [ath11k])
      [ 1253.466139] [<7f917fdc>] (ath11k_dbring_buffer_release_event [ath11k]) from [<7f8ea3c4>] (ath11k_wmi_tlv_op_rx+0x1840/0x29cc [ath11k])
      [ 1253.478807] [<7f8ea3c4>] (ath11k_wmi_tlv_op_rx [ath11k]) from [<7f8fe868>] (ath11k_htc_rx_completion_handler+0x180/0x4e0 [ath11k])
      [ 1253.490699] [<7f8fe868>] (ath11k_htc_rx_completion_handler [ath11k]) from [<7f91308c>] (ath11k_ce_per_engine_service+0x2c4/0x3b4 [ath11k])
      [ 1253.502386] [<7f91308c>] (ath11k_ce_per_engine_service [ath11k]) from [<7f9a4198>] (ath11k_pci_ce_tasklet+0x28/0x80 [ath11k_pci])
      [ 1253.514811] [<7f9a4198>] (ath11k_pci_ce_tasklet [ath11k_pci]) from [<8032227c>] (tasklet_action_common.constprop.2+0x64/0xe8)
      [ 1253.526476] [<8032227c>] (tasklet_action_common.constprop.2) from [<803021e8>] (__do_softirq+0x130/0x2d0)
      [ 1253.537756] [<803021e8>] (__do_softirq) from [<80322610>] (irq_exit+0xcc/0xe8)
      [ 1253.547304] [<80322610>] (irq_exit) from [<8036a4a4>] (__handle_domain_irq+0x60/0xb4)
      [ 1253.554428] [<8036a4a4>] (__handle_domain_irq) from [<805eb348>] (gic_handle_irq+0x4c/0x90)
      [ 1253.562321] [<805eb348>] (gic_handle_irq) from [<80301a78>] (__irq_svc+0x58/0x8c)
      
      Tested-on: QCN6122 hw1.0 AHB WLAN.HK.2.6.0.1-00851-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarHari Chandrakanthan <quic_haric@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/1649396345-349-1-git-send-email-quic_haric@quicinc.com
      161c64de
    • Manikanta Pubbisetty's avatar
      ath11k: Update WBM idle ring HP after FW mode on · 33b67a4b
      Manikanta Pubbisetty authored
      Currently, WBM idle ring HP is updated much before the shadow
      configuration is sent to the FW. Any update to the shadow
      registers before FW mode on request would not be reflected
      on to the actual HW registers failing to bring up the device.
      Send FW mode ON QMI request before WBM idle ring HP update
      to fix this problem.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220406094107.17878-12-quic_mpubbise@quicinc.com
      33b67a4b
    • Manikanta Pubbisetty's avatar
      ath11k: WMI changes to support WCN6750 · 95959d70
      Manikanta Pubbisetty authored
      WCN6750 is a single PDEV non-DBS chip which supports 2G, 5G and 6G bands.
      It is a single LMAC device which can be either hooked to 2G/5G/6G bands.
      Add WMI changes to support WCN6750.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220406094107.17878-11-quic_mpubbise@quicinc.com
      95959d70
    • Manikanta Pubbisetty's avatar
      ath11k: Do not put HW in DBS mode for WCN6750 · b6f63010
      Manikanta Pubbisetty authored
      Though WCN6750 is a single PDEV device, it is not a
      DBS solution. So, do not put HW in DBS mode for WCN6750.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220406094107.17878-10-quic_mpubbise@quicinc.com
      b6f63010