1. 23 Mar, 2022 7 commits
    • 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
  2. 21 Mar, 2022 4 commits
  3. 18 Mar, 2022 8 commits
  4. 13 Mar, 2022 14 commits
  5. 12 Mar, 2022 7 commits