From 63a9d9cc83f61d1a326c66a1c198b47cae169d9b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 22 Jan 2021 14:53:00 +0100 Subject: [PATCH] 5.4-stable patches added patches: mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch spi-cadence-cache-reference-clock-rate-during-probe.patch --- ...disabled-in-__ieee80211_schedule_txq.patch | 39 ++++++++++++++ ...-nulldata-packets-on-encrypted-links.patch | 36 +++++++++++++ queue-5.4/series | 3 ++ ...he-reference-clock-rate-during-probe.patch | 53 +++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 queue-5.4/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch create mode 100644 queue-5.4/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch create mode 100644 queue-5.4/spi-cadence-cache-reference-clock-rate-during-probe.patch diff --git a/queue-5.4/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch b/queue-5.4/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch new file mode 100644 index 00000000000..db6641df792 --- /dev/null +++ b/queue-5.4/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch @@ -0,0 +1,39 @@ +From c13cf5c159660451c8fbdc37efb998b198e1d305 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 26 Dec 2020 10:39:08 +0100 +Subject: mac80211: check if atf has been disabled in __ieee80211_schedule_txq +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lorenzo Bianconi + +commit c13cf5c159660451c8fbdc37efb998b198e1d305 upstream. + +Check if atf has been disabled in __ieee80211_schedule_txq() in order to +avoid a given sta is always put to the beginning of the active_txqs list +and never moved to the end since deficit is not decremented in +ieee80211_sta_register_airtime() + +Fixes: b4809e9484da1 ("mac80211: Add airtime accounting and scheduling to TXQs") +Signed-off-by: Lorenzo Bianconi +Acked-by: Toke Høiland-Jørgensen +Link: https://lore.kernel.org/r/93889406c50f1416214c079ca0b8c9faecc5143e.1608975195.git.lorenzo@kernel.org +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/tx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3773,7 +3773,7 @@ void __ieee80211_schedule_txq(struct iee + * get immediately moved to the back of the list on the next + * call to ieee80211_next_txq(). + */ +- if (txqi->txq.sta && ++ if (txqi->txq.sta && local->airtime_flags && + wiphy_ext_feature_isset(local->hw.wiphy, + NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) + list_add(&txqi->schedule_order, diff --git a/queue-5.4/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch b/queue-5.4/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch new file mode 100644 index 00000000000..0fb13e125e2 --- /dev/null +++ b/queue-5.4/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch @@ -0,0 +1,36 @@ +From 2463ec86cd0338a2c2edbfb0b9d50c52ff76ff43 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 18 Dec 2020 20:15:25 +0100 +Subject: mac80211: do not drop tx nulldata packets on encrypted links + +From: Felix Fietkau + +commit 2463ec86cd0338a2c2edbfb0b9d50c52ff76ff43 upstream. + +ieee80211_tx_h_select_key drops any non-mgmt packets without a key when +encryption is used. This is wrong for nulldata packets that can't be +encrypted and are sent out for probing clients and indicating 4-address +mode. + +Reported-by: Sebastian Gottschall +Fixes: a0761a301746 ("mac80211: drop data frames without key on encrypted links") +Signed-off-by: Felix Fietkau +Link: https://lore.kernel.org/r/20201218191525.1168-1-nbd@nbd.name +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/tx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -657,7 +657,7 @@ ieee80211_tx_h_select_key(struct ieee802 + if (!skip_hw && tx->key && + tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) + info->control.hw_key = &tx->key->conf; +- } else if (!ieee80211_is_mgmt(hdr->frame_control) && tx->sta && ++ } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta && + test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { + return TX_DROP; + } diff --git a/queue-5.4/series b/queue-5.4/series index 2a73a244794..ccdfc8d90ba 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -28,3 +28,6 @@ net-avoid-32-x-truesize-under-estimation-for-tiny-skbs.patch rxrpc-fix-handling-of-an-unsupported-token-type-in-rxrpc_read.patch net-sctp-filter-remap-copy_from_user-failure-error.patch tipc-fix-null-deref-in-tipc_link_xmit.patch +mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch +mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch +spi-cadence-cache-reference-clock-rate-during-probe.patch diff --git a/queue-5.4/spi-cadence-cache-reference-clock-rate-during-probe.patch b/queue-5.4/spi-cadence-cache-reference-clock-rate-during-probe.patch new file mode 100644 index 00000000000..34a3d276f6f --- /dev/null +++ b/queue-5.4/spi-cadence-cache-reference-clock-rate-during-probe.patch @@ -0,0 +1,53 @@ +From 4d163ad79b155c71bf30366dc38f8d2502f78844 Mon Sep 17 00:00:00 2001 +From: Michael Hennerich +Date: Thu, 14 Jan 2021 17:42:17 +0200 +Subject: spi: cadence: cache reference clock rate during probe + +From: Michael Hennerich + +commit 4d163ad79b155c71bf30366dc38f8d2502f78844 upstream. + +The issue is that using SPI from a callback under the CCF lock will +deadlock, since this code uses clk_get_rate(). + +Fixes: c474b38665463 ("spi: Add driver for Cadence SPI controller") +Signed-off-by: Michael Hennerich +Signed-off-by: Alexandru Ardelean +Link: https://lore.kernel.org/r/20210114154217.51996-1-alexandru.ardelean@analog.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-cadence.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-cadence.c ++++ b/drivers/spi/spi-cadence.c +@@ -115,6 +115,7 @@ struct cdns_spi { + void __iomem *regs; + struct clk *ref_clk; + struct clk *pclk; ++ unsigned int clk_rate; + u32 speed_hz; + const u8 *txbuf; + u8 *rxbuf; +@@ -250,7 +251,7 @@ static void cdns_spi_config_clock_freq(s + u32 ctrl_reg, baud_rate_val; + unsigned long frequency; + +- frequency = clk_get_rate(xspi->ref_clk); ++ frequency = xspi->clk_rate; + + ctrl_reg = cdns_spi_read(xspi, CDNS_SPI_CR); + +@@ -558,8 +559,9 @@ static int cdns_spi_probe(struct platfor + master->auto_runtime_pm = true; + master->mode_bits = SPI_CPOL | SPI_CPHA; + ++ xspi->clk_rate = clk_get_rate(xspi->ref_clk); + /* Set to default valid value */ +- master->max_speed_hz = clk_get_rate(xspi->ref_clk) / 4; ++ master->max_speed_hz = xspi->clk_rate / 4; + xspi->speed_hz = master->max_speed_hz; + + master->bits_per_word_mask = SPI_BPW_MASK(8); -- 2.47.2