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