From 31108c42d587c7c83e7476ded324ba96d08556b0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 5 Jun 2013 12:42:33 -0700 Subject: [PATCH] 3.9-stable patches added patches: ath9k-use-correct-otp-register-offsets-for-ar9550.patch cfg80211-check-wdev-netdev-in-connection-work.patch iwlwifi-dvm-fix-zero-lq-cmd-sending-avoidance.patch iwlwifi-mvm-tell-firmware-to-let-multicast-frames-in.patch mac80211-close-ap_vlan-interfaces-before-unregistering-all.patch mac80211-fix-direct-probe-auth.patch --- ...rect-otp-register-offsets-for-ar9550.patch | 95 ++++++++++++++++ ...check-wdev-netdev-in-connection-work.patch | 34 ++++++ ...vm-fix-zero-lq-cmd-sending-avoidance.patch | 40 +++++++ ...-firmware-to-let-multicast-frames-in.patch | 106 ++++++++++++++++++ ...-interfaces-before-unregistering-all.patch | 46 ++++++++ .../mac80211-fix-direct-probe-auth.patch | 78 +++++++++++++ queue-3.9/series | 6 + 7 files changed, 405 insertions(+) create mode 100644 queue-3.9/ath9k-use-correct-otp-register-offsets-for-ar9550.patch create mode 100644 queue-3.9/cfg80211-check-wdev-netdev-in-connection-work.patch create mode 100644 queue-3.9/iwlwifi-dvm-fix-zero-lq-cmd-sending-avoidance.patch create mode 100644 queue-3.9/iwlwifi-mvm-tell-firmware-to-let-multicast-frames-in.patch create mode 100644 queue-3.9/mac80211-close-ap_vlan-interfaces-before-unregistering-all.patch create mode 100644 queue-3.9/mac80211-fix-direct-probe-auth.patch diff --git a/queue-3.9/ath9k-use-correct-otp-register-offsets-for-ar9550.patch b/queue-3.9/ath9k-use-correct-otp-register-offsets-for-ar9550.patch new file mode 100644 index 00000000000..b510a97b9b2 --- /dev/null +++ b/queue-3.9/ath9k-use-correct-otp-register-offsets-for-ar9550.patch @@ -0,0 +1,95 @@ +From add295a4afbdf5852d004c754c552d692b0fcac8 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Tue, 28 May 2013 14:52:19 +0200 +Subject: ath9k: use correct OTP register offsets for AR9550 + +From: Gabor Juhos + +commit add295a4afbdf5852d004c754c552d692b0fcac8 upstream. + +Accessing the OTP memory on AR9950 causes a data bus +like this: + + Data bus error, epc == 801f7774, ra == 801f7774 + Oops[#1]: + CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.0-rc3 #592 + task: 87c28000 ti: 87c22000 task.ti: 87c22000 + $ 0 : 00000000 00000061 deadc0de 00000000 + $ 4 : b8115f18 00015f18 00000007 00000004 + $ 8 : 00000001 7c7c3c7c 7c7c7c7c 7c7c7c7c + $12 : 7c7c3c7c 80320a68 00000000 7c7c7c3c + $16 : 87cd8010 00015f18 00000007 00000000 + $20 : 00000064 00000004 87c23c7c 8035210c + $24 : 00000000 801f3674 + $28 : 87c22000 87c23b48 00000001 801f7774 + Hi : 00000000 + Lo : 00000064 + epc : 801f7774 ath9k_hw_wait+0x58/0xb0 + Not tainted + ra : 801f7774 ath9k_hw_wait+0x58/0xb0 + Status: 1000cc03 KERNEL EXL IE + Cause : 4080801c + PrId : 00019750 (MIPS 74Kc) + Modules linked in: + Process swapper (pid: 1, threadinfo=87c22000, task=87c28000, ts=00000000) + Stack : 0000000f 00000061 00002710 8006240c 00000001 87cd8010 87c23bb0 87cd8010 + 00000000 00000004 00000003 80210c7c 000000b3 67fa8000 0000032a 000006fe + 000003e8 00000002 00000028 87c23bf0 000003ff 80210d24 803e5630 80210e28 + 00000000 00000007 87cd8010 00007044 00000004 00000061 000003ff 000001ff + 87c26000 87cd8010 00000220 87cd8bb8 80210000 8020fcf4 87c22000 87c23c08 + ... + Call Trace: + [<801f7774>] ath9k_hw_wait+0x58/0xb0 + [<80210c7c>] ar9300_otp_read_word+0x80/0xd4 + [<80210d24>] ar9300_read_otp+0x54/0xb0 + [<8020fcf4>] ar9300_check_eeprom_header+0x1c/0x40 + [<80210fe4>] ath9k_hw_ar9300_fill_eeprom+0x118/0x39c + [<80206650>] ath9k_hw_eeprom_init+0x74/0xb4 + [<801f96d0>] ath9k_hw_init+0x7ec/0x96c + [<801e65ec>] ath9k_init_device+0x340/0x758 + [<801f35d0>] ath_ahb_probe+0x21c/0x2c0 + [<801c041c>] driver_probe_device+0xc0/0x1e4 + [<801c05ac>] __driver_attach+0x6c/0xa4 + [<801bea08>] bus_for_each_dev+0x64/0xa8 + [<801bfa40>] bus_add_driver+0xcc/0x24c + [<801c0954>] driver_register+0xbc/0x17c + [<803f8fc0>] ath9k_init+0x5c/0x88 + [<800608fc>] do_one_initcall+0xec/0x1a0 + [<803e6a68>] kernel_init_freeable+0x13c/0x200 + [<80309cdc>] kernel_init+0x1c/0xe4 + [<80062450>] ret_from_kernel_thread+0x10/0x18 + +On the AR9550, the OTP registers are located at +the same address as on the AR9340. Use the correct +values to avoid the error. + +Signed-off-by: Gabor Juhos +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h ++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +@@ -68,13 +68,16 @@ + #define AR9300_BASE_ADDR 0x3ff + #define AR9300_BASE_ADDR_512 0x1ff + +-#define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000) +-#define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18) ++#define AR9300_OTP_BASE \ ++ ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) ++#define AR9300_OTP_STATUS \ ++ ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18) + #define AR9300_OTP_STATUS_TYPE 0x7 + #define AR9300_OTP_STATUS_VALID 0x4 + #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 + #define AR9300_OTP_STATUS_SM_BUSY 0x1 +-#define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c) ++#define AR9300_OTP_READ_DATA \ ++ ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c) + + enum targetPowerHTRates { + HT_TARGET_RATE_0_8_16, diff --git a/queue-3.9/cfg80211-check-wdev-netdev-in-connection-work.patch b/queue-3.9/cfg80211-check-wdev-netdev-in-connection-work.patch new file mode 100644 index 00000000000..1f633c9efe2 --- /dev/null +++ b/queue-3.9/cfg80211-check-wdev-netdev-in-connection-work.patch @@ -0,0 +1,34 @@ +From c815797663b72e3ac1736f1886538152bc48e4af Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Thu, 23 May 2013 18:10:21 +0200 +Subject: cfg80211: check wdev->netdev in connection work + +From: Johannes Berg + +commit c815797663b72e3ac1736f1886538152bc48e4af upstream. + +If a P2P-Device is present and another virtual interface triggers +the connection work, the system crash because it tries to check +if the P2P-Device's netdev (which doesn't exist) is up. Skip any +wdevs that have no netdev to fix this. + +Reported-by: YanBo +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/wireless/sme.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/wireless/sme.c ++++ b/net/wireless/sme.c +@@ -227,6 +227,9 @@ void cfg80211_conn_work(struct work_stru + mutex_lock(&rdev->sched_scan_mtx); + + list_for_each_entry(wdev, &rdev->wdev_list, list) { ++ if (!wdev->netdev) ++ continue; ++ + wdev_lock(wdev); + if (!netif_running(wdev->netdev)) { + wdev_unlock(wdev); diff --git a/queue-3.9/iwlwifi-dvm-fix-zero-lq-cmd-sending-avoidance.patch b/queue-3.9/iwlwifi-dvm-fix-zero-lq-cmd-sending-avoidance.patch new file mode 100644 index 00000000000..6a6caf0b647 --- /dev/null +++ b/queue-3.9/iwlwifi-dvm-fix-zero-lq-cmd-sending-avoidance.patch @@ -0,0 +1,40 @@ +From a87783699b23395c46bbeeb5d28f6db24897bf26 Mon Sep 17 00:00:00 2001 +From: Emmanuel Grumbach +Date: Wed, 22 May 2013 10:48:10 +0300 +Subject: iwlwifi: dvm: fix zero LQ CMD sending avoidance + +From: Emmanuel Grumbach + +commit a87783699b23395c46bbeeb5d28f6db24897bf26 upstream. + +In 63b77bf489881747c5118476918cc8c29378ee63 + + iwlwifi: dvm: don't send zeroed LQ cmd + +I tried to avoid to send zeroed LQ cmd, but I made a (very) +stupid mistake in the memcmp. +Since this patch has been ported to stable, the fix should +go to stable too. + +This fixes https://bugzilla.kernel.org/show_bug.cgi?id=58341 + +Reported-by: Hinnerk van Bruinehsen +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/iwlwifi/dvm/sta.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/iwlwifi/dvm/sta.c ++++ b/drivers/net/wireless/iwlwifi/dvm/sta.c +@@ -735,7 +735,7 @@ void iwl_restore_stations(struct iwl_pri + memcpy(&lq, priv->stations[i].lq, + sizeof(struct iwl_link_quality_cmd)); + +- if (!memcmp(&lq, &zero_lq, sizeof(lq))) ++ if (memcmp(&lq, &zero_lq, sizeof(lq))) + send_lq = true; + } + spin_unlock_bh(&priv->sta_lock); diff --git a/queue-3.9/iwlwifi-mvm-tell-firmware-to-let-multicast-frames-in.patch b/queue-3.9/iwlwifi-mvm-tell-firmware-to-let-multicast-frames-in.patch new file mode 100644 index 00000000000..ead45050155 --- /dev/null +++ b/queue-3.9/iwlwifi-mvm-tell-firmware-to-let-multicast-frames-in.patch @@ -0,0 +1,106 @@ +From 51b6b9e029e81c857f9d8d17060f499cd25febdb Mon Sep 17 00:00:00 2001 +From: Emmanuel Grumbach +Date: Thu, 2 May 2013 15:01:24 +0300 +Subject: iwlwifi: mvm: tell firmware to let multicast frames in + +From: Emmanuel Grumbach + +commit 51b6b9e029e81c857f9d8d17060f499cd25febdb upstream. + +Without this command, the firmware will filter out all the +multicast frames. Let them all in as for now. Later we will +want to optimize this to save power. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Johannes Berg +Signed-off-by: Lingzhu Xiang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/iwlwifi/mvm/fw-api.h | 27 +++++++++++++++++++++++++++ + drivers/net/wireless/iwlwifi/mvm/mac80211.c | 15 +++++++++++++++ + drivers/net/wireless/iwlwifi/mvm/ops.c | 1 + + 3 files changed, 43 insertions(+) + +--- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h ++++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h +@@ -165,6 +165,8 @@ enum { + REPLY_DEBUG_CMD = 0xf0, + DEBUG_LOG_MSG = 0xf7, + ++ MCAST_FILTER_CMD = 0xd0, ++ + /* D3 commands/notifications */ + D3_CONFIG_CMD = 0xd3, + PROT_OFFLOAD_CONFIG_CMD = 0xd4, +@@ -951,4 +953,29 @@ struct iwl_set_calib_default_cmd { + u8 data[0]; + } __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */ + ++#define MAX_PORT_ID_NUM 2 ++ ++/** ++ * struct iwl_mcast_filter_cmd - configure multicast filter. ++ * @filter_own: Set 1 to filter out multicast packets sent by station itself ++ * @port_id: Multicast MAC addresses array specifier. This is a strange way ++ * to identify network interface adopted in host-device IF. ++ * It is used by FW as index in array of addresses. This array has ++ * MAX_PORT_ID_NUM members. ++ * @count: Number of MAC addresses in the array ++ * @pass_all: Set 1 to pass all multicast packets. ++ * @bssid: current association BSSID. ++ * @addr_list: Place holder for array of MAC addresses. ++ * IMPORTANT: add padding if necessary to ensure DWORD alignment. ++ */ ++struct iwl_mcast_filter_cmd { ++ u8 filter_own; ++ u8 port_id; ++ u8 count; ++ u8 pass_all; ++ u8 bssid[6]; ++ u8 reserved[2]; ++ u8 addr_list[0]; ++} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */ ++ + #endif /* __fw_api_h__ */ +--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c +@@ -657,6 +657,20 @@ static void iwl_mvm_configure_filter(str + *total_flags = 0; + } + ++static int iwl_mvm_configure_mcast_filter(struct iwl_mvm *mvm, ++ struct ieee80211_vif *vif) ++{ ++ struct iwl_mcast_filter_cmd mcast_filter_cmd = { ++ .pass_all = 1, ++ }; ++ ++ memcpy(mcast_filter_cmd.bssid, vif->bss_conf.bssid, ETH_ALEN); ++ ++ return iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_SYNC, ++ sizeof(mcast_filter_cmd), ++ &mcast_filter_cmd); ++} ++ + static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct ieee80211_bss_conf *bss_conf, +@@ -677,6 +691,7 @@ static void iwl_mvm_bss_info_changed_sta + IWL_ERR(mvm, "failed to update quotas\n"); + return; + } ++ iwl_mvm_configure_mcast_filter(mvm, vif); + } else if (mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { + /* remove AP station now that the MAC is unassoc */ + ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id); +--- a/drivers/net/wireless/iwlwifi/mvm/ops.c ++++ b/drivers/net/wireless/iwlwifi/mvm/ops.c +@@ -293,6 +293,7 @@ static const char *iwl_mvm_cmd_strings[R + CMD(NET_DETECT_PROFILES_CMD), + CMD(NET_DETECT_HOTSPOTS_CMD), + CMD(NET_DETECT_HOTSPOTS_QUERY_CMD), ++ CMD(MCAST_FILTER_CMD), + }; + #undef CMD + diff --git a/queue-3.9/mac80211-close-ap_vlan-interfaces-before-unregistering-all.patch b/queue-3.9/mac80211-close-ap_vlan-interfaces-before-unregistering-all.patch new file mode 100644 index 00000000000..af457be9097 --- /dev/null +++ b/queue-3.9/mac80211-close-ap_vlan-interfaces-before-unregistering-all.patch @@ -0,0 +1,46 @@ +From c8aa22db0112f640ac6631347f850879c621840b Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Fri, 24 May 2013 01:06:09 +0200 +Subject: mac80211: close AP_VLAN interfaces before unregistering all + +From: Johannes Berg + +commit c8aa22db0112f640ac6631347f850879c621840b upstream. + +Since Eric's commit efe117ab8 ("Speedup ieee80211_remove_interfaces") +there's a bug in mac80211 when it unregisters with AP_VLAN interfaces +up. If the AP_VLAN interface was registered after the AP it belongs +to (which is the typical case) and then we get into this code path, +unregister_netdevice_many() will crash because it isn't prepared to +deal with interfaces being closed in the middle of it. Exactly this +happens though, because we iterate the list, find the AP master this +AP_VLAN belongs to and dev_close() the dependent VLANs. After this, +unregister_netdevice_many() won't pick up the fact that the AP_VLAN +is already down and will do it again, causing a crash. + +Signed-off-by: Johannes Berg +Cc: Eric Dumazet +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/iface.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1649,6 +1649,15 @@ void ieee80211_remove_interfaces(struct + + ASSERT_RTNL(); + ++ /* ++ * Close all AP_VLAN interfaces first, as otherwise they ++ * might be closed while the AP interface they belong to ++ * is closed, causing unregister_netdevice_many() to crash. ++ */ ++ list_for_each_entry(sdata, &local->interfaces, list) ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) ++ dev_close(sdata->dev); ++ + mutex_lock(&local->iflist_mtx); + list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { + list_del(&sdata->list); diff --git a/queue-3.9/mac80211-fix-direct-probe-auth.patch b/queue-3.9/mac80211-fix-direct-probe-auth.patch new file mode 100644 index 00000000000..00b2f3a6659 --- /dev/null +++ b/queue-3.9/mac80211-fix-direct-probe-auth.patch @@ -0,0 +1,78 @@ +From 6211dd12da609bc6893b9c3182630b494737ec4b Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka +Date: Fri, 17 May 2013 13:43:04 +0200 +Subject: mac80211: fix direct probe auth + +From: Stanislaw Gruszka + +commit 6211dd12da609bc6893b9c3182630b494737ec4b upstream. + +We send direct probe to broadcast address, as some APs do not respond to +unicast PROBE frames when unassociated. Broadcast frames are not acked, +so we can not use that for trigger MLME state machine, but we need to +use old timeout mechanism. + +This fixes authentication timed out like below: + +[ 1024.671974] wlan6: authenticate with 54:e6:fc:98:63:fe +[ 1024.694125] wlan6: direct probe to 54:e6:fc:98:63:fe (try 1/3) +[ 1024.695450] wlan6: direct probe to 54:e6:fc:98:63:fe (try 2/3) +[ 1024.700586] wlan6: send auth to 54:e6:fc:98:63:fe (try 3/3) +[ 1024.701441] wlan6: authentication with 54:e6:fc:98:63:fe timed out + +With fix, we have: + +[ 4524.198978] wlan6: authenticate with 54:e6:fc:98:63:fe +[ 4524.220692] wlan6: direct probe to 54:e6:fc:98:63:fe (try 1/3) +[ 4524.421784] wlan6: send auth to 54:e6:fc:98:63:fe (try 2/3) +[ 4524.423272] wlan6: authenticated +[ 4524.423811] wlan6: associate with 54:e6:fc:98:63:fe (try 1/3) +[ 4524.427492] wlan6: RX AssocResp from 54:e6:fc:98:63:fe (capab=0x431 status=0 aid=1) + +Signed-off-by: Stanislaw Gruszka +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/mlme.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -3182,10 +3182,6 @@ static int ieee80211_probe_auth(struct i + if (WARN_ON_ONCE(!auth_data)) + return -EINVAL; + +- if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) +- tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | +- IEEE80211_TX_INTFL_MLME_CONN_TX; +- + auth_data->tries++; + + if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { +@@ -3219,6 +3215,10 @@ static int ieee80211_probe_auth(struct i + auth_data->expected_transaction = trans; + } + ++ if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) ++ tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | ++ IEEE80211_TX_INTFL_MLME_CONN_TX; ++ + ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, + auth_data->data, auth_data->data_len, + auth_data->bss->bssid, +@@ -3242,12 +3242,12 @@ static int ieee80211_probe_auth(struct i + * will not answer to direct packet in unassociated state. + */ + ieee80211_send_probe_req(sdata, NULL, ssidie + 2, ssidie[1], +- NULL, 0, (u32) -1, true, tx_flags, ++ NULL, 0, (u32) -1, true, 0, + auth_data->bss->channel, false); + rcu_read_unlock(); + } + +- if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) { ++ if (tx_flags == 0) { + auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; + ifmgd->auth_data->timeout_started = true; + run_again(ifmgd, auth_data->timeout); diff --git a/queue-3.9/series b/queue-3.9/series index eb20beaa3e6..e505157ffe3 100644 --- a/queue-3.9/series +++ b/queue-3.9/series @@ -103,3 +103,9 @@ iommu-amd-workaround-for-erbt1312.patch acpi-pm-allow-device-power-states-to-be-used-for-config_pm-unset.patch acpi-video-add-asus-ul30a-to-acpi-video-detect-blacklist.patch drm-nvc0-ce-disable-ce1-on-a-number-of-chipsets.patch +mac80211-fix-direct-probe-auth.patch +mac80211-close-ap_vlan-interfaces-before-unregistering-all.patch +iwlwifi-dvm-fix-zero-lq-cmd-sending-avoidance.patch +iwlwifi-mvm-tell-firmware-to-let-multicast-frames-in.patch +cfg80211-check-wdev-netdev-in-connection-work.patch +ath9k-use-correct-otp-register-offsets-for-ar9550.patch -- 2.47.3