1. 22 Feb, 2023 2 commits
    • Ramya Gnanasekar's avatar
      wifi: ath12k: PCI ops for wakeup/release MHI · 80e39658
      Ramya Gnanasekar authored
      Wakeup/release MHI is not needed before pci_read/write for QCN9274.
      Since wakeup & release MHI is enabled for all QCN9274 and
      WCN7850, below MHI assert is seen in QCN9274
      
      [  784.906613] BUG: sleeping function called from invalid context at drivers/bus/mhi/host/pm.c:989
      [  784.906633] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/3
      [  784.906637] preempt_count: 503, expected: 0
      [  784.906641] RCU nest depth: 0, expected: 0
      [  784.906644] 2 locks held by swapper/3/0:
      [  784.906646]  #0: ffff8ed348e429e0 (&ab->ce.ce_lock){+.-.}-{2:2}, at: ath12k_ce_recv_process_cb+0xb3/0x2f0 [ath12k]
      [  784.906664]  #1: ffff8ed348e491f0 (&srng->lock_key#3){+.-.}-{2:2}, at: ath12k_ce_recv_process_cb+0xfb/0x2f0 [ath12k]
      [  784.906678] Preemption disabled at:
      [  784.906680] [<0000000000000000>] 0x0
      [  784.906686] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G        W  O       6.1.0-rc2+ #3
      [  784.906688] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0056.2019.0506.1527 05/06/2019
      [  784.906690] Call Trace:
      [  784.906691]  <IRQ>
      [  784.906693]  dump_stack_lvl+0x56/0x7b
      [  784.906698]  __might_resched+0x21c/0x270
      [  784.906704]  __mhi_device_get_sync+0x7d/0x1c0 [mhi]
      [  784.906714]  mhi_device_get_sync+0xd/0x20 [mhi]
      [  784.906719]  ath12k_pci_write32+0x75/0x170 [ath12k]
      [  784.906729]  ath12k_hal_srng_access_end+0x55/0xc0 [ath12k]
      [  784.906737]  ath12k_ce_recv_process_cb+0x1f3/0x2f0 [ath12k]
      [  784.906776]  ? ath12k_pci_ce_tasklet+0x11/0x30 [ath12k]
      [  784.906788]  ath12k_pci_ce_tasklet+0x11/0x30 [ath12k]
      [  784.906813]  tasklet_action_common.isra.18+0xb7/0xe0
      [  784.906820]  __do_softirq+0xd0/0x4c9
      [  784.906826]  irq_exit_rcu+0x88/0xe0
      [  784.906828]  common_interrupt+0xa5/0xc0
      [  784.906831]  </IRQ>
      [  784.906832]  <TASK>
      
      Adding function callbacks for MHI wakeup and release operations.
      QCN9274 does not need wakeup/release, function callbacks are initialized
      to NULL. In case of WCN7850, shadow registers are used to access rings.
      Since, shadow register's offset is less than ACCESS_ALWAYS_OFF,
      mhi_device_get_sync() or mhi_device_put() to wakeup
      and release mhi will not be called during service ring accesses.
      
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Signed-off-by: default avatarRamya Gnanasekar <quic_rgnanase@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20230123095141.5310-1-quic_rgnanase@quicinc.com
      80e39658
    • Ramya Gnanasekar's avatar
      wifi: ath12k: Handle lock during peer_id find · 95a389e2
      Ramya Gnanasekar authored
      ath12k_peer_find_by_id() requires that the caller hold the
      ab->base_lock. Currently the WBM error path does not hold
      the lock and calling that function, leads to the
      following lockdep_assert()in QCN9274:
      
      [105162.160893] ------------[ cut here ]------------
      [105162.160916] WARNING: CPU: 3 PID: 0 at drivers/net/wireless/ath/ath12k/peer.c:71 ath12k_peer_find_by_id+0x52/0x60 [ath12k]
      [105162.160933] Modules linked in: ath12k(O) qrtr_mhi qrtr mac80211 cfg80211 mhi qmi_helpers libarc4 nvme nvme_core [last unloaded: ath12k(O)]
      [105162.160967] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G        W  O       6.1.0-rc2+ #3
      [105162.160972] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0056.2019.0506.1527 05/06/2019
      [105162.160977] RIP: 0010:ath12k_peer_find_by_id+0x52/0x60 [ath12k]
      [105162.160990] Code: 07 eb 0f 39 68 24 74 0a 48 8b 00 48 39 f8 75 f3 31 c0 5b 5d c3 48 8d bf b0 f2 00 00 be ff ff ff ff e8 22 20 c4 e2 85 c0 75 bf <0f> 0b eb bb 66 2e 0f 1f 84 00 00 00 00 00 41 54 4c 8d a7 98 f2 00
      [105162.160996] RSP: 0018:ffffa223001acc60 EFLAGS: 00010246
      [105162.161003] RAX: 0000000000000000 RBX: ffff9f0573940000 RCX: 0000000000000000
      [105162.161008] RDX: 0000000000000001 RSI: ffffffffa3951c8e RDI: ffffffffa39a96d7
      [105162.161013] RBP: 000000000000000a R08: 0000000000000000 R09: 0000000000000000
      [105162.161017] R10: ffffa223001acb40 R11: ffffffffa3d57c60 R12: ffff9f057394f2e0
      [105162.161022] R13: ffff9f0573940000 R14: ffff9f04ecd659c0 R15: ffff9f04d5a9b040
      [105162.161026] FS:  0000000000000000(0000) GS:ffff9f0575600000(0000) knlGS:0000000000000000
      [105162.161031] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [105162.161036] CR2: 00001d5c8277a008 CR3: 00000001e6224006 CR4: 00000000003706e0
      [105162.161041] Call Trace:
      [105162.161046]  <IRQ>
      [105162.161051]  ath12k_dp_rx_process_wbm_err+0x6da/0xaf0 [ath12k]
      [105162.161072]  ? ath12k_dp_rx_process_err+0x80e/0x15a0 [ath12k]
      [105162.161084]  ? __lock_acquire+0x4ca/0x1a60
      [105162.161104]  ath12k_dp_service_srng+0x263/0x310 [ath12k]
      [105162.161120]  ath12k_pci_ext_grp_napi_poll+0x1c/0x70 [ath12k]
      [105162.161133]  __napi_poll+0x22/0x260
      [105162.161141]  net_rx_action+0x2f8/0x380
      [105162.161153]  __do_softirq+0xd0/0x4c9
      [105162.161162]  irq_exit_rcu+0x88/0xe0
      [105162.161169]  common_interrupt+0xa5/0xc0
      [105162.161174]  </IRQ>
      [105162.161179]  <TASK>
      [105162.161184]  asm_common_interrupt+0x22/0x40
      
      Handle spin lock/unlock in WBM error path to hold the necessary lock
      expected by ath12k_peer_find_by_id().
      
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarRamya Gnanasekar <quic_rgnanase@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20230122014936.3594-1-quic_rgnanase@quicinc.com
      95a389e2
  2. 20 Feb, 2023 3 commits
  3. 17 Feb, 2023 7 commits
  4. 15 Feb, 2023 10 commits
  5. 14 Feb, 2023 18 commits