1. 12 Apr, 2022 3 commits
  2. 06 Apr, 2022 28 commits
  3. 05 Apr, 2022 9 commits
    • Johannes Berg's avatar
      net: ensure net_todo_list is processed quickly · 0b5c21bb
      Johannes Berg authored
      In [1], Will raised a potential issue that the cfg80211 code,
      which does (from a locking perspective)
      
        rtnl_lock()
        wiphy_lock()
        rtnl_unlock()
      
      might be suspectible to ABBA deadlocks, because rtnl_unlock()
      calls netdev_run_todo(), which might end up calling rtnl_lock()
      again, which could then deadlock (see the comment in the code
      added here for the scenario).
      
      Some back and forth and thinking ensued, but clearly this can't
      happen if the net_todo_list is empty at the rtnl_unlock() here.
      Clearly, the code here cannot actually put an entry on it, and
      all other users of rtnl_unlock() will empty it since that will
      always go through netdev_run_todo(), emptying the list.
      
      So the only other way to get there would be to add to the list
      and then unlock the RTNL without going through rtnl_unlock(),
      which is only possible through __rtnl_unlock(). However, this
      isn't exported and not used in many places, and none of them
      seem to be able to unregister before using it.
      
      Therefore, add a WARN_ON() in the code to ensure this invariant
      won't be broken, so that the cfg80211 (or any similar) code
      stays safe.
      
      [1] https://lore.kernel.org/r/Yjzpo3TfZxtKPMAG@google.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Link: https://lore.kernel.org/r/20220404113847.0ee02e4a70da.Ic73d206e217db20fd22dcec14fe5442ca732804b@changeidSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0b5c21bb
    • Tom Rix's avatar
      mlxsw: spectrum_router: simplify list unwinding · 6f2f36e5
      Tom Rix authored
      The setting of i here
      err_nexthop6_group_get:
      	i = nrt6;
      Is redundant, i is already nrt6.  So remove
      this statement.
      
      The for loop for the unwinding
      err_rt6_create:
      	for (i--; i >= 0; i--) {
      Is equivelent to
      	for (; i > 0; i--) {
      
      Two consecutive labels can be reduced to one.
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Link: https://lore.kernel.org/r/20220402121516.2750284-1-trix@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6f2f36e5
    • Nagarajan Maran's avatar
      ath11k: fix driver initialization failure with WoW unsupported hw · 633469e3
      Nagarajan Maran authored
      In the "ath11k_wow_init", error value "EINVAL" is returned
      when the check for firmware support of WoW feature fails,
      which in turn stops the driver initialization.
      
      Warning message:
      [   31.040144] ------------[ cut here ]------------
      [   31.040185] WARNING: CPU: 1 PID: 51 at drivers/net/wireless/ath/ath11k/wow.c:813 ath11k_wow_init+0xc8/0x13a8 [ath11k]
      [   31.043846] Modules linked in: ath11k_pci ath11k qmi_helpers
      [   31.054341] CPU: 1 PID: 51 Comm: kworker/u8:1 Tainted: G        W	5.17.0-wt-ath-594817-ga7f6aa925cf8-dirty #17
      [   31.060078] Hardware name: Qualcomm Technologies, Inc. IPQ8074/AP-HK10-C2 (DT)
      [   31.070578] Workqueue: ath11k_qmi_driver_event ath11k_qmi_driver_event_work [ath11k]
      [   31.077782] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   31.085676] pc : ath11k_wow_init+0xc8/0x13a8 [ath11k]
      [   31.092359] lr : ath11k_mac_register+0x548/0xb98 [ath11k]
      [   31.097567] sp : ffff80000aa13c40
      [   31.102944] x29: ffff80000aa13c40 x28: ffff800009184390 x27: ffff000002959f20
      [   31.106251] x26: ffff000002828000 x25: ffff000002830000 x24: ffff000002830000
      [   31.113369] x23: ffff000002820000 x22: ffff00000282854c x21: 0000000000000000
      [   31.120487] x20: ffff00000295cf20 x19: ffff000002828540 x18: 0000000000000031
      [   31.127605] x17: 0000000000000004 x16: ffff0000028285fc x15: ffff00000295b040
      [   31.134723] x14: 0000000000000067 x13: ffff00000282859c x12: 000000000000000d
      [   31.141840] x11: 0000000000000018 x10: 0000000000000004 x9 : 0000000000000000
      [   31.148959] x8 : ffff00000289d680 x7 : 0000000000000000 x6 : 000000000000003f
      [   31.156077] x5 : 0000000000000040 x4 : 0000000000000000 x3 : ffff000002820968
      [   31.163196] x2 : 0000000000000080 x1 : 0080008af9981779 x0 : ffff000002959f20
      [   31.170314] Call trace:
      [   31.177421]  ath11k_wow_init+0xc8/0x13a8 [ath11k]
      [   31.179684]  ath11k_core_qmi_firmware_ready+0x430/0x5e0 [ath11k]
      [   31.184548]  ath11k_qmi_driver_event_work+0x16c/0x4f8 [ath11k]
      [   31.190623]  process_one_work+0x134/0x350
      [   31.196262]  worker_thread+0x12c/0x450
      [   31.200340]  kthread+0xf4/0x110
      [   31.203986]  ret_from_fork+0x10/0x20
      [   31.207026] ---[ end trace 0000000000000000 ]---
      [   31.210894] ath11k_pci 0000:01:00.0: failed to init wow: -22
      [   31.215467] ath11k_pci 0000:01:00.0: failed register the radio with mac80211: -22
      [   31.221117] ath11k_pci 0000:01:00.0: failed to create pdev core: -22
      
      Fix this by returning value "0" when FW doesn't support WoW
      to allow driver to proceed with initialize sequence and also
      remove the unnecessary "WARN_ON".
      
      
      Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
      
      Fixes: ba9177fc ("ath11k: Add basic WoW functionalities")
      Signed-off-by: default avatarNagarajan Maran <quic_nmaran@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220331073110.3846-1-quic_nmaran@quicinc.com
      633469e3
    • Baochen Qiang's avatar
      ath11k: Remove unnecessary delay in ath11k_core_suspend · 2dd398de
      Baochen Qiang authored
      The intended delay in ath11k_core_suspend is introduced in commit
      d1b0c338 ("ath11k: implement suspend for QCA6390 PCI devices"),
      now with ath11k_mac_wait_tx_complete added in commit ba9177fc
      ("ath11k: Add basic WoW functionalities"), that delay is not
      necessary now, so remove it.
      
      This is found in code review.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-02431-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      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/20220331002105.1162099-1-quic_bqiang@quicinc.com
      2dd398de
    • Karthikeyan Kathirvel's avatar
      ath11k: Change max no of active probe SSID and BSSID to fw capability · 50dc9ce9
      Karthikeyan Kathirvel authored
      The maximum number of SSIDs in a for active probe requests is currently
      reported as 16 (WLAN_SCAN_PARAMS_MAX_SSID) when registering the driver.
      The scan_req_params structure only has the capacity to hold 10 SSIDs.
      This leads to a buffer overflow which can be triggered from
      wpa_supplicant in userspace. When copying the SSIDs into the
      scan_req_params structure in the ath11k_mac_op_hw_scan route, it can
      overwrite the extraie pointer.
      
      Firmware supports 16 ssid * 4 bssid, for each ssid 4 bssid combo probe
      request will be sent, so totally 64 probe requests supported. So
      set both max ssid and bssid to 16 and 4 respectively. Remove the
      redundant macros of ssid and bssid.
      
      Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01300-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarKarthikeyan Kathirvel <quic_kathirve@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://lore.kernel.org/r/20220329150221.21907-1-quic_kathirve@quicinc.com
      50dc9ce9
    • Manikanta Pubbisetty's avatar
      ath11k: Remove core PCI references from PCI common code · 5b32b6dd
      Manikanta Pubbisetty authored
      Remove core PCI and ath11k PCI references(struct ath11k_pci)
      from PCI common code. Since, PCI common code will be used
      by hybrid bus devices, this code should be independent
      from ATH11K PCI references and Linux core PCI references
      like struct pci_dev.
      
      Since this change introduces function callbacks for bus wakeup
      and bus release operations, wakeup_mhi HW param is no longer
      needed and hence it is removed completely. Alternatively, bus
      wakeup/release ops for QCA9074 are initialized to NULL as
      QCA9704 does not need bus wakeup/release for register accesses.
      
      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/20220328055714.6449-6-quic_mpubbise@quicinc.com
      5b32b6dd
    • Manikanta Pubbisetty's avatar
      ath11k: Refactor MSI logic to support WCN6750 · 0cfaf224
      Manikanta Pubbisetty authored
      Refactor MSI logic in order to support hybrid bus devices
      like WCN6750.
      
      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/20220328055714.6449-5-quic_mpubbise@quicinc.com
      0cfaf224
    • Manikanta Pubbisetty's avatar
      ath11k: Choose MSI config based on HW revision · 8d06b802
      Manikanta Pubbisetty authored
      Instead of selecting MSI config based on magic numbers, make
      the assignment based on HW revision. The logic is similar to
      the selection of HW params. This improves readability of the
      code and also simplifies new additions.
      
      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/20220328055714.6449-4-quic_mpubbise@quicinc.com
      8d06b802
    • Manikanta Pubbisetty's avatar
      ath11k: Refactor PCI code to support WCN6750 · bbfdc5a7
      Manikanta Pubbisetty authored
      Unlike other ATH11K PCIe devices which are enumerated by APSS
      processor (Application Processor SubSystem), WCN6750 gets
      enumerated by the WPSS Q6 processor (Wireless Processor SubSystem);
      In simple terms, though WCN6750 is PCIe device, it is not attached
      to the APSS processor, APSS will not know of such a device being
      present in the system and therefore WCN6750 will be registered as
      a platform device to the kernel core like other supported AHB
      devices.
      
      WCN6750 needs both AHB and PCI APIs for it's operation, it uses
      AHB APIs for device probe/boot and PCI APIs for device setup and
      register accesses. Because of this nature, it is referred as a
      hybrid bus device.
      
      Refactor PCI code to support hybrid bus devices like WCN6750.
      
      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/20220328055714.6449-3-quic_mpubbise@quicinc.com
      bbfdc5a7