1. 13 Mar, 2023 1 commit
  2. 01 Mar, 2023 1 commit
  3. 27 Feb, 2023 5 commits
  4. 24 Feb, 2023 2 commits
  5. 22 Feb, 2023 8 commits
    • Christian Marangi's avatar
      wifi: ath11k: fix SAC bug on peer addition with sta band migration · 60b7d62b
      Christian Marangi authored
      Fix sleep in atomic context warning detected by Smatch static checker
      analyzer.
      
      Following the locking pattern for peer_rhash_add lock tbl_mtx_lock mutex
      always even if sta is not transitioning to another band.
      This is peer_add function and a more secure locking should not cause
      performance regression.
      
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1
      
      Fixes: d673cb6f ("wifi: ath11k: fix peer addition/deletion error on sta band migration")
      Reported-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20230209222622.1751-1-ansuelsmth@gmail.com
      60b7d62b
    • Jiapeng Chong's avatar
      wifi: ath10k: Remove redundant assignment to changed_flags · 7c4c511f
      Jiapeng Chong authored
      Variable changed_flags is assigned, but is not effectively used, so
      delete it.
      
      drivers/net/wireless/ath/ath10k/mac.c:6024:22: warning: parameter 'changed_flags' set but not used.
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3963Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20230207052410.26337-1-jiapeng.chong@linux.alibaba.com
      7c4c511f
    • Abhishek Kumar's avatar
      wifi: ath10k: snoc: enable threaded napi on WCN3990 · 8c68fe00
      Abhishek Kumar authored
      NAPI poll can be done in threaded context along with soft irq
      context. Threaded context can be scheduled efficiently, thus
      creating less of bottleneck during Rx processing. This patch is
      to enable threaded NAPI on ath10k driver.
      
      Based on testing, it was observed that on WCN3990, the CPU0 reaches
      100% utilization when napi runs in softirq context. At the same
      time the other CPUs are at low consumption percentage. This
      does not allow device to reach its maximum throughput potential.
      After enabling threaded napi, CPU load is balanced across all CPUs
      and following improvments were observed:
      - UDP_RX increase by ~22-25%
      - TCP_RX increase by ~15%
      
      Here are some of the additional raw data with and without threaded napi:
      ==================================================
      udp_rx(Without threaded NAPI)
      435.98+-5.16 : Channel 44
      439.06+-0.66 : Channel 157
      
      udp_rx(With threaded NAPI)
      509.73+-41.03 : Channel 44
      549.97+-7.62 : Channel 157
      ===================================================
      udp_tx(Without threaded NAPI)
      461.31+-0.69  : Channel 44
      461.46+-0.78 : Channel 157
      
      udp_tx(With threaded NAPI)
      459.20+-0.77 : Channel 44
      459.78+-1.08 : Channel 157
      ===================================================
      tcp_rx(Without threaded NAPI)
      472.63+-2.35 : Channel 44
      469.29+-6.31 : Channel 157
      
      tcp_rx(With threaded NAPI)
      498.49+-2.44 : Channel 44
      541.14+-40.65 : Channel 157
      ===================================================
      tcp_tx(Without threaded NAPI)
      317.34+-2.37 : Channel 44
      317.01+-2.56 : Channel 157
      
      tcp_tx(With threaded NAPI)
      371.34+-2.36 : Channel 44
      376.95+-9.40 : Channel 157
      ===================================================
      
      Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1
      Signed-off-by: default avatarAbhishek Kumar <kuabhs@chromium.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20230203000116.v2.1.I5bb9c164a2d2025655dee810b983e01ecd81c14e@changeid
      8c68fe00
    • Dan Carpenter's avatar
      wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list() · 4c856ee1
      Dan Carpenter authored
      This loop checks that i < max at the start of loop but then it does
      i++ which could put it past the end of the array.  It's harmless to
      check again and prevent a potential out of bounds.
      
      Fixes: 1048643e ("ath5k: Clean up eeprom parsing and add missing calibration data")
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Reviewed-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/Y+D9hPQrHfWBJhXz@kili
      4c856ee1
    • Douglas Anderson's avatar
      wifi: ath5k: Use platform_get_irq() to get the interrupt · 95c95251
      Douglas Anderson authored
      As of commit a1a2b712 ("of/platform: Drop static setup of IRQ
      resource from DT core"), we need to use platform_get_irq() instead of
      platform_get_resource() to get our IRQs because
      platform_get_resource() simply won't get them anymore.
      
      This was already fixed in several other Atheros WiFi drivers,
      apparently in response to Zeal Robot reports. An example of another
      fix is commit 9503a1fc ("ath9k: Use platform_get_irq() to get the
      interrupt"). ath5k seems to have been missed in this effort, though.
      
      Fixes: a1a2b712 ("of/platform: Drop static setup of IRQ resource from DT core")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20230201084131.v2.2.Ic4f8542b0588d7eb4bc6e322d4af3d2064e84ff0@changeid
      95c95251
    • Douglas Anderson's avatar
      wifi: ath11k: Use platform_get_irq() to get the interrupt · f1172766
      Douglas Anderson authored
      As of commit a1a2b712 ("of/platform: Drop static setup of IRQ
      resource from DT core"), we need to use platform_get_irq() instead of
      platform_get_resource() to get our IRQs because
      platform_get_resource() simply won't get them anymore.
      
      This was already fixed in several other Atheros WiFi drivers,
      apparently in response to Zeal Robot reports. An example of another
      fix is commit 9503a1fc ("ath9k: Use platform_get_irq() to get the
      interrupt"). ath11k seems to have been missed in this effort, though.
      
      Without this change, WiFi wasn't coming up on my Qualcomm sc7280-based
      hardware. Specifically, "platform_get_resource(pdev, IORESOURCE_IRQ,
      i)" was failing even for i=0.
      
      Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
      
      Fixes: a1a2b712 ("of/platform: Drop static setup of IRQ resource from DT core")
      Fixes: 00402f49 ("ath11k: Add support for WCN6750 device")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarJun Yu <junyuu@chromium.org>
      Reviewed-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20230201084131.v2.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid
      f1172766
    • 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
  6. 20 Feb, 2023 3 commits
  7. 17 Feb, 2023 7 commits
  8. 15 Feb, 2023 10 commits
  9. 14 Feb, 2023 3 commits
    • Johannes Berg's avatar
      wifi: mac80211: fix off-by-one link setting · cf08e29d
      Johannes Berg authored
      The convention for find_first_bit() is 0-based, while ffs()
      is 1-based, so this is now off-by-one. I cannot reproduce the
      gcc-9 problem, but since the -1 is now removed, I'm hoping it
      will still avoid the original issue.
      Reported-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Fixes: 1d8d4af4 ("wifi: mac80211: avoid u32_encode_bits() warning")
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      cf08e29d
    • Gilad Itzkovitch's avatar
      wifi: mac80211: Fix for Rx fragmented action frames · e6f5dcb7
      Gilad Itzkovitch authored
      The ieee80211_accept_frame() function performs a number of early checks
      to decide whether or not further processing needs to be done on a frame.
      One of those checks is the ieee80211_is_robust_mgmt_frame() function.
      It requires to peek into the frame payload, but because defragmentation
      does not occur until later on in the receive path, this peek is invalid
      for any fragment other than the first one. Also, in this scenario there
      is no STA and so the fragmented frame will be dropped later on in the
      process and will not reach the upper stack. This can happen with large
      action frames at low rates, for example, we see issues with DPP on S1G.
      
      This change will only check if the frame is robust if it's the first
      fragment. Invalid fragmented packets will be discarded later after
      defragmentation is completed.
      Signed-off-by: default avatarGilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
      Link: https://lore.kernel.org/r/20221124005336.1618411-1-gilad.itzkovitch@morsemicro.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      e6f5dcb7
    • Arnd Bergmann's avatar
      wifi: mac80211: avoid u32_encode_bits() warning · 1d8d4af4
      Arnd Bergmann authored
      gcc-9 triggers a false-postive warning in ieee80211_mlo_multicast_tx()
      for u32_encode_bits(ffs(links) - 1, ...), since ffs() can return zero
      on an empty bitmask, and the negative argument to u32_encode_bits()
      is then out of range:
      
      In file included from include/linux/ieee80211.h:21,
                       from include/net/cfg80211.h:23,
                       from net/mac80211/tx.c:23:
      In function 'u32_encode_bits',
          inlined from 'ieee80211_mlo_multicast_tx' at net/mac80211/tx.c:4437:17,
          inlined from 'ieee80211_subif_start_xmit' at net/mac80211/tx.c:4485:3:
      include/linux/bitfield.h:177:3: error: call to '__field_overflow' declared with attribute error: value doesn't fit into mask
        177 |   __field_overflow();     \
            |   ^~~~~~~~~~~~~~~~~~
      include/linux/bitfield.h:197:2: note: in expansion of macro '____MAKE_OP'
        197 |  ____MAKE_OP(u##size,u##size,,)
            |  ^~~~~~~~~~~
      include/linux/bitfield.h:200:1: note: in expansion of macro '__MAKE_OP'
        200 | __MAKE_OP(32)
            | ^~~~~~~~~
      
      Newer compiler versions do not cause problems with the zero argument
      because they do not consider this a __builtin_constant_p().
      It's also harmless since the hweight16() check already guarantees
      that this cannot be 0.
      
      Replace the ffs() with an equivalent find_first_bit() check that
      matches the later for_each_set_bit() style and avoids the warning.
      
      Fixes: 963d0e8d ("wifi: mac80211: optionally implement MLO multicast TX")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20230214132025.1532147-1-arnd@kernel.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      1d8d4af4