1. 03 Feb, 2020 6 commits
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: fix TDLS discovery with the new firmware API · b5b878e3
      Emmanuel Grumbach authored
      I changed the API for asking for a session protection but
      I omitted the TDLS flows. Fix that now.
      Note that for the TDLS flow, we need to block until the
      session protection actually starts, so add this option
      to iwl_mvm_schedule_session_protection.
      This patch fixes a firmware assert in the TDLS flow since
      the old TIME_EVENT_CMD is not supported anymore by newer
      firwmare versions.
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Fixes: fe959c7b ("iwlwifi: mvm: use the new session protection command")
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      b5b878e3
    • Andrei Otcheretianski's avatar
      iwlwifi: mvm: Check the sta is not NULL in iwl_mvm_cfg_he_sta() · 12d47f0e
      Andrei Otcheretianski authored
      Fix a kernel panic by checking that the sta is not NULL.
      This could happen during a reconfig flow, as mac80211 moves the sta
      between all the states without really checking if the previous state was
      successfully set. So, if for some reason we failed to add back the
      station, subsequent calls to sta_state() callback will be done when the
      station is NULL. This would result in a following panic:
      
      BUG: unable to handle kernel NULL pointer dereference at
      0000000000000040
      IP: iwl_mvm_cfg_he_sta+0xfc/0x690 [iwlmvm]
      [..]
      Call Trace:
       iwl_mvm_mac_sta_state+0x629/0x6f0 [iwlmvm]
       drv_sta_state+0xf4/0x950 [mac80211]
       ieee80211_reconfig+0xa12/0x2180 [mac80211]
       ieee80211_restart_work+0xbb/0xe0 [mac80211]
       process_one_work+0x1e2/0x610
       worker_thread+0x4d/0x3e0
      [..]
      Signed-off-by: default avatarAndrei Otcheretianski <andrei.otcheretianski@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      12d47f0e
    • Avraham Stern's avatar
      iwlwifi: mvm: avoid use after free for pmsr request · cc4255ef
      Avraham Stern authored
      When a FTM request is aborted, the driver sends the abort command to
      the fw and waits for a response. When the response arrives, the driver
      calls cfg80211_pmsr_complete() for that request.
      However, cfg80211 frees the requested data immediately after sending
      the abort command, so this may lead to use after free.
      
      Fix it by clearing the request data in the driver when the abort
      command arrives and ignoring the fw notification that will come
      afterwards.
      Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
      Fixes: fc36ffda ("iwlwifi: mvm: support FTM initiator")
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      cc4255ef
    • Golan Ben Ami's avatar
      iwlwifi: mvm: update the DTS measurement type · 6bd5fa33
      Golan Ben Ami authored
      Till now, the driver asked the fw for a DTS measurement in automatic
      mode. This triggered a flow in which the fw actively measured the
      temperature.  This is not needed anymore, as the fw performs
      measurements by itself, without the driver triggering them, and the
      current cadence in which the fw performs such measurements is
      sufficient.
      
      In addition, in some time-sensitive scenarios, in which the driver asks
      the fw for an active measurement twice in a short time (<100ms), the fw
      asserts with code 0x20100801.
      
      Change the DTS measurement to _WITHOUT_MEASURE instead, so the fw will
      respond with the last measurement it has performed.
      Signed-off-by: default avatarGolan Ben Ami <golan.ben.ami@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      6bd5fa33
    • Luca Coelho's avatar
      iwlwifi: don't throw error when trying to remove IGTK · 197288d5
      Luca Coelho authored
      The IGTK keys are only removed by mac80211 after it has already
      removed the AP station.  This causes the driver to throw an error
      because mac80211 is trying to remove the IGTK when the station doesn't
      exist anymore.
      
      The firmware is aware that the station has been removed and can deal
      with it the next time we try to add an IGTK for a station, so we
      shouldn't try to remove the key if the station ID is
      IWL_MVM_INVALID_STA.  Do this by removing the check for mvm_sta before
      calling iwl_mvm_send_sta_igtk() and check return from that function
      gracefully if the station ID is invalid.
      
      Cc: stable@vger.kernel.org # 4.12+
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      197288d5
    • Andrei Otcheretianski's avatar
      iwlwifi: mvm: Fix thermal zone registration · baa6cf84
      Andrei Otcheretianski authored
      Use a unique name when registering a thermal zone. Otherwise, with
      multiple NICS, we hit the following warning during the unregistration.
      
      WARNING: CPU: 2 PID: 3525 at fs/sysfs/group.c:255
       RIP: 0010:sysfs_remove_group+0x80/0x90
       Call Trace:
        dpm_sysfs_remove+0x57/0x60
        device_del+0x5a/0x350
        ? sscanf+0x4e/0x70
        device_unregister+0x1a/0x60
        hwmon_device_unregister+0x4a/0xa0
        thermal_remove_hwmon_sysfs+0x175/0x1d0
        thermal_zone_device_unregister+0x188/0x1e0
        iwl_mvm_thermal_exit+0xe7/0x100 [iwlmvm]
        iwl_op_mode_mvm_stop+0x27/0x180 [iwlmvm]
        _iwl_op_mode_stop.isra.3+0x2b/0x50 [iwlwifi]
        iwl_opmode_deregister+0x90/0xa0 [iwlwifi]
        __exit_compat+0x10/0x2c7 [iwlmvm]
        __x64_sys_delete_module+0x13f/0x270
        do_syscall_64+0x5a/0x110
        entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Signed-off-by: default avatarAndrei Otcheretianski <andrei.otcheretianski@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      baa6cf84
  2. 27 Jan, 2020 34 commits