From fc0c66ddb9338932f86036eda9e15e7a91ebd629 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 19 Apr 2018 00:01:09 +0100 Subject: [PATCH] ath9k_htc: Fix regression in 4.15, thanks to Ben Caradoc-Davies (Closes: #891060) - mac80211: add ieee80211_hw flag for QoS NDP support - ath9k_htc: use non-QoS NDP for AP probing --- debian/changelog | 4 ++ ...k_htc-use-non-qos-ndp-for-ap-probing.patch | 31 ++++++++ ...ieee8211_hw-flag-for-qos-ndp-support.patch | 71 +++++++++++++++++++ debian/patches/series | 2 + 4 files changed, 108 insertions(+) create mode 100644 debian/patches/bugfix/all/ath9k_htc-use-non-qos-ndp-for-ap-probing.patch create mode 100644 debian/patches/bugfix/all/mac80211-add-ieee8211_hw-flag-for-qos-ndp-support.patch diff --git a/debian/changelog b/debian/changelog index f4f82f43b..3e09763d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -512,6 +512,10 @@ linux (4.15.17-1) UNRELEASED; urgency=medium * [x86] net: Enable THUNDERBOLT_NET as module (Closes: #894310) * [x86] platform: Enable DELL_SMBIOS_SMM, DELL_SMBIOS_WMI as modules (closes: #893976) + * ath9k_htc: Fix regression in 4.15, thanks to Ben Caradoc-Davies + (Closes: #891060) + - mac80211: add ieee80211_hw flag for QoS NDP support + - ath9k_htc: use non-QoS NDP for AP probing [ Vagrant Cascadian ] * [armhf] Add patch to fix loading of imx6q-cpufreq module. diff --git a/debian/patches/bugfix/all/ath9k_htc-use-non-qos-ndp-for-ap-probing.patch b/debian/patches/bugfix/all/ath9k_htc-use-non-qos-ndp-for-ap-probing.patch new file mode 100644 index 000000000..a9ee008de --- /dev/null +++ b/debian/patches/bugfix/all/ath9k_htc-use-non-qos-ndp-for-ap-probing.patch @@ -0,0 +1,31 @@ +From: Johannes Berg +Date: Wed, 21 Mar 2018 11:00:14 +0100 +Subject: ath9k_htc: use non-QoS NDP for AP probing +Origin: https://git.kernel.org/linus/60b01bcce97191f473fa869df2713143936d6ef4 +Bug-Debian: https://bugs.debian.org/891060 + +When switching mac80211 to use QoS NDP, it turned out that +ath9k_htc is somehow broken by this, e.g. see +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891060. + +Fix this by using the new mac80211 flag to go back to the +old, incorrect, behaviour for this driver. + +Fixes: 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") +Reported-by: Ben Caradoc-Davies +Acked-by: Kalle Valo +Signed-off-by: Johannes Berg +--- + drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c +@@ -729,6 +729,7 @@ static void ath9k_set_hw_capab(struct at + ieee80211_hw_set(hw, SPECTRUM_MGMT); + ieee80211_hw_set(hw, SIGNAL_DBM); + ieee80211_hw_set(hw, AMPDU_AGGREGATION); ++ ieee80211_hw_set(hw, DOESNT_SUPPORT_QOS_NDP); + + if (ath9k_ps_enable) + ieee80211_hw_set(hw, SUPPORTS_PS); diff --git a/debian/patches/bugfix/all/mac80211-add-ieee8211_hw-flag-for-qos-ndp-support.patch b/debian/patches/bugfix/all/mac80211-add-ieee8211_hw-flag-for-qos-ndp-support.patch new file mode 100644 index 000000000..fddd85e7e --- /dev/null +++ b/debian/patches/bugfix/all/mac80211-add-ieee8211_hw-flag-for-qos-ndp-support.patch @@ -0,0 +1,71 @@ +From: Ben Caradoc-Davies +Date: Mon, 19 Mar 2018 12:57:44 +1300 +Subject: mac80211: add ieee80211_hw flag for QoS NDP support +Origin: https://git.kernel.org/linus/7c181f4fcdc62e5dc7a87fd33387d322262c3b52 +Bug-Debian: https://bugs.debian.org/891060 + +(Backport to v4.15.4) + +Commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") added an +argument qos_ok to ieee80211_nullfunc_get to support QoS NDP. Despite +the claim in the commit log "Change all the drivers to *not* allow +QoS NDP for now, even though it looks like most of them should be OK +with that", this commit enables QoS NDP in response to beacons (see +change to mlme.c:ieee80211_send_nullfunc), causing ath9k_htc to lose +IP connectivity. See: +https://patchwork.kernel.org/patch/10241109/ +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891060 + +Introduce a hardware flag to allow such buggy drivers to override the +correct default behaviour of mac80211 of sending QoS NDP packets. + +Signed-off-by: Ben Caradoc-Davies +Signed-off-by: Johannes Berg +--- + include/net/mac80211.h | 4 ++++ + net/mac80211/debugfs.c | 1 + + net/mac80211/mlme.c | 3 ++- + 3 files changed, 7 insertions(+), 1 deletion(-) + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -2056,6 +2056,9 @@ struct ieee80211_txq { + * The stack will not do fragmentation. + * The callback for @set_frag_threshold should be set as well. + * ++ * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't ++ * support QoS NDP for AP probing - that's most likely a driver bug. ++ * + * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays + */ + enum ieee80211_hw_flags { +@@ -2098,6 +2101,7 @@ enum ieee80211_hw_flags { + IEEE80211_HW_TX_FRAG_LIST, + IEEE80211_HW_REPORTS_LOW_ACK, + IEEE80211_HW_SUPPORTS_TX_FRAG, ++ IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP, + + /* keep last, obviously */ + NUM_IEEE80211_HW_FLAGS +--- a/net/mac80211/debugfs.c ++++ b/net/mac80211/debugfs.c +@@ -211,6 +211,7 @@ static const char *hw_flag_names[] = { + FLAG(TX_FRAG_LIST), + FLAG(REPORTS_LOW_ACK), + FLAG(SUPPORTS_TX_FRAG), ++ FLAG(DOESNT_SUPPORT_QOS_NDP), + #undef FLAG + }; + +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -895,7 +895,8 @@ void ieee80211_send_nullfunc(struct ieee + struct ieee80211_hdr_3addr *nullfunc; + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; + +- skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif, true); ++ skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif, ++ !ieee80211_hw_check(&local->hw, DOESNT_SUPPORT_QOS_NDP)); + if (!skb) + return; + diff --git a/debian/patches/series b/debian/patches/series index d37ebb640..9793ab535 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -79,6 +79,8 @@ bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch +bugfix/all/mac80211-add-ieee8211_hw-flag-for-qos-ndp-support.patch +bugfix/all/ath9k_htc-use-non-qos-ndp-for-ap-probing.patch # Miscellaneous features