Skip to content
Snippets Groups Projects
  1. Jan 15, 2025
  2. Jan 14, 2025
  3. Jan 12, 2025
  4. Jan 10, 2025
    • Dmitry Antipov's avatar
      wifi: ath9k: cleanup ath9k_hw_get_nf_hist_mid() · a72eaa17
      Dmitry Antipov authored
      
      In 'ath9k_hw_get_nf_hist_mid()', prefer 'memcpy()' and 'sort()'
      over an ad-hoc things. Briefly tested as a separate module.
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      
      Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Link: https://patch.msgid.link/20250109080703.106692-1-dmantipov@yandex.ru
      
      
      Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
      a72eaa17
    • Rajat Soni's avatar
      wifi: ath12k: Support pdev Puncture Stats · f647dc65
      Rajat Soni authored
      
      Add support to request pdev puncture stats from firmware through
      HTT stats type 46. These stats give the count of number of
      subbands used in different wifi standards.
      
      Sample output:
      -------------
      echo 46 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type
      cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats
      HTT_PDEV_PUNCTURE_STATS_TLV:
      mac_id = 0
      tx_ofdm_su_last_used_pattern_mask = 0x00000001
      tx_ofdm_su_num_subbands_used_cnt_01 = 217
      tx_ofdm_su_num_subbands_used_cnt_02 = 0
      tx_ofdm_su_num_subbands_used_cnt_03 = 0
      .....
      
      HTT_PDEV_PUNCTURE_STATS_TLV:
      mac_id = 0
      tx_ax_dl_mu_ofdma_last_used_pattern_mask = 0x00000000
      tx_ax_dl_mu_ofdma_num_subbands_used_cnt_01 = 0
      tx_ax_dl_mu_ofdma_num_subbands_used_cnt_02 = 0
      tx_ax_dl_mu_ofdma_num_subbands_used_cnt_03 = 0
      .....
      
      HTT_PDEV_PUNCTURE_STATS_TLV:
      mac_id = 0
      tx_be_dl_mu_ofdma_last_used_pattern_mask = 0x00000000
      tx_be_dl_mu_ofdma_num_subbands_used_cnt_01 = 0
      tx_be_dl_mu_ofdma_num_subbands_used_cnt_02 = 0
      tx_be_dl_mu_ofdma_num_subbands_used_cnt_03 = 0
      .....
      
      HTT_PDEV_PUNCTURE_STATS_TLV:
      mac_id = 0
      rx_ax_ul_mu_ofdma_last_used_pattern_mask = 0x00000000
      rx_ax_ul_mu_ofdma_num_subbands_used_cnt_01 = 0
      rx_ax_ul_mu_ofdma_num_subbands_used_cnt_02 = 0
      rx_ax_ul_mu_ofdma_num_subbands_used_cnt_03 = 0
      .....
      
      HTT_PDEV_PUNCTURE_STATS_TLV:
      mac_id = 0
      rx_be_ul_mu_ofdma_last_used_pattern_mask = 0x00000000
      rx_be_ul_mu_ofdma_num_subbands_used_cnt_01 = 0
      rx_be_ul_mu_ofdma_num_subbands_used_cnt_02 = 0
      rx_be_ul_mu_ofdma_num_subbands_used_cnt_03 = 0
      .....
      
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-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 avatarRajat Soni <quic_rajson@quicinc.com>
      Signed-off-by: default avatarRoopni Devanathan <quic_rdevanat@quicinc.com>
      Acked-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20241218035711.2573584-3-quic_rdevanat@quicinc.com
      
      
      Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
      f647dc65
    • Roopni Devanathan's avatar
      wifi: ath12k: Support AST Entry Stats · 89699f02
      Roopni Devanathan authored
      
      Add support to request Address Search Table(AST) entries stats
      from firmware through HTT stats type 41. These stats give AST entries
      related information such as software peer id, MAC address, pdev id,
      vdev, id, next hop, etc.
      
      Sample output:
      -------------
      echo 41 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type
      cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats
      HTT_AST_ENTRY_TLV:
      ast_index = 10
      mac_addr = 00:00:00:01:00:00
      sw_peer_id = 0
      pdev_id = 3
      vdev_id = 255
      next_hop = 0
      mcast = 0
      monitor_direct = 0
      mesh_sta = 0
      mec = 0
      intra_bss = 0
      
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-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 avatarRoopni Devanathan <quic_rdevanat@quicinc.com>
      Acked-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20241218035711.2573584-2-quic_rdevanat@quicinc.com
      
      
      Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
      89699f02
    • Pradeep Kumar Chitrapu's avatar
      wifi: ath12k: Support Transmit Buffer OFDMA Stats · 3f482f24
      Pradeep Kumar Chitrapu authored
      
      Add support to request OFDMA stats of transmit buffers from firmware through
      HTT stats type 32. These stats give information about NDPA, NDP, BRP and
      steering mechanisms.
      
      Note: WCN7850 firmware version -
      WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 does not
      support HTT stats type 32.
      
      Sample output:
      -------------
      echo 32 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type
      cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats
      HTT_TXBF_OFDMA_AX_NDPA_STATS_TLV:
      ax_ofdma_ndpa_queued = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      ax_ofdma_ndpa_tried = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      .....
      
      HTT_TXBF_OFDMA_AX_NDP_STATS_TLV:
      ax_ofdma_ndp_queued = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      ax_ofdma_ndp_tried = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      .....
      
      HTT_TXBF_OFDMA_AX_BRP_STATS_TLV:
      ax_ofdma_brpoll_queued = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      ax_ofdma_brpoll_tied = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      .....
      
      HTT_TXBF_OFDMA_AX_STEER_STATS_TLV:
      ax_ofdma_num_ppdu_steer = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      ax_ofdma_num_usrs_prefetch = 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0,
      17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0, 25:0, 26:0, 27:0, 28:0, 29:0, 30:0, 31:0, 32:0, 33:0, 34:0, 35:0, 36:0, 37:0
      .....
      
      HTT_TXBF_OFDMA_AX_STEER_MPDU_STATS_TLV:
      rbo_steer_mpdus_tried = 0
      rbo_steer_mpdus_failed = 0
      sifs_steer_mpdus_tried = 0
      sifs_steer_mpdus_failed = 0
      
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
      
      Signed-off-by: default avatarPradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
      Signed-off-by: default avatarRoopni Devanathan <quic_rdevanat@quicinc.com>
      Acked-by: default avatarJeff Johnson <jjohnson@kernel.org>
      Link: https://patch.msgid.link/20241128110949.3672364-3-quic_rdevanat@quicinc.com
      
      
      Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
      3f482f24
    • Pradeep Kumar Chitrapu's avatar
      wifi: ath12k: Support Transmit Rate Buffer Stats · c9f6ee27
      Pradeep Kumar Chitrapu authored
      
      Add support to request transmit rate buffer stats from firmware through
      HTT stats type 31. These stats give information such as MCS, NSS and
      bandwidth of transmit and input buffer.
      
      Sample output:
      -------------
      echo 31 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type
      cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats
      HTT_STATS_PDEV_TX_RATE_TXBF_STATS:
      Legacy OFDM Rates: 6 Mbps: 0, 9 Mbps: 0, 12 Mbps: 0, 18 Mbps: 0
      24 Mbps: 0, 36 Mbps: 0, 48 Mbps: 0, 54 Mbps: 0
      tx_ol_mcs =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0
      tx_ibf_mcs =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0
      tx_txbf_mcs =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0
      tx_ol_nss =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0
      tx_ibf_nss =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0
      tx_txbf_nss =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0
      tx_ol_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      half_tx_ol_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      quarter_tx_ol_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      tx_ibf_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      half_tx_ibf_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      quarter_tx_ibf_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      tx_txbf_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      half_tx_txbf_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      quarter_tx_txbf_bw =  0:0, 1:0, 2:0, 3:0, 4:0
      
      HTT_STATS_PDEV_TXBF_FLAG_RETURN_STATS:
      TXBF_reason_code_stats: 0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0
      
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
      
      Signed-off-by: default avatarPradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
      Signed-off-by: default avatarRoopni Devanathan <quic_rdevanat@quicinc.com>
      Acked-by: default avatarKalle Valo <kvalo@kernel.org>
      Acked-by: default avatarJeff Johnson <jjohnson@kernel.org>
      Link: https://patch.msgid.link/20241128110949.3672364-2-quic_rdevanat@quicinc.com
      
      
      Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
      c9f6ee27
    • Jeff Johnson's avatar
      wifi: brcmfmac: Add missing Return: to function documentation · 8221712a
      Jeff Johnson authored
      
      Running 'scripts/kernel-doc -Wall -Werror -none' flagged the following
      kernel-doc issues:
      
      drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:823: warning: No description found for return value of 'brcmf_apsta_add_vif'
      drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:907: warning: No description found for return value of 'brcmf_mon_add_vif'
      drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:7419: warning: No description found for return value of 'brcmf_setup_ifmodes'
      
      Add the missing 'Return:' tags to the kernel-doc of these functions.
      
      Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20250106-brcmfmac-kdoc-v1-1-ed72196e21a1@oss.qualcomm.com
      8221712a
    • Dr. David Alan Gilbert's avatar
      wifi: iwlegacy: Remove unused il_get_single_channel_number() · 83ed80dd
      Dr. David Alan Gilbert authored
      
      THe last use of il_get_single_channel_number() was removed in 2011 by
      commit dd6d2a8a ("iwlegacy: remove reset rf infrastructure")
      when it was still called iwl_legacy_get_single_channel_number.
      
      Remove it.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <linux@treblig.org>
      Acked-by: default avatarStanislaw Gruszka <stf_xl@wp.pl>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20241226011355.135417-3-linux@treblig.org
      83ed80dd
    • Dr. David Alan Gilbert's avatar
      wifi: iwlegacy: Remove unused il3945_calc_db_from_ratio() · 413859e9
      Dr. David Alan Gilbert authored
      
      The last use of il3945_calc_db_from_ratio() was removed in 2010 by
      commit ed1b6e99 ("iwlwifi: remove noise reporting")
      when it was still called iwl3945_calc_db_from_ratio().
      
      Remove it.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <linux@treblig.org>
      Acked-by: default avatarStanislaw Gruszka <stf_xl@wp.pl>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20241226011355.135417-2-linux@treblig.org
      413859e9
    • Ariel Otilibili's avatar
      wifi: rt2x00: Remove unused rfval values · 280c8b39
      Ariel Otilibili authored
      
      The intention here is not clear but as this was already tested and matches
      vendor driver it's better not to change behavior even if it looks suspicious.
      So just remove the unused values.
      
      Coverity-ID: 15253079
      
      Signed-off-by: default avatarAriel Otilibili <ariel.otilibili-anieli@eurecom.fr>
      Acked-by: default avatarStanislaw Gruszka <stf_xl@wp.pl>
      [kvalo@kernel.org: write commit message]
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20241221124445.1094460-2-ariel.otilibili-anieli@eurecom.fr
      280c8b39
    • Stefan Dösinger's avatar
      wifi: brcmfmac: Check the return value of of_property_read_string_index() · 082d9e26
      Stefan Dösinger authored
      
      Somewhen between 6.10 and 6.11 the driver started to crash on my
      MacBookPro14,3. The property doesn't exist and 'tmp' remains
      uninitialized, so we pass a random pointer to devm_kstrdup().
      
      The crash I am getting looks like this:
      
      BUG: unable to handle page fault for address: 00007f033c669379
      PF: supervisor read access in kernel mode
      PF: error_code(0x0001) - permissions violation
      PGD 8000000101341067 P4D 8000000101341067 PUD 101340067 PMD 1013bb067 PTE 800000010aee9025
      Oops: Oops: 0001 [#1] SMP PTI
      CPU: 4 UID: 0 PID: 827 Comm: (udev-worker) Not tainted 6.11.8-gentoo #1
      Hardware name: Apple Inc. MacBookPro14,3/Mac-551B86E5744E2388, BIOS 529.140.2.0.0 06/23/2024
      RIP: 0010:strlen+0x4/0x30
      Code: f7 75 ec 31 c0 c3 cc cc cc cc 48 89 f8 c3 cc cc cc cc 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa <80> 3f 00 74 14 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 c3 cc
      RSP: 0018:ffffb4aac0683ad8 EFLAGS: 00010202
      RAX: 00000000ffffffea RBX: 00007f033c669379 RCX: 0000000000000001
      RDX: 0000000000000cc0 RSI: 00007f033c669379 RDI: 00007f033c669379
      RBP: 00000000ffffffea R08: 0000000000000000 R09: 00000000c0ba916a
      R10: ffffffffffffffff R11: ffffffffb61ea260 R12: ffff91f7815b50c8
      R13: 0000000000000cc0 R14: ffff91fafefffe30 R15: ffffb4aac0683b30
      FS:  00007f033ccbe8c0(0000) GS:ffff91faeed00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f033c669379 CR3: 0000000107b1e004 CR4: 00000000003706f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       ? __die+0x23/0x70
       ? page_fault_oops+0x149/0x4c0
       ? raw_spin_rq_lock_nested+0xe/0x20
       ? sched_balance_newidle+0x22b/0x3c0
       ? update_load_avg+0x78/0x770
       ? exc_page_fault+0x6f/0x150
       ? asm_exc_page_fault+0x26/0x30
       ? __pfx_pci_conf1_write+0x10/0x10
       ? strlen+0x4/0x30
       devm_kstrdup+0x25/0x70
       brcmf_of_probe+0x273/0x350 [brcmfmac]
      
      Signed-off-by: default avatarStefan Dösinger <stefan@codeweavers.com>
      Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20250106170958.3595-1-stefan@codeweavers.com
      082d9e26
    • Andreas Kemnade's avatar
      wifi: wlcore: fix unbalanced pm_runtime calls · 996c934c
      Andreas Kemnade authored
      
      If firmware boot failes, runtime pm is put too often:
      [12092.708099] wlcore: ERROR firmware boot failed despite 3 retries
      [12092.708099] wl18xx_driver wl18xx.1.auto: Runtime PM usage count underflow!
      Fix that by redirecting all error gotos before runtime_get so that runtime is
      not put.
      
      Fixes: c40aad28 ("wlcore: Make sure firmware is initialized in wl1271_op_add_interface()")
      Signed-off-by: default avatarAndreas Kemnade <andreas@kemnade.info>
      Reviewed-by: default avatarMichael Nemanov <michael.nemanov@ti.com>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20250104195507.402673-1-akemnade@kernel.org
      996c934c
    • Alexis Lothoré's avatar
      wifi: wilc1000: unregister wiphy only if it has been registered · 1be94490
      Alexis Lothoré authored
      
      There is a specific error path in probe functions in wilc drivers (both
      sdio and spi) which can lead to kernel panic, as this one for example
      when using SPI:
      
      Unable to handle kernel paging request at virtual address 9f000000 when read
      [9f000000] *pgd=00000000
      Internal error: Oops: 5 [#1] ARM
      Modules linked in: wilc1000_spi(+) crc_itu_t crc7 wilc1000 cfg80211 bluetooth ecdh_generic ecc
      CPU: 0 UID: 0 PID: 106 Comm: modprobe Not tainted 6.13.0-rc3+ #22
      Hardware name: Atmel SAMA5
      PC is at wiphy_unregister+0x244/0xc40 [cfg80211]
      LR is at wiphy_unregister+0x1c0/0xc40 [cfg80211]
      [...]
       wiphy_unregister [cfg80211] from wilc_netdev_cleanup+0x380/0x494 [wilc1000]
       wilc_netdev_cleanup [wilc1000] from wilc_bus_probe+0x360/0x834 [wilc1000_spi]
       wilc_bus_probe [wilc1000_spi] from spi_probe+0x15c/0x1d4
       spi_probe from really_probe+0x270/0xb2c
       really_probe from __driver_probe_device+0x1dc/0x4e8
       __driver_probe_device from driver_probe_device+0x5c/0x140
       driver_probe_device from __driver_attach+0x220/0x540
       __driver_attach from bus_for_each_dev+0x13c/0x1a8
       bus_for_each_dev from bus_add_driver+0x2a0/0x6a4
       bus_add_driver from driver_register+0x27c/0x51c
       driver_register from do_one_initcall+0xf8/0x564
       do_one_initcall from do_init_module+0x2e4/0x82c
       do_init_module from load_module+0x59a0/0x70c4
       load_module from init_module_from_file+0x100/0x148
       init_module_from_file from sys_finit_module+0x2fc/0x924
       sys_finit_module from ret_fast_syscall+0x0/0x1c
      
      The issue can easily be reproduced, for example by not wiring correctly
      a wilc device through SPI (and so, make it unresponsive to early SPI
      commands). It is due to a recent change decoupling wiphy allocation from
      wiphy registration, however wilc_netdev_cleanup has not been updated
      accordingly, letting it possibly call wiphy unregister on a wiphy which
      has never been registered.
      
      Fix this crash by moving wiphy_unregister/wiphy_free out of
      wilc_netdev_cleanup, and by adjusting error paths in both drivers
      
      Fixes: fbdf0c52 ("wifi: wilc1000: Register wiphy after reading out chipid")
      Signed-off-by: default avatarAlexis Lothoré <alexis.lothore@bootlin.com>
      Reviewed-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
      Link: https://patch.msgid.link/20241223-wilc_fix_probe_error_path-v1-1-91fa7bd8e5b6@bootlin.com
      1be94490
Loading