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NlLmMgICAgfCAzMCArKysrKysrKysrKysrKysrKysr KysrKy0tLS0tLS0NCiBkcml2ZXJzL25ldC93aXJlbGVzcy9pd2x3aWZpL212bS9jb2V4X2xlZ2Fj eS5jICB8ICAyICstDQogZHJpdmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9tdm0vZDMuYyAgICAg ICAgICAgfCAyMiArKysrKysrKysrKysrKysrLS0tLS0tDQogZHJpdmVycy9uZXQvd2lyZWxlc3Mv aXdsd2lmaS9tdm0vbWFjODAyMTEuYyAgICAgfCAgMyAtLS0NCiBkcml2ZXJzL25ldC93aXJlbGVz cy9pd2x3aWZpL212bS9vcHMuYyAgICAgICAgICB8ICA2ICsrKystLQ0KIGRyaXZlcnMvbmV0L3dp cmVsZXNzL2l3bHdpZmkvbXZtL3JzLmMgICAgICAgICAgIHwgIDMgKysrDQogZHJpdmVycy9uZXQv d2lyZWxlc3MvaXdsd2lmaS9wY2llL3RyYW5zLmMgICAgICAgfCAgOCArKysrKy0tLQ0KIDExIGZp bGVzIGNoYW5nZWQsIDY5IGluc2VydGlvbnMoKyksIDMwIGRlbGV0aW9ucygtKQ0KDQo=
PATCH 1/10 iwlwifi: mvm: forbid MIMO on devices that don't support it
There are devices that forbid MIMO by the mean of the NVM. Detect thoses devices and forbid MIMO otherwise the firmware would crash. STBC is still allowed on these devices.
--- drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c | 5 +++++ drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h | 3 +++ drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 19 +++++++++++++------ drivers/net/wireless/iwlwifi/mvm/rs.c | 3 +++ 4 files changed, 24 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c +5 -0
@@ -6,6 +6,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. +* Copyright(c) 2015 Intel Mobile Communications GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -31,6 +32,7 @@* BSD LICENSE * * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. +* Copyright(c) 2015 Intel Mobile Communications GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -748,6 +750,9 @@ void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg,return ; } +if (data->sku_cap_mimo_disabled) + rx_chains =1 ; + ht_info->ht_supported = true; ht_info->cap =IEEE80211_HT_CAP_DSSSCCK40 ;
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h +3 -0
@@ -6,6 +6,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. +* Copyright(c) 2015 Intel Mobile Communications GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -31,6 +32,7 @@* BSD LICENSE * * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. +* Copyright(c) 2015 Intel Mobile Communications GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -84,6 +86,7 @@ struct iwl_nvm_data {bool sku_cap_11ac_enable;bool sku_cap_amt_enable;bool sku_cap_ipan_enable; +bool sku_cap_mimo_disabled;u16 radio_cfg_type;u8 radio_cfg_step;
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +13 -6
@@ -6,7 +6,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. -* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@* BSD LICENSE * * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. -* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -116,10 +116,11 @@ enum family_8000_nvm_offsets {/* SKU Capabilities (actual values from NVM definition) */ enum nvm_sku_bits { -NVM_SKU_CAP_BAND_24GHZ =BIT (0 ), -NVM_SKU_CAP_BAND_52GHZ =BIT (1 ), -NVM_SKU_CAP_11N_ENABLE =BIT (2 ), -NVM_SKU_CAP_11AC_ENABLE =BIT (3 ), +NVM_SKU_CAP_BAND_24GHZ =BIT (0 ), +NVM_SKU_CAP_BAND_52GHZ =BIT (1 ), +NVM_SKU_CAP_11N_ENABLE =BIT (2 ), +NVM_SKU_CAP_11AC_ENABLE =BIT (3 ), +NVM_SKU_CAP_MIMO_DISABLE =BIT (5 ), };/*
@@ -368,6 +369,11 @@ static void iwl_init_vht_hw_capab(const struct iwl_cfg *cfg,if (cfg->ht_params->ldpc) vht_cap->cap |=IEEE80211_VHT_CAP_RXLDPC ; +if (data->sku_cap_mimo_disabled) { + num_rx_ants =1 ; + num_tx_ants =1 ; + } +if (num_tx_ants >1 ) vht_cap->cap |=IEEE80211_VHT_CAP_TXSTBC ;else
@@ -610,6 +616,7 @@ iwl_parse_nvm_data(struct device *dev, const struct iwl_cfg *cfg, data->sku_cap_11n_enable = false; data->sku_cap_11ac_enable = data->sku_cap_11n_enable && (sku &NVM_SKU_CAP_11AC_ENABLE ); + data->sku_cap_mimo_disabled = sku &NVM_SKU_CAP_MIMO_DISABLE ; data->n_hw_addrs =iwl_get_n_hw_addrs (cfg, nvm_sw);
drivers/net/wireless/iwlwifi/mvm/rs.c +3 -0
@@ -180,6 +180,9 @@ static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,if (iwl_mvm_vif_low_latency (mvmvif) && mvmsta->vif->p2p)return false; +if (mvm->nvm_data->sku_cap_mimo_disabled) +return false; +return true; }
Signature · 1 line
2.1.4
PATCH 2/10 iwlwifi: 7000: modify the firmware name for 3165
In reply to Grumbach, Emmanuel3165 really needs to load iwlwifi-7265D-13.ucode. This device is supported starting from -13.ucode, update the MIN and OK defines accordingly. While at it, add 3165 to the device list in the Kconfig file.
--- drivers/net/wireless/iwlwifi/Kconfig | 1 + drivers/net/wireless/iwlwifi/iwl-7000.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +1 -0
@@ -21,6 +21,7 @@ config IWLWIFI Intel 7260 Wi-Fi Adapter Intel 3160 Wi-Fi Adapter Intel 7265 Wi-Fi Adapter + Intel 3165 Wi-Fi Adapter This driver uses the kernel's mac80211 subsystem.
drivers/net/wireless/iwlwifi/iwl-7000.c +8 -8
@@ -70,15 +70,14 @@/* Highest firmware API version supported */ #define IWL7260_UCODE_API_MAX 13 -#define IWL3160_UCODE_API_MAX 13/* Oldest version we won't warn about */ #define IWL7260_UCODE_API_OK 12 -#define IWL3160_UCODE_API_OK 12 +#define IWL3165_UCODE_API_OK 13/* Lowest firmware API version supported */ #define IWL7260_UCODE_API_MIN 10 -#define IWL3160_UCODE_API_MIN 10 +#define IWL3165_UCODE_API_MIN 13/* NVM versions */ #define IWL7260_NVM_VERSION 0x0a1d
@@ -104,9 +103,6 @@#define IWL3160_FW_PRE "iwlwifi-3160-"#define IWL3160_MODULE_FIRMWARE (api) IWL3160_FW_PRE __stringify(api) ".ucode" -#define IWL3165_FW_PRE "iwlwifi-3165-" -#define IWL3165_MODULE_FIRMWARE (api) IWL3165_FW_PRE __stringify(api) ".ucode" -#define IWL7265_FW_PRE "iwlwifi-7265-"#define IWL7265_MODULE_FIRMWARE (api) IWL7265_FW_PRE __stringify(api) ".ucode"
@@ -248,8 +244,13 @@ static const struct iwl_ht_params iwl7265_ht_params = {const struct iwl_cfg iwl3165_2ac_cfg = { .name ="Intel(R) Dual Band Wireless AC 3165" , - .fw_name_pre =IWL3165_FW_PRE , + .fw_name_pre =IWL7265D_FW_PRE ,IWL_DEVICE_7000 , +/* sparse doens't like the re-assignment but it is safe */ +#ifndef __CHECKER__ + .ucode_api_ok =IWL3165_UCODE_API_OK , + .ucode_api_min =IWL3165_UCODE_API_MIN , +#endif .ht_params = &iwl7000_ht_params, .nvm_ver =IWL3165_NVM_VERSION , .nvm_calib_ver =IWL3165_TX_POWER_VERSION ,
@@ -325,6 +326,5 @@ const struct iwl_cfg iwl7265d_n_cfg = {MODULE_FIRMWARE (IWL7260_MODULE_FIRMWARE (IWL7260_UCODE_API_OK ));MODULE_FIRMWARE (IWL3160_MODULE_FIRMWARE (IWL3160_UCODE_API_OK )); -MODULE_FIRMWARE (IWL3165_MODULE_FIRMWARE (IWL3160_UCODE_API_OK ));MODULE_FIRMWARE (IWL7265_MODULE_FIRMWARE (IWL7260_UCODE_API_OK ));MODULE_FIRMWARE (IWL7265D_MODULE_FIRMWARE (IWL7260_UCODE_API_OK ));
Signature · 1 line
2.1.4
PATCH 3/10 iwlwifi: pcie: don't disable the busmaster DMA clock for family 8000
In reply to Grumbach, EmmanuelFrom: Avri Altman <[email protected]>
Disabling the clocks is a standard procedure while stopping the device. On family 8000 however, disabling the bus master DMA clock increases the NIC's power consumption.
To fix this, skip this call if the device family is IWL_DEVICE_FAMILY_8000.
--- drivers/net/wireless/iwlwifi/pcie/trans.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/pcie/trans.c +5 -3
@@ -1049,9 +1049,11 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool low_power)iwl_pcie_rx_stop (trans);/* Power-down device's busmaster DMA clocks */ -iwl_write_prph (trans,APMG_CLK_DIS_REG , -APMG_CLK_VAL_DMA_CLK_RQT ); -udelay (5 ); +if (trans->cfg->device_family !=IWL_DEVICE_FAMILY_8000 ) { +iwl_write_prph (trans,APMG_CLK_DIS_REG , +APMG_CLK_VAL_DMA_CLK_RQT ); +udelay (5 ); + } }/* Make sure (redundant) we've released our request to stay awake */
Signature · 1 line
2.1.4
PATCH 4/10 iwlwifi: mvm: fix MLME trigger
In reply to Grumbach, EmmanuelA few triggers have status = MLME_SUCCESS and they are still interesting. E.g. if we want to collect data upon deauth, the status will be MLME_SUCCESS. Fix that.
--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +0 -3
@@ -3995,9 +3995,6 @@ static void iwl_mvm_mac_event_callback(struct ieee80211_hw *hw,if (!iwl_fw_dbg_trigger_enabled (mvm->fw,FW_DBG_TRIGGER_MLME ))return ; -if (event->u.mlme.status ==MLME_SUCCESS ) -return ; - trig =iwl_fw_dbg_get_trigger (mvm->fw,FW_DBG_TRIGGER_MLME ); trig_mlme = (void *)trig->data;if (!iwl_fw_dbg_trigger_check_stop (mvm, vif, trig))
Signature · 1 line
2.1.4
PATCH 5/10 iwlwifi: mvm: Free fw_status after use to avoid memory leak
In reply to Grumbach, EmmanuelFrom: Haim Dreyfuss <[email protected]>
fw_status is the only pointer pointing to a block of memory allocated above and should be freed after use.
Note: this come from Klockwork static analyzer.
--- drivers/net/wireless/iwlwifi/mvm/d3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/d3.c +3 -1
@@ -1750,8 +1750,10 @@ static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm,int i, j, n_matches, ret; fw_status =iwl_mvm_get_wakeup_status (mvm, vif); -if (!IS_ERR_OR_NULL (fw_status)) +if (!IS_ERR_OR_NULL (fw_status)) { reasons =le32_to_cpu (fw_status->wakeup_reasons); +kfree (fw_status); + }if (reasons &IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED ) wakeup.rfkill_release = true;
Signature · 1 line
2.1.4
PATCH 6/10 iwlwifi: nvm: force mac from otp in case nvm mac is reserved
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
Take the MAC address from the OTP even if one is present in the NVM, if that MAC address happens to be a reserved one.
--- drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +10 -1
@@ -533,6 +533,10 @@ static void iwl_set_hw_address_family_8000(struct device *dev,const u8 *hw_addr;if (mac_override) { +static const u8 reserved_mac[] = { +0x02 ,0xcc ,0xaa ,0xff ,0xee ,0x00 + }; + hw_addr = (const u8 *)(mac_override +MAC_ADDRESS_OVERRIDE_FAMILY_8000 );
@@ -544,7 +548,12 @@ static void iwl_set_hw_address_family_8000(struct device *dev, data->hw_addr[4 ] = hw_addr[5 ]; data->hw_addr[5 ] = hw_addr[4 ]; -if (is_valid_ether_addr (data->hw_addr)) +/* +* Force the use of the OTP MAC address in case of reserved MAC +* address in the NVM, or if address is given but invalid. +*/ +if (is_valid_ether_addr (data->hw_addr) && +memcmp (reserved_mac, hw_addr,ETH_ALEN ) !=0 )return ; IWL_ERR_DEV(dev,
Signature · 1 line
2.1.4
PATCH 7/10 iwlwifi: mvm: BT Coex - duplicate the command if sent ASYNC
In reply to Grumbach, EmmanuelThere are buses that can't handle ASYNC command without copying them. Duplicate the host command instead.
--- drivers/net/wireless/iwlwifi/mvm/coex_legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/coex_legacy.c +1 -1
@@ -776,7 +776,7 @@ static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id,struct iwl_host_cmd cmd = { .id =BT_CONFIG , .len = {sizeof (*bt_cmd), }, - .dataflags = {IWL_HCMD_DFL_NOCOPY , }, + .dataflags = {IWL_HCMD_DFL_DUP , }, .flags =CMD_ASYNC , };struct iwl_mvm_sta *mvmsta;
Signature · 1 line
2.1.4
PATCH 8/10 iwlwifi: mvm: take the UCODE_DOWN reference when resuming
In reply to Grumbach, EmmanuelFrom: Luciano Coelho <[email protected]>
The __iwl_mvm_resume() function always returns 1, which causes mac80211 to do a reconfig with IEEE80211_RECONFIG_TYPE_RESTART. This type of reconfig calls iwl_mvm_restart_complete(), where we unref the IWL_MVM_REF_UCODE_DOWN, so we should always take the reference in this case.
This prevents this kind of warning from happening:
[40026.103025] WARNING: at /root/iwlwifi/iwlwifi-stack-dev/drivers/net/wireless/iwlwifi/mvm/mac80211.c:236 iwl_mvm_unref+0xc9/0xd0 [iwlmvm]() [40026.105145] Modules linked in: iwlmvm(O) iwlwifi(O) mac80211(O) cfg80211(O) compat(O) ctr ccm arc4 autofs4 snd_hda_codec_hdmi snd_hda_codec_idt joydev coretemp kvm_intel kvm aesni_intel ablk_helper cryptd lrw aes_i586 snd_hda_intel xts snd_hda_codec gf128mul snd_hwdep snd_pcm snd_seq_midi dell_wmi snd_rawmidi sparse_keymap snd_seq_midi_event snd_seq uvcvideo dell_laptop videobuf2_core dcdbas microcode videodev psmouse snd_timer videobuf2_vmalloc videobuf2_memops serio_raw snd_seq_device btusb i915 snd bluetooth lpc_ich drm_kms_helper soundcore snd_page_alloc drm i2c_algo_bit wmi parport_pc ppdev video binfmt_misc rpcsec_gss_krb5 nfsd mac_hid nfs_acl nfsv4 auth_rpcgss nfs fscache lockd sunrpc msdos lp parport sdhci_pci sdhci ahci libahci e1000e mmc_core ptp pps_core [last unloaded: compat] [40026.117640] CPU: 2 PID: 3827 Comm: bash Tainted: G W O 3.10.29-dev #1 [40026.120216] Hardware name: Dell Inc. Latitude E6430/0CPWYR, BIOS A09 12/13/2012 [40026.122815] f8effd18 f8effd18 e740fd18 c168aa62 e740fd40 c103a824 c1871238 f8effd18 [40026.125527] 000000ec f8ec79c9 f8ec79c9 d5d29ba4 d5d2a20c 00000000 e740fd50 c103a862 [40026.128209] 00000009 00000000 e740fd7c f8ec79c9 f1c591c4 00000400 00000000 f8efb490 [40026.130886] Call Trace: [40026.133506] [<c168aa62>] dump_stack+0x16/0x18 [40026.136115] [<c103a824>] warn_slowpath_common+0x64/0x80 [40026.138727] [<f8ec79c9>] ? iwl_mvm_unref+0xc9/0xd0 [iwlmvm] [40026.141319] [<f8ec79c9>] ? iwl_mvm_unref+0xc9/0xd0 [iwlmvm] [40026.143881] [<c103a862>] warn_slowpath_null+0x22/0x30 [40026.146453] [<f8ec79c9>] iwl_mvm_unref+0xc9/0xd0 [iwlmvm] [40026.149030] [<f8ec7a4d>] iwl_mvm_mac_reconfig_complete+0x7d/0x210 [iwlmvm] [40026.151645] [<f8b74b20>] ? ftrace_raw_event_drv_reconfig_complete+0xc0/0xe0 [mac80211] [40026.154291] [<f8b6769e>] ieee80211_reconfig+0x28e/0x2620 [mac80211] [40026.156920] [<c10ef0ea>] ? ring_buffer_unlock_commit+0xba/0x100 [40026.159585] [<f8b4a04d>] ieee80211_resume+0x6d/0x80 [mac80211] [40026.162206] [<f8a79722>] wiphy_resume+0x72/0x260 [cfg80211] [40026.164799] [<c141e2e7>] ? device_resume+0x57/0x150 [40026.167425] [<f8a796b0>] ? wiphy_suspend+0x710/0x710 [cfg80211] [40026.170075] [<c141e26e>] dpm_run_callback+0x2e/0x50 [40026.172695] [<c141e321>] device_resume+0x91/0x150 [40026.175334] [<c141f636>] dpm_resume+0xf6/0x200 [40026.177922] [<c141f920>] dpm_resume_end+0x10/0x20 [40026.180489] [<c108d9f7>] suspend_devices_and_enter+0x177/0x480 [40026.183037] [<c168646a>] ? printk+0x4d/0x4f [40026.185559] [<c108de76>] pm_suspend+0x176/0x210 [40026.188065] [<c108ca5d>] state_store+0x5d/0xb0 [40026.190581] [<c108ca00>] ? wakeup_count_show+0x50/0x50 [40026.193052] [<c13208db>] kobj_attr_store+0x1b/0x30 [40026.195608] [<c11e3a4b>] sysfs_write_file+0xab/0x100 [40026.198055] [<c11e39a0>] ? sysfs_poll+0xa0/0xa0 [40026.200469] [<c1179655>] vfs_write+0xa5/0x1c0 [40026.202893] [<c1179af7>] SyS_write+0x57/0xa0 [40026.205245] [<c1699ec1>] sysenter_do_call+0x12/0x32 [40026.207619] ---[ end trace db1d5a72a0381b0a ]---
--- drivers/net/wireless/iwlwifi/mvm/d3.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/d3.c +8 -1
@@ -1917,6 +1917,14 @@ out:/* return 1 to reconfigure the device */ set_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status);set_bit (IWL_MVM_STATUS_D3_RECONFIG , &mvm->status); + +/* We always return 1, which causes mac80211 to do a reconfig +* with IEEE80211_RECONFIG_TYPE_RESTART. This type of +* reconfig calls iwl_mvm_restart_complete(), where we unref +* the IWL_MVM_REF_UCODE_DOWN, so we need to take the +* reference here. +*/ +iwl_mvm_ref (mvm,IWL_MVM_REF_UCODE_DOWN );return 1 ; }
@@ -2023,7 +2031,6 @@ static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file)__iwl_mvm_resume (mvm, true);rtnl_unlock ();iwl_abort_notification_waits (&mvm->notif_wait); -iwl_mvm_ref (mvm,IWL_MVM_REF_UCODE_DOWN );ieee80211_restart_hw (mvm->hw);/* wait for restart and disconnect all interfaces */
Signature · 1 line
2.1.4
PATCH 9/10 iwlwifi: mvm: clean net-detect info if device was reset during suspend
In reply to Grumbach, EmmanuelFrom: Luciano Coelho <[email protected]>
If the device is reset during suspend with net-detect enabled, we leave the net-detect information dangling and this causes the next suspend to fail with a warning:
[21795.351010] WARNING: at /root/iwlwifi/iwlwifi-stack-dev/drivers/net/wireless/iwlwifi/mvm/d3.c:989 __iwl_mvm_suspend.isra.6+0x2be/0x460 [iwlmvm]() [21795.353253] Modules linked in: iwlmvm(O) iwlwifi(O) mac80211(O) cfg80211(O) compat(O) [...] [21795.366168] CPU: 1 PID: 3645 Comm: bash Tainted: G O 3.10.29-dev #1 [21795.368785] Hardware name: Dell Inc. Latitude E6430/0CPWYR, BIOS A09 12/13/2012 [21795.371441] f8ec6748 f8ec6748 e51f3ce8 c168aa62 e51f3d10 c103a824 c1871238 f8ec6748 [21795.374228] 000003dd f8eb982e f8eb982e 00000000 c3408ed4 c41edbbc e51f3d20 c103a862 [21795.377006] 00000009 00000000 e51f3da8 f8eb982e c41ee3dc 00000004 e7970000 e51f3d74 [21795.379792] Call Trace: [21795.382461] [<c168aa62>] dump_stack+0x16/0x18 [21795.385133] [<c103a824>] warn_slowpath_common+0x64/0x80 [21795.387803] [<f8eb982e>] ? __iwl_mvm_suspend.isra.6+0x2be/0x460 [iwlmvm] [21795.390485] [<f8eb982e>] ? __iwl_mvm_suspend.isra.6+0x2be/0x460 [iwlmvm] [21795.393124] [<c103a862>] warn_slowpath_null+0x22/0x30 [21795.395787] [<f8eb982e>] __iwl_mvm_suspend.isra.6+0x2be/0x460 [iwlmvm] [21795.398464] [<f8eb9d7c>] iwl_mvm_suspend+0xec/0x140 [iwlmvm] [21795.401127] [<c104be11>] ? del_timer_sync+0xa1/0xc0 [21795.403800] [<f8d4107e>] __ieee80211_suspend+0x1de/0xff0 [mac80211] [21795.406459] [<c168e43d>] ? mutex_lock_nested+0x25d/0x350 [21795.409084] [<c1586b64>] ? rtnl_lock+0x14/0x20 [21795.411685] [<f8cf0076>] ieee80211_suspend+0x16/0x20 [mac80211] [21795.414318] [<f8c4e014>] wiphy_suspend+0x74/0x710 [cfg80211] [21795.416916] [<c141e612>] __device_suspend+0x1e2/0x220 [21795.419521] [<f8c4dfa0>] ? addresses_show+0xa0/0xa0 [cfg80211] [21795.422097] [<c141f997>] dpm_suspend+0x67/0x210 [21795.424661] [<c141fd6f>] dpm_suspend_start+0x4f/0x60 [21795.427219] [<c108d8e0>] suspend_devices_and_enter+0x60/0x480 [21795.429768] [<c168646a>] ? printk+0x4d/0x4f [21795.432295] [<c108de76>] pm_suspend+0x176/0x210 [21795.434830] [<c108ca5d>] state_store+0x5d/0xb0 [21795.437410] [<c108ca00>] ? wakeup_count_show+0x50/0x50 [21795.439961] [<c13208db>] kobj_attr_store+0x1b/0x30 [21795.442514] [<c11e3a4b>] sysfs_write_file+0xab/0x100 [21795.445088] [<c11e39a0>] ? sysfs_poll+0xa0/0xa0 [21795.447659] [<c1179655>] vfs_write+0xa5/0x1c0 [21795.450212] [<c1179af7>] SyS_write+0x57/0xa0 [21795.452699] [<c1699ec1>] sysenter_do_call+0x12/0x32 [21795.455146] ---[ end trace faf5321baba2bfdb ]---
To fix this, call the iwl_mvm_free_nd() function in case of any error during resume. Additionally, rename the "out_unlock" label to err to make it clearer that it's only called in error conditions.
--- drivers/net/wireless/iwlwifi/mvm/d3.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/mvm/d3.c +5 -4
@@ -1870,15 +1870,15 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)/* get the BSS vif pointer again */ vif =iwl_mvm_get_bss_vif (mvm);if (IS_ERR_OR_NULL (vif)) - goto out_unlock; + goto err; ret =iwl_trans_d3_resume (mvm->trans, &d3_status, test);if (ret) - goto out_unlock; + goto err;if (d3_status !=IWL_D3_STATUS_ALIVE ) {IWL_INFO (mvm,"Device was reset during suspend\n" ); - goto out_unlock; + goto err; }/* query SRAM first in case we want event logging */
@@ -1904,7 +1904,8 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) goto out_iterate; } - out_unlock: +err: +iwl_mvm_free_nd (mvm);mutex_unlock (&mvm->mutex); out_iterate:
Signature · 1 line
2.1.4
PATCH 10/10 iwlwifi: mvm: avoid use-after-free on iwl_mvm_d0i3_enable_tx()
In reply to Grumbach, EmmanuelFrom: Eliad Peller <[email protected]>
qos_seq points (to a struct) inside the command response data.
Make sure to free the response only after qos_seq is not needed anymore.
--- drivers/net/wireless/iwlwifi/mvm/ops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/mvm/ops.c +4 -2
@@ -1263,11 +1263,13 @@ static void iwl_mvm_d0i3_exit_work(struct work_struct *wk)ieee80211_iterate_active_interfaces ( mvm->hw,IEEE80211_IFACE_ITER_NORMAL , iwl_mvm_d0i3_disconnect_iter, mvm); - -iwl_free_resp (&get_status_cmd); out:iwl_mvm_d0i3_enable_tx (mvm, qos_seq); +/* qos_seq might point inside resp_pkt, so free it only now */ +if (get_status_cmd.resp_pkt) +iwl_free_resp (&get_status_cmd); +/* the FW might have updated the regdomain */ iwl_mvm_update_changed_regdom (mvm);
Signature · 1 line
2.1.4
Quoted 4 lines · Emmanuel
I am aware that this pull request is quite large for 4.1, but I really think that all these patches are really justified. A few of them fix 3165 and 8260 which will be supported starting from 4.1. Other patches fix random bugs that were discovered just now.
There are few problematic ones which I want to comment just for the future:
iwlwifi: nvm: force mac from otp in case nvm mac is reserved
iwlwifi: mvm: BT Coex - duplicate the command if sent ASYNC
The commit log for these two above don't really describe the bug they are fixing and leave me guessing. I would feel much safer to pull if there's a clear description of the user visible bug.
iwlwifi: pcie: don't disable the busmaster DMA clock for family 8000
I feel that this is a bit borderline at this stage (we are in practise rc5/rc6 phase which is very late), it's not really fixing any crashers or other major functionality problems. But as it's a small patch I guess it's ok.
Quoted 10 lines
Note that my availability is limited in the next week, but I'll try to handle any issues you may have ASAP.
The following changes since commit
e7afe89fd67d40a7f5fff8130c5f925d99a94b1f:iwlwifi: mvm: force quota update update after FW restart (2015-04-28 15:02:25 +0300)
are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git tags/iwlwifi-for-kalle-2015-05-21
Thanks, pulled.
Signature · 1 line
Kalle Valo