1. 06 9月, 2022 1 次提交
  2. 27 7月, 2022 2 次提交
    • J
      wifi: iwlwifi: mvm: fix double list_add at iwl_mvm_mac_wake_tx_queue · 14a3aacf
      Jose Ignacio Tornos Martinez 提交于
      After successfull station association, if station queues are disabled for
      some reason, the related lists are not emptied. So if some new element is
      added to the list in iwl_mvm_mac_wake_tx_queue, it can match with the old
      one and produce a BUG like this:
      
      [   46.535263] list_add corruption. prev->next should be next (ffff94c1c318a360), but was 0000000000000000. (prev=ffff94c1d02d3388).
      [   46.535283] ------------[ cut here ]------------
      [   46.535284] kernel BUG at lib/list_debug.c:26!
      [   46.535290] invalid opcode: 0000 [#1] PREEMPT SMP PTI
      [   46.585304] CPU: 0 PID: 623 Comm: wpa_supplicant Not tainted 5.19.0-rc3+ #1
      [   46.592380] Hardware name: Dell Inc. Inspiron 660s/0478VN       , BIOS A07 08/24/2012
      [   46.600336] RIP: 0010:__list_add_valid.cold+0x3d/0x3f
      [   46.605475] Code: f2 4c 89 c1 48 89 fe 48 c7 c7 c8 40 67 93 e8 20 cc fd ff 0f 0b 48 89 d1 4c 89 c6 4c 89 ca 48 c7 c7 70 40 67 93 e8 09 cc fd ff <0f> 0b 48 89 fe 48 c7 c7 00 41 67 93 e8 f8 cb fd ff 0f 0b 48 89 d1
      [   46.624469] RSP: 0018:ffffb20800ab76d8 EFLAGS: 00010286
      [   46.629854] RAX: 0000000000000075 RBX: ffff94c1c318a0e0 RCX: 0000000000000000
      [   46.637105] RDX: 0000000000000201 RSI: ffffffff9365e100 RDI: 00000000ffffffff
      [   46.644356] RBP: ffff94c1c5f43370 R08: 0000000000000075 R09: 3064316334396666
      [   46.651607] R10: 3364323064316334 R11: 39666666663d7665 R12: ffff94c1c5f43388
      [   46.658857] R13: ffff94c1d02d3388 R14: ffff94c1c318a360 R15: ffff94c1cf2289c0
      [   46.666108] FS:  00007f65634ff7c0(0000) GS:ffff94c1da200000(0000) knlGS:0000000000000000
      [   46.674331] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   46.680170] CR2: 00007f7dfe984460 CR3: 000000010e894003 CR4: 00000000000606f0
      [   46.687422] Call Trace:
      [   46.689906]  <TASK>
      [   46.691950]  iwl_mvm_mac_wake_tx_queue+0xec/0x15c [iwlmvm]
      [   46.697601]  ieee80211_queue_skb+0x4b3/0x720 [mac80211]
      [   46.702973]  ? sta_info_get+0x46/0x60 [mac80211]
      [   46.707703]  ieee80211_tx+0xad/0x110 [mac80211]
      [   46.712355]  __ieee80211_tx_skb_tid_band+0x71/0x90 [mac80211]
      ...
      
      In order to avoid this problem, we must also remove the related lists when
      station queues are disabled.
      
      Fixes: cfbc6c4c ("iwlwifi: mvm: support mac80211 TXQs model")
      Reported-by: NTakayuki Nagata <tnagata@redhat.com>
      Reported-by: NPetr Stourac <pstourac@redhat.com>
      Tested-by: NPetr Stourac <pstourac@redhat.com>
      Signed-off-by: NJose Ignacio Tornos Martinez <jtornosm@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@kernel.org>
      Link: https://lore.kernel.org/r/20220719153542.81466-1-jtornosm@redhat.com
      14a3aacf
    • J
      wifi: iwlwifi: mvm: fix clang -Wformat warnings · 7819b3d1
      Justin Stitt 提交于
      When building with Clang we encounter these warnings:
      | drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1108:47: error:
      | format specifies type 'unsigned char' but the argument has type 's16'
      | (aka 'short') [-Werror,-Wformat] IWL_DEBUG_INFO(mvm, "\tburst index:
      | %hhu\n", res->ftm.burst_index);
      -
      | drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1111:47: error:
      | format specifies type 'unsigned char' but the argument has type 's32'
      | (aka 'int') [-Werror,-Wformat] IWL_DEBUG_INFO(mvm, "\trssi spread:
      | %hhu\n", res->ftm.rssi_spread);
      
      The previous format specifier `%hhu` describes a u8 but our arguments
      are wider than this which means bits are potentially being lost.
      
      Variadic functions (printf-like) undergo default argument promotion.
      Documentation/core-api/printk-formats.rst specifically recommends using
      the promoted-to-type's format flag.
      
      As per C11 6.3.1.1:
      (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) `If an int
      can represent all values of the original type ..., the value is
      converted to an int; otherwise, it is converted to an unsigned int.
      These are called the integer promotions.` Thus it makes sense to change
      `%hhu` to `%d` for both instances of the warning.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/378Signed-off-by: NJustin Stitt <justinstitt@google.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NKalle Valo <kvalo@kernel.org>
      Link: https://lore.kernel.org/r/20220711222919.2043613-1-justinstitt@google.com
      7819b3d1
  3. 15 7月, 2022 4 次提交
  4. 20 6月, 2022 8 次提交
  5. 23 5月, 2022 1 次提交
  6. 18 5月, 2022 6 次提交
  7. 11 4月, 2022 1 次提交
    • S
      mac80211: prepare sta handling for MLO support · 046d2e7c
      Sriram R 提交于
      Currently in mac80211 each STA object is represented
      using sta_info datastructure with the associated
      STA specific information and drivers access ieee80211_sta
      part of it.
      
      With MLO (Multi Link Operation) support being added
      in 802.11be standard, though the association is logically
      with a single Multi Link capable STA, at the physical level
      communication can happen via different advertised
      links (uniquely identified by Channel, operating class,
      BSSID) and hence the need to handle multiple link
      STA parameters within a composite sta_info object
      called the MLD STA. The different link STA part of
      MLD STA are identified using the link address which can
      be same or different as the MLD STA address and unique
      link id based on the link vif.
      
      To support extension of such a model, the sta_info
      datastructure is modified to hold multiple link STA
      objects with link specific params currently within
      sta_info moved to this new structure. Similarly this is
      done for ieee80211_sta as well which will be accessed
      within mac80211 as well as by drivers, hence trivial
      driver changes are expected to support this.
      
      For current non MLO supported drivers, only one link STA
      is present and link information is accessed via 'deflink'
      member.
      
      For MLO drivers, we still need to define the APIs etc. to
      get the correct link ID and access the correct part of
      the station info.
      
      Currently in mac80211, all link STA info are accessed directly
      via deflink. These will be updated to access via link pointers
      indexed by link id with MLO support patches, with link id
      being 0 for non MLO supported cases.
      
      Except for couple of macro related changes, below spatch takes
      care of updating mac80211 and driver code to access to the
      link STA info via deflink.
      
        @ieee80211_sta@
        struct ieee80211_sta *s;
        struct sta_info *si;
        identifier var = {supp_rates, ht_cap, vht_cap, he_cap, he_6ghz_capa, eht_cap, rx_nss, bandwidth, txpwr};
        @@
      
        (
          s->
        -    var
        +    deflink.var
        |
         si->sta.
        -    var
        +    deflink.var
        )
      
        @sta_info@
        struct sta_info *si;
        identifier var = {gtk, pcpu_rx_stats, rx_stats, rx_stats_avg, status_stats, tx_stats, cur_max_bandwidth};
        @@
      
        (
          si->
        -    var
        +    deflink.var
        )
      Signed-off-by: NSriram R <quic_srirrama@quicinc.com>
      Link: https://lore.kernel.org/r/1649086883-13246-1-git-send-email-quic_srirrama@quicinc.com
      [remove MLO-drivers notes from commit message, not clear yet; run spatch]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      046d2e7c
  8. 23 3月, 2022 1 次提交
  9. 10 3月, 2022 4 次提交
  10. 03 3月, 2022 1 次提交
  11. 01 3月, 2022 2 次提交
    • R
      iwlwifi: mvm: check debugfs_dir ptr before use · 5a6248c0
      Randy Dunlap 提交于
      When "debugfs=off" is used on the kernel command line, iwiwifi's
      mvm module uses an invalid/unchecked debugfs_dir pointer and causes
      a BUG:
      
       BUG: kernel NULL pointer dereference, address: 000000000000004f
       #PF: supervisor read access in kernel mode
       #PF: error_code(0x0000) - not-present page
       PGD 0 P4D 0
       Oops: 0000 [#1] PREEMPT SMP
       CPU: 1 PID: 503 Comm: modprobe Tainted: G        W         5.17.0-rc5 #7
       Hardware name: Dell Inc. Inspiron 15 5510/076F7Y, BIOS 2.4.1 11/05/2021
       RIP: 0010:iwl_mvm_dbgfs_register+0x692/0x700 [iwlmvm]
       Code: 69 a0 be 80 01 00 00 48 c7 c7 50 73 6a a0 e8 95 cf ee e0 48 8b 83 b0 1e 00 00 48 c7 c2 54 73 6a a0 be 64 00 00 00 48 8d 7d 8c <48> 8b 48 50 e8 15 22 07 e1 48 8b 43 28 48 8d 55 8c 48 c7 c7 5f 73
       RSP: 0018:ffffc90000a0ba68 EFLAGS: 00010246
       RAX: ffffffffffffffff RBX: ffff88817d6e3328 RCX: ffff88817d6e3328
       RDX: ffffffffa06a7354 RSI: 0000000000000064 RDI: ffffc90000a0ba6c
       RBP: ffffc90000a0bae0 R08: ffffffff824e4880 R09: ffffffffa069d620
       R10: ffffc90000a0ba00 R11: ffffffffffffffff R12: 0000000000000000
       R13: ffffc90000a0bb28 R14: ffff88817d6e3328 R15: ffff88817d6e3320
       FS:  00007f64dd92d740(0000) GS:ffff88847f640000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 000000000000004f CR3: 000000016fc79001 CR4: 0000000000770ee0
       PKRU: 55555554
       Call Trace:
        <TASK>
        ? iwl_mvm_mac_setup_register+0xbdc/0xda0 [iwlmvm]
        iwl_mvm_start_post_nvm+0x71/0x100 [iwlmvm]
        iwl_op_mode_mvm_start+0xab8/0xb30 [iwlmvm]
        _iwl_op_mode_start+0x6f/0xd0 [iwlwifi]
        iwl_opmode_register+0x6a/0xe0 [iwlwifi]
        ? 0xffffffffa0231000
        iwl_mvm_init+0x35/0x1000 [iwlmvm]
        ? 0xffffffffa0231000
        do_one_initcall+0x5a/0x1b0
        ? kmem_cache_alloc+0x1e5/0x2f0
        ? do_init_module+0x1e/0x220
        do_init_module+0x48/0x220
        load_module+0x2602/0x2bc0
        ? __kernel_read+0x145/0x2e0
        ? kernel_read_file+0x229/0x290
        __do_sys_finit_module+0xc5/0x130
        ? __do_sys_finit_module+0xc5/0x130
        __x64_sys_finit_module+0x13/0x20
        do_syscall_64+0x38/0x90
        entry_SYSCALL_64_after_hwframe+0x44/0xae
       RIP: 0033:0x7f64dda564dd
       Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1b 29 0f 00 f7 d8 64 89 01 48
       RSP: 002b:00007ffdba393f88 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
       RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f64dda564dd
       RDX: 0000000000000000 RSI: 00005575399e2ab2 RDI: 0000000000000001
       RBP: 000055753a91c5e0 R08: 0000000000000000 R09: 0000000000000002
       R10: 0000000000000001 R11: 0000000000000246 R12: 00005575399e2ab2
       R13: 000055753a91ceb0 R14: 0000000000000000 R15: 000055753a923018
        </TASK>
       Modules linked in: btintel(+) btmtk bluetooth vfat snd_hda_codec_hdmi fat snd_hda_codec_realtek snd_hda_codec_generic iwlmvm(+) snd_sof_pci_intel_tgl mac80211 snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence soundwire_bus snd_sof_intel_hda snd_sof_pci snd_sof snd_sof_xtensa_dsp snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core btrfs snd_compress snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec raid6_pq iwlwifi snd_hda_core snd_pcm snd_timer snd soundcore cfg80211 intel_ish_ipc(+) thunderbolt rfkill intel_ishtp ucsi_acpi wmi i2c_hid_acpi i2c_hid evdev
       CR2: 000000000000004f
       ---[ end trace 0000000000000000 ]---
      
      Check the debugfs_dir pointer for an error before using it.
      
      Fixes: 8c082a99 ("iwlwifi: mvm: simplify iwl_mvm_dbgfs_register")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Luca Coelho <luciano.coelho@intel.com>
      Cc: linux-wireless@vger.kernel.org
      Cc: Kalle Valo <kvalo@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Link: https://lore.kernel.org/r/20220223030630.23241-1-rdunlap@infradead.org
      [change to make both conditional]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      5a6248c0
    • G
      iwlwifi: don't advertise TWT support · 1db5fcbb
      Golan Ben Ami 提交于
      Some APs misbehave when TWT is used and cause our firmware to crash.
      We don't know a reasonable way to detect and work around this problem
      in the FW yet.  To prevent these crashes, disable TWT in the driver by
      stopping to advertise TWT support.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215523Signed-off-by: NGolan Ben Ami <golan.ben.ami@intel.com>
      [reworded the commit message]
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Link: https://lore.kernel.org/r/20220301072926.153969-1-luca@coelho.fiSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      1db5fcbb
  12. 18 2月, 2022 9 次提交