From ee6a84176f91fb7b14dd5f2efbfb66d83d430727 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 11 Apr 2021 23:51:17 -0400 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- ...amd-xgbe-update-dma-coherency-values.patch | 42 +++++++ ...b01-set-vmmc-supply-for-both-sd-inte.patch | 45 ++++++++ ...nxi-sun4i-codec-fill-asoc-card-owner.patch | 83 ++++++++++++++ ...wrong-bclk-and-lrclk-with-pll-enable.patch | 54 +++++++++ ...lid-usage-of-list-cursor-in-register.patch | 88 ++++++++++++++ ...d-usage-of-list-cursor-in-unregister.patch | 107 ++++++++++++++++++ ...ecting-sge_qbase-regs-during-traffic.patch | 83 ++++++++++++++ ...dle-error-code-at-mac-address-change.patch | 39 +++++++ ...d-asym_pause-to-supported-link-modes.patch | 41 +++++++ ...l-oops-when-i40e-driver-removes-vf-s.patch | 84 ++++++++++++++ .../net-mlx5-fix-pbmc-register-mapping.patch | 37 ++++++ ...ix-placement-of-log_max_flow_counter.patch | 44 +++++++ ...oid-channel_monitor-hrtimer-deadlock.patch | 76 +++++++++++++ ...x-a-double-free-in-tipc_sk_mcast_rcv.patch | 44 +++++++ ...e-sequence-counter-per-network-names.patch | 104 +++++++++++++++++ ...-for-ipv6-address-properly-while-des.patch | 39 +++++++ ...71mwv-fix-avs-and-dvfs-voltage-range.patch | 50 ++++++++ ...-inline-assembly-register-clobbering.patch | 46 ++++++++ ...ff-by-one-checks-in-red_check_params.patch | 73 ++++++++++++ queue-4.19/series | 22 ++++ ...fix-conflicting-alignment-attributes.patch | 44 +++++++ ...he-position-of-debug_work_activate-i.patch | 46 ++++++++ ...ix-ipv4-pmtu-check-to-honor-ip-heade.patch | 48 ++++++++ 23 files changed, 1339 insertions(+) create mode 100644 queue-4.19/amd-xgbe-update-dma-coherency-values.patch create mode 100644 queue-4.19/arm-dts-imx6-pbab01-set-vmmc-supply-for-both-sd-inte.patch create mode 100644 queue-4.19/asoc-sunxi-sun4i-codec-fill-asoc-card-owner.patch create mode 100644 queue-4.19/asoc-wm8960-fix-wrong-bclk-and-lrclk-with-pll-enable.patch create mode 100644 queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-register.patch create mode 100644 queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-unregister.patch create mode 100644 queue-4.19/cxgb4-avoid-collecting-sge_qbase-regs-during-traffic.patch create mode 100644 queue-4.19/gianfar-handle-error-code-at-mac-address-change.patch create mode 100644 queue-4.19/i40e-added-asym_pause-to-supported-link-modes.patch create mode 100644 queue-4.19/i40e-fix-kernel-oops-when-i40e-driver-removes-vf-s.patch create mode 100644 queue-4.19/net-mlx5-fix-pbmc-register-mapping.patch create mode 100644 queue-4.19/net-mlx5-fix-placement-of-log_max_flow_counter.patch create mode 100644 queue-4.19/net-ncsi-avoid-channel_monitor-hrtimer-deadlock.patch create mode 100644 queue-4.19/net-tipc-fix-a-double-free-in-tipc_sk_mcast_rcv.patch create mode 100644 queue-4.19/net-xfrm-localize-sequence-counter-per-network-names.patch create mode 100644 queue-4.19/rdma-cxgb4-check-for-ipv6-address-properly-while-des.patch create mode 100644 queue-4.19/regulator-bd9571mwv-fix-avs-and-dvfs-voltage-range.patch create mode 100644 queue-4.19/s390-cpcmd-fix-inline-assembly-register-clobbering.patch create mode 100644 queue-4.19/sch_red-fix-off-by-one-checks-in-red_check_params.patch create mode 100644 queue-4.19/soc-fsl-qbman-fix-conflicting-alignment-attributes.patch create mode 100644 queue-4.19/workqueue-move-the-position-of-debug_work_activate-i.patch create mode 100644 queue-4.19/xfrm-interface-fix-ipv4-pmtu-check-to-honor-ip-heade.patch diff --git a/queue-4.19/amd-xgbe-update-dma-coherency-values.patch b/queue-4.19/amd-xgbe-update-dma-coherency-values.patch new file mode 100644 index 00000000000..1f9a0dcda5b --- /dev/null +++ b/queue-4.19/amd-xgbe-update-dma-coherency-values.patch @@ -0,0 +1,42 @@ +From 4de8f54ec8207075ead632c34ca6ef8f1ad99433 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Mar 2021 08:39:12 +0530 +Subject: amd-xgbe: Update DMA coherency values + +From: Shyam Sundar S K + +[ Upstream commit d75135082698140a26a56defe1bbc1b06f26a41f ] + +Based on the IOMMU configuration, the current cache control settings can +result in possible coherency issues. The hardware team has recommended +new settings for the PCI device path to eliminate the issue. + +Fixes: 6f595959c095 ("amd-xgbe: Adjust register settings to improve performance") +Signed-off-by: Shyam Sundar S K +Acked-by: Tom Lendacky +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/amd/xgbe/xgbe.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h +index 47bcbcf58048..0c93a552b921 100644 +--- a/drivers/net/ethernet/amd/xgbe/xgbe.h ++++ b/drivers/net/ethernet/amd/xgbe/xgbe.h +@@ -181,9 +181,9 @@ + #define XGBE_DMA_SYS_AWCR 0x30303030 + + /* DMA cache settings - PCI device */ +-#define XGBE_DMA_PCI_ARCR 0x00000003 +-#define XGBE_DMA_PCI_AWCR 0x13131313 +-#define XGBE_DMA_PCI_AWARCR 0x00000313 ++#define XGBE_DMA_PCI_ARCR 0x000f0f0f ++#define XGBE_DMA_PCI_AWCR 0x0f0f0f0f ++#define XGBE_DMA_PCI_AWARCR 0x00000f0f + + /* DMA channel interrupt modes */ + #define XGBE_IRQ_MODE_EDGE 0 +-- +2.30.2 + diff --git a/queue-4.19/arm-dts-imx6-pbab01-set-vmmc-supply-for-both-sd-inte.patch b/queue-4.19/arm-dts-imx6-pbab01-set-vmmc-supply-for-both-sd-inte.patch new file mode 100644 index 00000000000..145de9d2a32 --- /dev/null +++ b/queue-4.19/arm-dts-imx6-pbab01-set-vmmc-supply-for-both-sd-inte.patch @@ -0,0 +1,45 @@ +From 48f968d2302118192fc8dc46089c6e69d0dabcc7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Mar 2021 15:01:03 +0200 +Subject: ARM: dts: imx6: pbab01: Set vmmc supply for both SD interfaces + +From: Stefan Riedmueller + +[ Upstream commit f57011e72f5fe0421ec7a812beb1b57bdf4bb47f ] + +Setting the vmmc supplies is crucial since otherwise the supplying +regulators get disabled and the SD interfaces are no longer powered +which leads to system failures if the system is booted from that SD +interface. + +Fixes: 1e44d3f880d5 ("ARM i.MX6Q: dts: Enable I2C1 with EEPROM and PMIC on Phytec phyFLEX-i.MX6 Ouad module") +Signed-off-by: Stefan Riedmueller +Reviewed-by: Fabio Estevam +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi +index fe4e89d773f5..9499d113b139 100644 +--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi ++++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi +@@ -423,6 +423,7 @@ + pinctrl-0 = <&pinctrl_usdhc2>; + cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + wp-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; ++ vmmc-supply = <&vdd_sd1_reg>; + status = "disabled"; + }; + +@@ -432,5 +433,6 @@ + &pinctrl_usdhc3_cdwp>; + cd-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; + wp-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; ++ vmmc-supply = <&vdd_sd0_reg>; + status = "disabled"; + }; +-- +2.30.2 + diff --git a/queue-4.19/asoc-sunxi-sun4i-codec-fill-asoc-card-owner.patch b/queue-4.19/asoc-sunxi-sun4i-codec-fill-asoc-card-owner.patch new file mode 100644 index 00000000000..f52a40f0baf --- /dev/null +++ b/queue-4.19/asoc-sunxi-sun4i-codec-fill-asoc-card-owner.patch @@ -0,0 +1,83 @@ +From c4be5fa7c9645e9222d6184ff3b55cc5437fbe4f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Mar 2021 17:18:43 +0200 +Subject: ASoC: sunxi: sun4i-codec: fill ASoC card owner + +From: Bastian Germann + +[ Upstream commit 7c0d6e482062eb5c06ecccfab340abc523bdca00 ] + +card->owner is a required property and since commit 81033c6b584b ("ALSA: +core: Warn on empty module") a warning is issued if it is empty. Add it. +This fixes following warning observed on Lamobo R1: + +WARNING: CPU: 1 PID: 190 at sound/core/init.c:207 snd_card_new+0x430/0x480 [snd] +Modules linked in: sun4i_codec(E+) sun4i_backend(E+) snd_soc_core(E) ... +CPU: 1 PID: 190 Comm: systemd-udevd Tainted: G C E 5.10.0-1-armmp #1 Debian 5.10.4-1 +Hardware name: Allwinner sun7i (A20) Family +Call trace: + (snd_card_new [snd]) + (snd_soc_bind_card [snd_soc_core]) + (snd_soc_register_card [snd_soc_core]) + (sun4i_codec_probe [sun4i_codec]) + +Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip codec on early Allwinner SoCs") +Related: commit 3c27ea23ffb4 ("ASoC: qcom: Set card->owner to avoid warnings") +Related: commit ec653df2a0cb ("drm/vc4/vc4_hdmi: fill ASoC card owner") +Cc: linux-arm-kernel@lists.infradead.org +Cc: alsa-devel@alsa-project.org +Signed-off-by: Bastian Germann +Link: https://lore.kernel.org/r/20210331151843.30583-1-bage@linutronix.de +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sunxi/sun4i-codec.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c +index 9a3cb7704810..16e8f74288a5 100644 +--- a/sound/soc/sunxi/sun4i-codec.c ++++ b/sound/soc/sunxi/sun4i-codec.c +@@ -1235,6 +1235,7 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) + return ERR_PTR(-ENOMEM); + + card->dev = dev; ++ card->owner = THIS_MODULE; + card->name = "sun4i-codec"; + card->dapm_widgets = sun4i_codec_card_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(sun4i_codec_card_dapm_widgets); +@@ -1267,6 +1268,7 @@ static struct snd_soc_card *sun6i_codec_create_card(struct device *dev) + return ERR_PTR(-ENOMEM); + + card->dev = dev; ++ card->owner = THIS_MODULE; + card->name = "A31 Audio Codec"; + card->dapm_widgets = sun6i_codec_card_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(sun6i_codec_card_dapm_widgets); +@@ -1320,6 +1322,7 @@ static struct snd_soc_card *sun8i_a23_codec_create_card(struct device *dev) + return ERR_PTR(-ENOMEM); + + card->dev = dev; ++ card->owner = THIS_MODULE; + card->name = "A23 Audio Codec"; + card->dapm_widgets = sun6i_codec_card_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(sun6i_codec_card_dapm_widgets); +@@ -1358,6 +1361,7 @@ static struct snd_soc_card *sun8i_h3_codec_create_card(struct device *dev) + return ERR_PTR(-ENOMEM); + + card->dev = dev; ++ card->owner = THIS_MODULE; + card->name = "H3 Audio Codec"; + card->dapm_widgets = sun6i_codec_card_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(sun6i_codec_card_dapm_widgets); +@@ -1396,6 +1400,7 @@ static struct snd_soc_card *sun8i_v3s_codec_create_card(struct device *dev) + return ERR_PTR(-ENOMEM); + + card->dev = dev; ++ card->owner = THIS_MODULE; + card->name = "V3s Audio Codec"; + card->dapm_widgets = sun6i_codec_card_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(sun6i_codec_card_dapm_widgets); +-- +2.30.2 + diff --git a/queue-4.19/asoc-wm8960-fix-wrong-bclk-and-lrclk-with-pll-enable.patch b/queue-4.19/asoc-wm8960-fix-wrong-bclk-and-lrclk-with-pll-enable.patch new file mode 100644 index 00000000000..4082cdcb501 --- /dev/null +++ b/queue-4.19/asoc-wm8960-fix-wrong-bclk-and-lrclk-with-pll-enable.patch @@ -0,0 +1,54 @@ +From c1171ae2e6ddb8ab9323c1f6fe7da2ca6e5d240b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Mar 2021 18:48:46 +0800 +Subject: ASoC: wm8960: Fix wrong bclk and lrclk with pll enabled for some + chips + +From: Shengjiu Wang + +[ Upstream commit 16b82e75c15a7dbd564ea3654f3feb61df9e1e6f ] + +The input MCLK is 12.288MHz, the desired output sysclk is 11.2896MHz +and sample rate is 44100Hz, with the configuration pllprescale=2, +postscale=sysclkdiv=1, some chip may have wrong bclk +and lrclk output with pll enabled in master mode, but with the +configuration pllprescale=1, postscale=2, the output clock is correct. + +>From Datasheet, the PLL performs best when f2 is between +90MHz and 100MHz when the desired sysclk output is 11.2896MHz +or 12.288MHz, so sysclkdiv = 2 (f2/8) is the best choice. + +So search available sysclk_divs from 2 to 1 other than from 1 to 2. + +Fixes: 84fdc00d519f ("ASoC: codec: wm9860: Refactor PLL out freq search") +Signed-off-by: Shengjiu Wang +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/1616150926-22892-1-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm8960.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c +index c4c00297ada6..88e869d16714 100644 +--- a/sound/soc/codecs/wm8960.c ++++ b/sound/soc/codecs/wm8960.c +@@ -710,7 +710,13 @@ int wm8960_configure_pll(struct snd_soc_component *component, int freq_in, + best_freq_out = -EINVAL; + *sysclk_idx = *dac_idx = *bclk_idx = -1; + +- for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) { ++ /* ++ * From Datasheet, the PLL performs best when f2 is between ++ * 90MHz and 100MHz, the desired sysclk output is 11.2896MHz ++ * or 12.288MHz, then sysclkdiv = 2 is the best choice. ++ * So search sysclk_divs from 2 to 1 other than from 1 to 2. ++ */ ++ for (i = ARRAY_SIZE(sysclk_divs) - 1; i >= 0; --i) { + if (sysclk_divs[i] == -1) + continue; + for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) { +-- +2.30.2 + diff --git a/queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-register.patch b/queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-register.patch new file mode 100644 index 00000000000..2a66703830a --- /dev/null +++ b/queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-register.patch @@ -0,0 +1,88 @@ +From 0d9717d546f893ea39a3a195870eefd7b4d48d67 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Apr 2021 00:51:48 +0200 +Subject: clk: fix invalid usage of list cursor in register + +From: Lukasz Bartosik + +[ Upstream commit 8d3c0c01cb2e36b2bf3c06a82b18b228d0c8f5d0 ] + +Fix invalid usage of a list_for_each_entry cursor in +clk_notifier_register(). When list is empty or if the list +is completely traversed (without breaking from the loop on one +of the entries) then the list cursor does not point to a valid +entry and therefore should not be used. + +The issue was dicovered when running 5.12-rc1 kernel on x86_64 +with KASAN enabled: +BUG: KASAN: global-out-of-bounds in clk_notifier_register+0xab/0x230 +Read of size 8 at addr ffffffffa0d10588 by task swapper/0/1 + +CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc1 #1 +Hardware name: Google Caroline/Caroline, +BIOS Google_Caroline.7820.430.0 07/20/2018 +Call Trace: + dump_stack+0xee/0x15c + print_address_description+0x1e/0x2dc + kasan_report+0x188/0x1ce + ? clk_notifier_register+0xab/0x230 + ? clk_prepare_lock+0x15/0x7b + ? clk_notifier_register+0xab/0x230 + clk_notifier_register+0xab/0x230 + dw8250_probe+0xc01/0x10d4 +... +Memory state around the buggy address: + ffffffffa0d10480: 00 00 00 00 00 03 f9 f9 f9 f9 f9 f9 00 00 00 00 + ffffffffa0d10500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 +>ffffffffa0d10580: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 + ^ + ffffffffa0d10600: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 + ffffffffa0d10680: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00 + ================================================================== + +Fixes: b2476490ef11 ("clk: introduce the common clock framework") +Reported-by: Lukasz Majczak +Signed-off-by: Lukasz Bartosik +Link: https://lore.kernel.org/r/20210401225149.18826-1-lb@semihalf.com +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/clk.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c +index c5cf9e77fe86..7bb1c6185f20 100644 +--- a/drivers/clk/clk.c ++++ b/drivers/clk/clk.c +@@ -3628,20 +3628,19 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb) + /* search the list of notifiers for this clk */ + list_for_each_entry(cn, &clk_notifier_list, node) + if (cn->clk == clk) +- break; ++ goto found; + + /* if clk wasn't in the notifier list, allocate new clk_notifier */ +- if (cn->clk != clk) { +- cn = kzalloc(sizeof(*cn), GFP_KERNEL); +- if (!cn) +- goto out; ++ cn = kzalloc(sizeof(*cn), GFP_KERNEL); ++ if (!cn) ++ goto out; + +- cn->clk = clk; +- srcu_init_notifier_head(&cn->notifier_head); ++ cn->clk = clk; ++ srcu_init_notifier_head(&cn->notifier_head); + +- list_add(&cn->node, &clk_notifier_list); +- } ++ list_add(&cn->node, &clk_notifier_list); + ++found: + ret = srcu_notifier_chain_register(&cn->notifier_head, nb); + + clk->core->notifier_count++; +-- +2.30.2 + diff --git a/queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-unregister.patch b/queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-unregister.patch new file mode 100644 index 00000000000..dc9c3541153 --- /dev/null +++ b/queue-4.19/clk-fix-invalid-usage-of-list-cursor-in-unregister.patch @@ -0,0 +1,107 @@ +From 9f80ce161519a6c881c5a06b7e0e845a47cb9b54 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Apr 2021 00:51:49 +0200 +Subject: clk: fix invalid usage of list cursor in unregister + +From: Lukasz Bartosik + +[ Upstream commit 7045465500e465b09f09d6e5bdc260a9f1aab97b ] + +Fix invalid usage of a list_for_each_entry cursor in +clk_notifier_unregister(). When list is empty or if the list +is completely traversed (without breaking from the loop on one +of the entries) then the list cursor does not point to a valid +entry and therefore should not be used. The patch fixes a logical +bug that hasn't been seen in pratice however it is analogus +to the bug fixed in clk_notifier_register(). + +The issue was dicovered when running 5.12-rc1 kernel on x86_64 +with KASAN enabled: +BUG: KASAN: global-out-of-bounds in clk_notifier_register+0xab/0x230 +Read of size 8 at addr ffffffffa0d10588 by task swapper/0/1 + +CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc1 #1 +Hardware name: Google Caroline/Caroline, +BIOS Google_Caroline.7820.430.0 07/20/2018 +Call Trace: + dump_stack+0xee/0x15c + print_address_description+0x1e/0x2dc + kasan_report+0x188/0x1ce + ? clk_notifier_register+0xab/0x230 + ? clk_prepare_lock+0x15/0x7b + ? clk_notifier_register+0xab/0x230 + clk_notifier_register+0xab/0x230 + dw8250_probe+0xc01/0x10d4 + ... + Memory state around the buggy address: + ffffffffa0d10480: 00 00 00 00 00 03 f9 f9 f9 f9 f9 f9 00 00 00 00 + ffffffffa0d10500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 + >ffffffffa0d10580: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 + ^ + ffffffffa0d10600: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 + ffffffffa0d10680: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00 + ================================================================== + +Fixes: b2476490ef11 ("clk: introduce the common clock framework") +Reported-by: Lukasz Majczak +Signed-off-by: Lukasz Bartosik +Link: https://lore.kernel.org/r/20210401225149.18826-2-lb@semihalf.com +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/clk.c | 30 +++++++++++++----------------- + 1 file changed, 13 insertions(+), 17 deletions(-) + +diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c +index 7bb1c6185f20..3806fd8fef0b 100644 +--- a/drivers/clk/clk.c ++++ b/drivers/clk/clk.c +@@ -3665,32 +3665,28 @@ EXPORT_SYMBOL_GPL(clk_notifier_register); + */ + int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb) + { +- struct clk_notifier *cn = NULL; +- int ret = -EINVAL; ++ struct clk_notifier *cn; ++ int ret = -ENOENT; + + if (!clk || !nb) + return -EINVAL; + + clk_prepare_lock(); + +- list_for_each_entry(cn, &clk_notifier_list, node) +- if (cn->clk == clk) +- break; +- +- if (cn->clk == clk) { +- ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); ++ list_for_each_entry(cn, &clk_notifier_list, node) { ++ if (cn->clk == clk) { ++ ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); + +- clk->core->notifier_count--; ++ clk->core->notifier_count--; + +- /* XXX the notifier code should handle this better */ +- if (!cn->notifier_head.head) { +- srcu_cleanup_notifier_head(&cn->notifier_head); +- list_del(&cn->node); +- kfree(cn); ++ /* XXX the notifier code should handle this better */ ++ if (!cn->notifier_head.head) { ++ srcu_cleanup_notifier_head(&cn->notifier_head); ++ list_del(&cn->node); ++ kfree(cn); ++ } ++ break; + } +- +- } else { +- ret = -ENOENT; + } + + clk_prepare_unlock(); +-- +2.30.2 + diff --git a/queue-4.19/cxgb4-avoid-collecting-sge_qbase-regs-during-traffic.patch b/queue-4.19/cxgb4-avoid-collecting-sge_qbase-regs-during-traffic.patch new file mode 100644 index 00000000000..da591e44b81 --- /dev/null +++ b/queue-4.19/cxgb4-avoid-collecting-sge_qbase-regs-during-traffic.patch @@ -0,0 +1,83 @@ +From 85801dbd06868b1db1e42144f39a9039d608012f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 27 Mar 2021 23:49:08 +0530 +Subject: cxgb4: avoid collecting SGE_QBASE regs during traffic + +From: Rahul Lakkireddy + +[ Upstream commit 1bfb3dea965ff9f6226fd1709338f227363b6061 ] + +Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX registers can lead +to SGE missing doorbells under heavy traffic. So, only collect them +when adapter is idle. Also update the regdump range to skip collecting +these registers. + +Fixes: 80a95a80d358 ("cxgb4: collect SGE PF/VF queue map") +Signed-off-by: Rahul Lakkireddy +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + .../net/ethernet/chelsio/cxgb4/cudbg_lib.c | 23 +++++++++++++++---- + drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 ++- + 2 files changed, 21 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +index c91e155c147c..544c88f19f24 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +@@ -1400,11 +1400,25 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, + struct cudbg_buffer temp_buff = { 0 }; + struct sge_qbase_reg_field *sge_qbase; + struct ireg_buf *ch_sge_dbg; ++ u8 padap_running = 0; + int i, rc; ++ u32 size; + +- rc = cudbg_get_buff(pdbg_init, dbg_buff, +- sizeof(*ch_sge_dbg) * 2 + sizeof(*sge_qbase), +- &temp_buff); ++ /* Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX regs can ++ * lead to SGE missing doorbells under heavy traffic. So, only ++ * collect them when adapter is idle. ++ */ ++ for_each_port(padap, i) { ++ padap_running = netif_running(padap->port[i]); ++ if (padap_running) ++ break; ++ } ++ ++ size = sizeof(*ch_sge_dbg) * 2; ++ if (!padap_running) ++ size += sizeof(*sge_qbase); ++ ++ rc = cudbg_get_buff(pdbg_init, dbg_buff, size, &temp_buff); + if (rc) + return rc; + +@@ -1426,7 +1440,8 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, + ch_sge_dbg++; + } + +- if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5) { ++ if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5 && ++ !padap_running) { + sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg; + /* 1 addr reg SGE_QBASE_INDEX and 4 data reg + * SGE_QBASE_MAP[0-3] +diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +index abc2a66754bd..812f4b743d97 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +@@ -2093,7 +2093,8 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size) + 0x1190, 0x1194, + 0x11a0, 0x11a4, + 0x11b0, 0x11b4, +- 0x11fc, 0x1274, ++ 0x11fc, 0x123c, ++ 0x1254, 0x1274, + 0x1280, 0x133c, + 0x1800, 0x18fc, + 0x3000, 0x302c, +-- +2.30.2 + diff --git a/queue-4.19/gianfar-handle-error-code-at-mac-address-change.patch b/queue-4.19/gianfar-handle-error-code-at-mac-address-change.patch new file mode 100644 index 00000000000..551ad64037b --- /dev/null +++ b/queue-4.19/gianfar-handle-error-code-at-mac-address-change.patch @@ -0,0 +1,39 @@ +From c0e2ae8c77b0471ef95a1e5c5fa4aa64acefdf5f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Mar 2021 17:08:47 +0300 +Subject: gianfar: Handle error code at MAC address change + +From: Claudiu Manoil + +[ Upstream commit bff5b62585123823842833ab20b1c0a7fa437f8c ] + +Handle return error code of eth_mac_addr(); + +Fixes: 3d23a05c75c7 ("gianfar: Enable changing mac addr when if up") +Signed-off-by: Claudiu Manoil +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/freescale/gianfar.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c +index df03cf63cb02..4feab06b7ad7 100644 +--- a/drivers/net/ethernet/freescale/gianfar.c ++++ b/drivers/net/ethernet/freescale/gianfar.c +@@ -485,7 +485,11 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev) + + static int gfar_set_mac_addr(struct net_device *dev, void *p) + { +- eth_mac_addr(dev, p); ++ int ret; ++ ++ ret = eth_mac_addr(dev, p); ++ if (ret) ++ return ret; + + gfar_set_mac_for_addr(dev, 0, dev->dev_addr); + +-- +2.30.2 + diff --git a/queue-4.19/i40e-added-asym_pause-to-supported-link-modes.patch b/queue-4.19/i40e-added-asym_pause-to-supported-link-modes.patch new file mode 100644 index 00000000000..75c8532860f --- /dev/null +++ b/queue-4.19/i40e-added-asym_pause-to-supported-link-modes.patch @@ -0,0 +1,41 @@ +From 855e899e956b50f377dd55688c32a41942e3ec13 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Jan 2021 15:00:02 +0000 +Subject: i40e: Added Asym_Pause to supported link modes + +From: Mateusz Palczewski + +[ Upstream commit 90449e98c265296329446c7abcd2aae3b20c0bc9 ] + +Add Asym_Pause to supported link modes (it is supported by HW). +Lack of Asym_Pause in supported modes can cause several problems, +i.e. it won't be possible to turn the autonegotiation on +with asymmetric pause settings (i.e. Tx on, Rx off). + +Fixes: 4e91bcd5d47a ("i40e: Finish implementation of ethtool get settings") +Signed-off-by: Dawid Lukwinski +Signed-off-by: Mateusz Palczewski +Reviewed-by: Aleksandr Loktionov +Reviewed-by: Przemyslaw Patynowski +Tested-by: Tony Brelinski +Signed-off-by: Tony Nguyen +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +index a6b0f605a7d8..9148d93c5c63 100644 +--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c ++++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +@@ -796,6 +796,7 @@ static int i40e_get_link_ksettings(struct net_device *netdev, + + /* Set flow control settings */ + ethtool_link_ksettings_add_link_mode(ks, supported, Pause); ++ ethtool_link_ksettings_add_link_mode(ks, supported, Asym_Pause); + + switch (hw->fc.requested_mode) { + case I40E_FC_FULL: +-- +2.30.2 + diff --git a/queue-4.19/i40e-fix-kernel-oops-when-i40e-driver-removes-vf-s.patch b/queue-4.19/i40e-fix-kernel-oops-when-i40e-driver-removes-vf-s.patch new file mode 100644 index 00000000000..6926e52c142 --- /dev/null +++ b/queue-4.19/i40e-fix-kernel-oops-when-i40e-driver-removes-vf-s.patch @@ -0,0 +1,84 @@ +From fc1330662f31bb0c56d96935964f4e36d69e9025 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Feb 2021 11:15:26 +0000 +Subject: i40e: Fix kernel oops when i40e driver removes VF's + +From: Eryk Rybak + +[ Upstream commit 347b5650cd158d1d953487cc2bec567af5c5bf96 ] + +Fix the reason of kernel oops when i40e driver removed VFs. +Added new __I40E_VFS_RELEASING state to signalize releasing +process by PF, that it makes possible to exit of reset VF procedure. +Without this patch, it is possible to suspend the VFs reset by +releasing VFs resources procedure. Retrying the reset after the +timeout works on the freed VF memory causing a kernel oops. + +Fixes: d43d60e5eb95 ("i40e: ensure reset occurs when disabling VF") +Signed-off-by: Eryk Rybak +Signed-off-by: Grzegorz Szczurek +Reviewed-by: Aleksandr Loktionov +Tested-by: Konrad Jankowski +Signed-off-by: Tony Nguyen +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/i40e/i40e.h | 1 + + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 9 +++++++++ + 2 files changed, 10 insertions(+) + +diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h +index 738acba7a9a3..3c921dfc2056 100644 +--- a/drivers/net/ethernet/intel/i40e/i40e.h ++++ b/drivers/net/ethernet/intel/i40e/i40e.h +@@ -149,6 +149,7 @@ enum i40e_state_t { + __I40E_CLIENT_L2_CHANGE, + __I40E_CLIENT_RESET, + __I40E_VF_RESETS_DISABLED, /* disable resets during i40e_remove */ ++ __I40E_VFS_RELEASING, + /* This must be last as it determines the size of the BITMAP */ + __I40E_STATE_SIZE__, + }; +diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +index 5d782148d35f..3c1533c627fd 100644 +--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c ++++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +@@ -137,6 +137,7 @@ void i40e_vc_notify_vf_reset(struct i40e_vf *vf) + **/ + static inline void i40e_vc_disable_vf(struct i40e_vf *vf) + { ++ struct i40e_pf *pf = vf->pf; + int i; + + i40e_vc_notify_vf_reset(vf); +@@ -147,6 +148,11 @@ static inline void i40e_vc_disable_vf(struct i40e_vf *vf) + * ensure a reset. + */ + for (i = 0; i < 20; i++) { ++ /* If PF is in VFs releasing state reset VF is impossible, ++ * so leave it. ++ */ ++ if (test_bit(__I40E_VFS_RELEASING, pf->state)) ++ return; + if (i40e_reset_vf(vf, false)) + return; + usleep_range(10000, 20000); +@@ -1381,6 +1387,8 @@ void i40e_free_vfs(struct i40e_pf *pf) + + if (!pf->vf) + return; ++ ++ set_bit(__I40E_VFS_RELEASING, pf->state); + while (test_and_set_bit(__I40E_VF_DISABLE, pf->state)) + usleep_range(1000, 2000); + +@@ -1438,6 +1446,7 @@ void i40e_free_vfs(struct i40e_pf *pf) + } + } + clear_bit(__I40E_VF_DISABLE, pf->state); ++ clear_bit(__I40E_VFS_RELEASING, pf->state); + } + + #ifdef CONFIG_PCI_IOV +-- +2.30.2 + diff --git a/queue-4.19/net-mlx5-fix-pbmc-register-mapping.patch b/queue-4.19/net-mlx5-fix-pbmc-register-mapping.patch new file mode 100644 index 00000000000..b279650e412 --- /dev/null +++ b/queue-4.19/net-mlx5-fix-pbmc-register-mapping.patch @@ -0,0 +1,37 @@ +From 476d9105c4e135412a76d5f6c539fc6f6b5b8d82 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 12:55:00 +0300 +Subject: net/mlx5: Fix PBMC register mapping + +From: Aya Levin + +[ Upstream commit 534b1204ca4694db1093b15cf3e79a99fcb6a6da ] + +Add reserved mapping to cover all the register in order to avoid setting +arbitrary values to newer FW which implements the reserved fields. + +Fixes: 50b4a3c23646 ("net/mlx5: PPTB and PBMC register firmware command support") +Signed-off-by: Aya Levin +Reviewed-by: Moshe Shemesh +Signed-off-by: Saeed Mahameed +Signed-off-by: Sasha Levin +--- + include/linux/mlx5/mlx5_ifc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h +index b8cd93240287..5f711b2983db 100644 +--- a/include/linux/mlx5/mlx5_ifc.h ++++ b/include/linux/mlx5/mlx5_ifc.h +@@ -8929,7 +8929,7 @@ struct mlx5_ifc_pbmc_reg_bits { + + struct mlx5_ifc_bufferx_reg_bits buffer[10]; + +- u8 reserved_at_2e0[0x40]; ++ u8 reserved_at_2e0[0x80]; + }; + + struct mlx5_ifc_qtct_reg_bits { +-- +2.30.2 + diff --git a/queue-4.19/net-mlx5-fix-placement-of-log_max_flow_counter.patch b/queue-4.19/net-mlx5-fix-placement-of-log_max_flow_counter.patch new file mode 100644 index 00000000000..8bc1731c0ec --- /dev/null +++ b/queue-4.19/net-mlx5-fix-placement-of-log_max_flow_counter.patch @@ -0,0 +1,44 @@ +From b87b9929751045fb460836bba8798eade20322a8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Jan 2021 16:01:37 +0200 +Subject: net/mlx5: Fix placement of log_max_flow_counter + +From: Raed Salem + +[ Upstream commit a14587dfc5ad2312dabdd42a610d80ecd0dc8bea ] + +The cited commit wrongly placed log_max_flow_counter field of +mlx5_ifc_flow_table_prop_layout_bits, align it to the HW spec intended +placement. + +Fixes: 16f1c5bb3ed7 ("net/mlx5: Check device capability for maximum flow counters") +Signed-off-by: Raed Salem +Reviewed-by: Roi Dayan +Signed-off-by: Saeed Mahameed +Signed-off-by: Sasha Levin +--- + include/linux/mlx5/mlx5_ifc.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h +index b87b1569d15b..b8cd93240287 100644 +--- a/include/linux/mlx5/mlx5_ifc.h ++++ b/include/linux/mlx5/mlx5_ifc.h +@@ -357,11 +357,11 @@ struct mlx5_ifc_flow_table_prop_layout_bits { + u8 reserved_at_60[0x18]; + u8 log_max_ft_num[0x8]; + +- u8 reserved_at_80[0x18]; ++ u8 reserved_at_80[0x10]; ++ u8 log_max_flow_counter[0x8]; + u8 log_max_destination[0x8]; + +- u8 log_max_flow_counter[0x8]; +- u8 reserved_at_a8[0x10]; ++ u8 reserved_at_a0[0x18]; + u8 log_max_flow[0x8]; + + u8 reserved_at_c0[0x40]; +-- +2.30.2 + diff --git a/queue-4.19/net-ncsi-avoid-channel_monitor-hrtimer-deadlock.patch b/queue-4.19/net-ncsi-avoid-channel_monitor-hrtimer-deadlock.patch new file mode 100644 index 00000000000..45bc728be34 --- /dev/null +++ b/queue-4.19/net-ncsi-avoid-channel_monitor-hrtimer-deadlock.patch @@ -0,0 +1,76 @@ +From 2f919ca63377e150bc0decc8b04db433701c78de Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Mar 2021 10:20:39 -0500 +Subject: net/ncsi: Avoid channel_monitor hrtimer deadlock + +From: Milton Miller + +[ Upstream commit 03cb4d05b4ea9a3491674ca40952adb708d549fa ] + +Calling ncsi_stop_channel_monitor from channel_monitor is a guaranteed +deadlock on SMP because stop calls del_timer_sync on the timer that +invoked channel_monitor as its timer function. + +Recognise the inherent race of marking the monitor disabled before +deleting the timer by just returning if enable was cleared. After +a timeout (the default case -- reset to START when response received) +just mark the monitor.enabled false. + +If the channel has an entry on the channel_queue list, or if the +state is not ACTIVE or INACTIVE, then warn and mark the timer stopped +and don't restart, as the locking is broken somehow. + +Fixes: 0795fb2021f0 ("net/ncsi: Stop monitor if channel times out or is inactive") +Signed-off-by: Milton Miller +Signed-off-by: Eddie James +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/ncsi/ncsi-manage.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c +index f65afa7e7d28..9fd20fa90000 100644 +--- a/net/ncsi/ncsi-manage.c ++++ b/net/ncsi/ncsi-manage.c +@@ -84,13 +84,20 @@ static void ncsi_channel_monitor(struct timer_list *t) + monitor_state = nc->monitor.state; + spin_unlock_irqrestore(&nc->lock, flags); + +- if (!enabled || chained) { +- ncsi_stop_channel_monitor(nc); +- return; +- } ++ if (!enabled) ++ return; /* expected race disabling timer */ ++ if (WARN_ON_ONCE(chained)) ++ goto bad_state; ++ + if (state != NCSI_CHANNEL_INACTIVE && + state != NCSI_CHANNEL_ACTIVE) { +- ncsi_stop_channel_monitor(nc); ++bad_state: ++ netdev_warn(ndp->ndev.dev, ++ "Bad NCSI monitor state channel %d 0x%x %s queue\n", ++ nc->id, state, chained ? "on" : "off"); ++ spin_lock_irqsave(&nc->lock, flags); ++ nc->monitor.enabled = false; ++ spin_unlock_irqrestore(&nc->lock, flags); + return; + } + +@@ -117,10 +124,9 @@ static void ncsi_channel_monitor(struct timer_list *t) + ndp->flags |= NCSI_DEV_RESHUFFLE; + } + +- ncsi_stop_channel_monitor(nc); +- + ncm = &nc->modes[NCSI_MODE_LINK]; + spin_lock_irqsave(&nc->lock, flags); ++ nc->monitor.enabled = false; + nc->state = NCSI_CHANNEL_INVISIBLE; + ncm->data[2] &= ~0x1; + spin_unlock_irqrestore(&nc->lock, flags); +-- +2.30.2 + diff --git a/queue-4.19/net-tipc-fix-a-double-free-in-tipc_sk_mcast_rcv.patch b/queue-4.19/net-tipc-fix-a-double-free-in-tipc_sk_mcast_rcv.patch new file mode 100644 index 00000000000..e7e89ce2c6b --- /dev/null +++ b/queue-4.19/net-tipc-fix-a-double-free-in-tipc_sk_mcast_rcv.patch @@ -0,0 +1,44 @@ +From a1a47b595a0107d047b39795dfc0be6fbcc75c0d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Mar 2021 00:30:29 -0700 +Subject: net:tipc: Fix a double free in tipc_sk_mcast_rcv + +From: Lv Yunlong + +[ Upstream commit 6bf24dc0cc0cc43b29ba344b66d78590e687e046 ] + +In the if(skb_peek(arrvq) == skb) branch, it calls __skb_dequeue(arrvq) to get +the skb by skb = skb_peek(arrvq). Then __skb_dequeue() unlinks the skb from arrvq +and returns the skb which equals to skb_peek(arrvq). After __skb_dequeue(arrvq) +finished, the skb is freed by kfree_skb(__skb_dequeue(arrvq)) in the first time. + +Unfortunately, the same skb is freed in the second time by kfree_skb(skb) after +the branch completed. + +My patch removes kfree_skb() in the if(skb_peek(arrvq) == skb) branch, because +this skb will be freed by kfree_skb(skb) finally. + +Fixes: cb1b728096f54 ("tipc: eliminate race condition at multicast reception") +Signed-off-by: Lv Yunlong +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/tipc/socket.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/tipc/socket.c b/net/tipc/socket.c +index 16e2af3a00cc..4c35f9893081 100644 +--- a/net/tipc/socket.c ++++ b/net/tipc/socket.c +@@ -1187,7 +1187,7 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq, + spin_lock_bh(&inputq->lock); + if (skb_peek(arrvq) == skb) { + skb_queue_splice_tail_init(&tmpq, inputq); +- kfree_skb(__skb_dequeue(arrvq)); ++ __skb_dequeue(arrvq); + } + spin_unlock_bh(&inputq->lock); + __skb_queue_purge(&tmpq); +-- +2.30.2 + diff --git a/queue-4.19/net-xfrm-localize-sequence-counter-per-network-names.patch b/queue-4.19/net-xfrm-localize-sequence-counter-per-network-names.patch new file mode 100644 index 00000000000..22068051e3f --- /dev/null +++ b/queue-4.19/net-xfrm-localize-sequence-counter-per-network-names.patch @@ -0,0 +1,104 @@ +From 4f8bec8378035d1eb5e771f868e83f9573b13619 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Mar 2021 11:56:29 +0100 +Subject: net: xfrm: Localize sequence counter per network namespace + +From: Ahmed S. Darwish + +[ Upstream commit e88add19f68191448427a6e4eb059664650a837f ] + +A sequence counter write section must be serialized or its internal +state can get corrupted. The "xfrm_state_hash_generation" seqcount is +global, but its write serialization lock (net->xfrm.xfrm_state_lock) is +instantiated per network namespace. The write protection is thus +insufficient. + +To provide full protection, localize the sequence counter per network +namespace instead. This should be safe as both the seqcount read and +write sections access data exclusively within the network namespace. It +also lays the foundation for transforming "xfrm_state_hash_generation" +data type from seqcount_t to seqcount_LOCKNAME_t in further commits. + +Fixes: b65e3d7be06f ("xfrm: state: add sequence count to detect hash resizes") +Signed-off-by: Ahmed S. Darwish +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +--- + include/net/netns/xfrm.h | 4 +++- + net/xfrm/xfrm_state.c | 10 +++++----- + 2 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h +index 9991e5ef52cc..fbfa59801454 100644 +--- a/include/net/netns/xfrm.h ++++ b/include/net/netns/xfrm.h +@@ -70,7 +70,9 @@ struct netns_xfrm { + #if IS_ENABLED(CONFIG_IPV6) + struct dst_ops xfrm6_dst_ops; + #endif +- spinlock_t xfrm_state_lock; ++ spinlock_t xfrm_state_lock; ++ seqcount_t xfrm_state_hash_generation; ++ + spinlock_t xfrm_policy_lock; + struct mutex xfrm_cfg_mutex; + }; +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c +index 84dea0ad1666..44acc724122b 100644 +--- a/net/xfrm/xfrm_state.c ++++ b/net/xfrm/xfrm_state.c +@@ -41,7 +41,6 @@ static void xfrm_state_gc_task(struct work_struct *work); + */ + + static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024; +-static __read_mostly seqcount_t xfrm_state_hash_generation = SEQCNT_ZERO(xfrm_state_hash_generation); + static struct kmem_cache *xfrm_state_cache __ro_after_init; + + static DECLARE_WORK(xfrm_state_gc_work, xfrm_state_gc_task); +@@ -137,7 +136,7 @@ static void xfrm_hash_resize(struct work_struct *work) + } + + spin_lock_bh(&net->xfrm.xfrm_state_lock); +- write_seqcount_begin(&xfrm_state_hash_generation); ++ write_seqcount_begin(&net->xfrm.xfrm_state_hash_generation); + + nhashmask = (nsize / sizeof(struct hlist_head)) - 1U; + odst = xfrm_state_deref_prot(net->xfrm.state_bydst, net); +@@ -153,7 +152,7 @@ static void xfrm_hash_resize(struct work_struct *work) + rcu_assign_pointer(net->xfrm.state_byspi, nspi); + net->xfrm.state_hmask = nhashmask; + +- write_seqcount_end(&xfrm_state_hash_generation); ++ write_seqcount_end(&net->xfrm.xfrm_state_hash_generation); + spin_unlock_bh(&net->xfrm.xfrm_state_lock); + + osize = (ohashmask + 1) * sizeof(struct hlist_head); +@@ -965,7 +964,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, + + to_put = NULL; + +- sequence = read_seqcount_begin(&xfrm_state_hash_generation); ++ sequence = read_seqcount_begin(&net->xfrm.xfrm_state_hash_generation); + + rcu_read_lock(); + h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family); +@@ -1076,7 +1075,7 @@ out: + if (to_put) + xfrm_state_put(to_put); + +- if (read_seqcount_retry(&xfrm_state_hash_generation, sequence)) { ++ if (read_seqcount_retry(&net->xfrm.xfrm_state_hash_generation, sequence)) { + *err = -EAGAIN; + if (x) { + xfrm_state_put(x); +@@ -2406,6 +2405,7 @@ int __net_init xfrm_state_init(struct net *net) + net->xfrm.state_num = 0; + INIT_WORK(&net->xfrm.state_hash_work, xfrm_hash_resize); + spin_lock_init(&net->xfrm.xfrm_state_lock); ++ seqcount_init(&net->xfrm.xfrm_state_hash_generation); + return 0; + + out_byspi: +-- +2.30.2 + diff --git a/queue-4.19/rdma-cxgb4-check-for-ipv6-address-properly-while-des.patch b/queue-4.19/rdma-cxgb4-check-for-ipv6-address-properly-while-des.patch new file mode 100644 index 00000000000..908a78cb629 --- /dev/null +++ b/queue-4.19/rdma-cxgb4-check-for-ipv6-address-properly-while-des.patch @@ -0,0 +1,39 @@ +From 4823df50cc25e2640f51cd1769c40c49c781b398 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Mar 2021 19:27:15 +0530 +Subject: RDMA/cxgb4: check for ipv6 address properly while destroying listener + +From: Potnuri Bharat Teja + +[ Upstream commit 603c4690b01aaffe3a6c3605a429f6dac39852ae ] + +ipv6 bit is wrongly set by the below which causes fatal adapter lookup +engine errors for ipv4 connections while destroying a listener. Fix it to +properly check the local address for ipv6. + +Fixes: 3408be145a5d ("RDMA/cxgb4: Fix adapter LE hash errors while destroying ipv6 listening server") +Link: https://lore.kernel.org/r/20210331135715.30072-1-bharat@chelsio.com +Signed-off-by: Potnuri Bharat Teja +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/cxgb4/cm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c +index b728a1bf916f..6c1a093b164e 100644 +--- a/drivers/infiniband/hw/cxgb4/cm.c ++++ b/drivers/infiniband/hw/cxgb4/cm.c +@@ -3523,7 +3523,8 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id) + c4iw_init_wr_wait(ep->com.wr_waitp); + err = cxgb4_remove_server( + ep->com.dev->rdev.lldi.ports[0], ep->stid, +- ep->com.dev->rdev.lldi.rxq_ids[0], true); ++ ep->com.dev->rdev.lldi.rxq_ids[0], ++ ep->com.local_addr.ss_family == AF_INET6); + if (err) + goto done; + err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp, +-- +2.30.2 + diff --git a/queue-4.19/regulator-bd9571mwv-fix-avs-and-dvfs-voltage-range.patch b/queue-4.19/regulator-bd9571mwv-fix-avs-and-dvfs-voltage-range.patch new file mode 100644 index 00000000000..8bbfe6c5286 --- /dev/null +++ b/queue-4.19/regulator-bd9571mwv-fix-avs-and-dvfs-voltage-range.patch @@ -0,0 +1,50 @@ +From 0b90307b8a19c5dcaf1682c438c8cc4457aa742c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 12 Mar 2021 14:02:40 +0100 +Subject: regulator: bd9571mwv: Fix AVS and DVFS voltage range + +From: Geert Uytterhoeven + +[ Upstream commit 3b6e7088afc919f5b52e4d2de8501ad34d35b09b ] + +According to Table 30 ("DVFS_MoniVDAC [6:0] Setting Table") in the +BD9571MWV-M Datasheet Rev. 002, the valid voltage range is 600..1100 mV +(settings 0x3c..0x6e). While the lower limit is taken into account (by +setting regulator_desc.linear_min_sel to 0x3c), the upper limit is not. + +Fix this by reducing regulator_desc.n_voltages from 0x80 to 0x6f. + +Fixes: e85c5a153fe237f2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/20210312130242.3390038-2-geert+renesas@glider.be +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/regulator/bd9571mwv-regulator.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c +index 274c5ed7cd73..713730757b14 100644 +--- a/drivers/regulator/bd9571mwv-regulator.c ++++ b/drivers/regulator/bd9571mwv-regulator.c +@@ -132,7 +132,7 @@ static struct regulator_ops vid_ops = { + + static struct regulator_desc regulators[] = { + BD9571MWV_REG("VD09", "vd09", VD09, avs_ops, 0, 0x7f, +- 0x80, 600000, 10000, 0x3c), ++ 0x6f, 600000, 10000, 0x3c), + BD9571MWV_REG("VD18", "vd18", VD18, vid_ops, BD9571MWV_VD18_VID, 0xf, + 16, 1625000, 25000, 0), + BD9571MWV_REG("VD25", "vd25", VD25, vid_ops, BD9571MWV_VD25_VID, 0xf, +@@ -141,7 +141,7 @@ static struct regulator_desc regulators[] = { + 11, 2800000, 100000, 0), + BD9571MWV_REG("DVFS", "dvfs", DVFS, reg_ops, + BD9571MWV_DVFS_MONIVDAC, 0x7f, +- 0x80, 600000, 10000, 0x3c), ++ 0x6f, 600000, 10000, 0x3c), + }; + + #ifdef CONFIG_PM_SLEEP +-- +2.30.2 + diff --git a/queue-4.19/s390-cpcmd-fix-inline-assembly-register-clobbering.patch b/queue-4.19/s390-cpcmd-fix-inline-assembly-register-clobbering.patch new file mode 100644 index 00000000000..f5df59a2acc --- /dev/null +++ b/queue-4.19/s390-cpcmd-fix-inline-assembly-register-clobbering.patch @@ -0,0 +1,46 @@ +From 4ae1eda76c36b2a87a3abc8eab2227e043006985 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Mar 2021 18:35:07 +0200 +Subject: s390/cpcmd: fix inline assembly register clobbering + +From: Alexander Gordeev + +[ Upstream commit 7a2f91441b2c1d81b77c1cd816a4659f4abc9cbe ] + +Register variables initialized using arithmetic. That leads to +kasan instrumentaton code corrupting the registers contents. +Follow GCC guidlines and use temporary variables for assigning +init values to register variables. + +Fixes: 94c12cc7d196 ("[S390] Inline assembly cleanup.") +Signed-off-by: Alexander Gordeev +Acked-by: Ilya Leoshkevich +Link: https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Local-Register-Variables.html +Signed-off-by: Heiko Carstens +Signed-off-by: Sasha Levin +--- + arch/s390/kernel/cpcmd.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c +index af013b4244d3..2da027359798 100644 +--- a/arch/s390/kernel/cpcmd.c ++++ b/arch/s390/kernel/cpcmd.c +@@ -37,10 +37,12 @@ static int diag8_noresponse(int cmdlen) + + static int diag8_response(int cmdlen, char *response, int *rlen) + { ++ unsigned long _cmdlen = cmdlen | 0x40000000L; ++ unsigned long _rlen = *rlen; + register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; + register unsigned long reg3 asm ("3") = (addr_t) response; +- register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L; +- register unsigned long reg5 asm ("5") = *rlen; ++ register unsigned long reg4 asm ("4") = _cmdlen; ++ register unsigned long reg5 asm ("5") = _rlen; + + asm volatile( + " diag %2,%0,0x8\n" +-- +2.30.2 + diff --git a/queue-4.19/sch_red-fix-off-by-one-checks-in-red_check_params.patch b/queue-4.19/sch_red-fix-off-by-one-checks-in-red_check_params.patch new file mode 100644 index 00000000000..47316083f75 --- /dev/null +++ b/queue-4.19/sch_red-fix-off-by-one-checks-in-red_check_params.patch @@ -0,0 +1,73 @@ +From fff80e7b189d3d7c401120c8b4c9459c30a73c7f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Mar 2021 11:14:53 -0700 +Subject: sch_red: fix off-by-one checks in red_check_params() + +From: Eric Dumazet + +[ Upstream commit 3a87571f0ffc51ba3bf3ecdb6032861d0154b164 ] + +This fixes following syzbot report: + +UBSAN: shift-out-of-bounds in ./include/net/red.h:237:23 +shift exponent 32 is too large for 32-bit type 'unsigned int' +CPU: 1 PID: 8418 Comm: syz-executor170 Not tainted 5.12.0-rc4-next-20210324-syzkaller #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + __dump_stack lib/dump_stack.c:79 [inline] + dump_stack+0x141/0x1d7 lib/dump_stack.c:120 + ubsan_epilogue+0xb/0x5a lib/ubsan.c:148 + __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:327 + red_set_parms include/net/red.h:237 [inline] + choke_change.cold+0x3c/0xc8 net/sched/sch_choke.c:414 + qdisc_create+0x475/0x12f0 net/sched/sch_api.c:1247 + tc_modify_qdisc+0x4c8/0x1a50 net/sched/sch_api.c:1663 + rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5553 + netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502 + netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] + netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338 + netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927 + sock_sendmsg_nosec net/socket.c:654 [inline] + sock_sendmsg+0xcf/0x120 net/socket.c:674 + ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350 + ___sys_sendmsg+0xf3/0x170 net/socket.c:2404 + __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433 + do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 + entry_SYSCALL_64_after_hwframe+0x44/0xae +RIP: 0033:0x43f039 +Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 +RSP: 002b:00007ffdfa725168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e +RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f039 +RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000004 +RBP: 0000000000403020 R08: 0000000000400488 R09: 0000000000400488 +R10: 0000000000400488 R11: 0000000000000246 R12: 00000000004030b0 +R13: 0000000000000000 R14: 00000000004ac018 R15: 0000000000400488 + +Fixes: 8afa10cbe281 ("net_sched: red: Avoid illegal values") +Signed-off-by: Eric Dumazet +Reported-by: syzbot +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + include/net/red.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/net/red.h b/include/net/red.h +index 8fe55b8b2fb8..ff07a7cedf68 100644 +--- a/include/net/red.h ++++ b/include/net/red.h +@@ -171,9 +171,9 @@ static inline void red_set_vars(struct red_vars *v) + static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, + u8 Scell_log, u8 *stab) + { +- if (fls(qth_min) + Wlog > 32) ++ if (fls(qth_min) + Wlog >= 32) + return false; +- if (fls(qth_max) + Wlog > 32) ++ if (fls(qth_max) + Wlog >= 32) + return false; + if (Scell_log >= 32) + return false; +-- +2.30.2 + diff --git a/queue-4.19/series b/queue-4.19/series index 694c68aefcc..2c59cfe3fc2 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -26,3 +26,25 @@ usbip-synchronize-event-handler-with-sysfs-code-paths.patch i2c-turn-recovery-error-on-init-to-debug.patch virtio_net-add-xdp-meta-data-support.patch virtio_net-do-not-pull-payload-in-skb-head.patch +xfrm-interface-fix-ipv4-pmtu-check-to-honor-ip-heade.patch +regulator-bd9571mwv-fix-avs-and-dvfs-voltage-range.patch +net-xfrm-localize-sequence-counter-per-network-names.patch +asoc-wm8960-fix-wrong-bclk-and-lrclk-with-pll-enable.patch +i40e-added-asym_pause-to-supported-link-modes.patch +i40e-fix-kernel-oops-when-i40e-driver-removes-vf-s.patch +amd-xgbe-update-dma-coherency-values.patch +sch_red-fix-off-by-one-checks-in-red_check_params.patch +gianfar-handle-error-code-at-mac-address-change.patch +cxgb4-avoid-collecting-sge_qbase-regs-during-traffic.patch +net-tipc-fix-a-double-free-in-tipc_sk_mcast_rcv.patch +arm-dts-imx6-pbab01-set-vmmc-supply-for-both-sd-inte.patch +net-ncsi-avoid-channel_monitor-hrtimer-deadlock.patch +asoc-sunxi-sun4i-codec-fill-asoc-card-owner.patch +soc-fsl-qbman-fix-conflicting-alignment-attributes.patch +clk-fix-invalid-usage-of-list-cursor-in-register.patch +clk-fix-invalid-usage-of-list-cursor-in-unregister.patch +workqueue-move-the-position-of-debug_work_activate-i.patch +s390-cpcmd-fix-inline-assembly-register-clobbering.patch +net-mlx5-fix-placement-of-log_max_flow_counter.patch +net-mlx5-fix-pbmc-register-mapping.patch +rdma-cxgb4-check-for-ipv6-address-properly-while-des.patch diff --git a/queue-4.19/soc-fsl-qbman-fix-conflicting-alignment-attributes.patch b/queue-4.19/soc-fsl-qbman-fix-conflicting-alignment-attributes.patch new file mode 100644 index 00000000000..da3b3e2312b --- /dev/null +++ b/queue-4.19/soc-fsl-qbman-fix-conflicting-alignment-attributes.patch @@ -0,0 +1,44 @@ +From 75d1b5a7e2c6976f1a2ee43bbc70cffa00c9636c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Mar 2021 14:15:23 +0100 +Subject: soc/fsl: qbman: fix conflicting alignment attributes + +From: Arnd Bergmann + +[ Upstream commit 040f31196e8b2609613f399793b9225271b79471 ] + +When building with W=1, gcc points out that the __packed attribute +on struct qm_eqcr_entry conflicts with the 8-byte alignment +attribute on struct qm_fd inside it: + +drivers/soc/fsl/qbman/qman.c:189:1: error: alignment 1 of 'struct qm_eqcr_entry' is less than 8 [-Werror=packed-not-aligned] + +I assume that the alignment attribute is the correct one, and +that qm_eqcr_entry cannot actually be unaligned in memory, +so add the same alignment on the outer struct. + +Fixes: c535e923bb97 ("soc/fsl: Introduce DPAA 1.x QMan device driver") +Signed-off-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20210323131530.2619900-1-arnd@kernel.org' +Signed-off-by: Arnd Bergmann +Signed-off-by: Sasha Levin +--- + drivers/soc/fsl/qbman/qman.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c +index a4ac6073c555..d7bf456fd10e 100644 +--- a/drivers/soc/fsl/qbman/qman.c ++++ b/drivers/soc/fsl/qbman/qman.c +@@ -184,7 +184,7 @@ struct qm_eqcr_entry { + __be32 tag; + struct qm_fd fd; + u8 __reserved3[32]; +-} __packed; ++} __packed __aligned(8); + #define QM_EQCR_VERB_VBIT 0x80 + #define QM_EQCR_VERB_CMD_MASK 0x61 /* but only one value; */ + #define QM_EQCR_VERB_CMD_ENQUEUE 0x01 +-- +2.30.2 + diff --git a/queue-4.19/workqueue-move-the-position-of-debug_work_activate-i.patch b/queue-4.19/workqueue-move-the-position-of-debug_work_activate-i.patch new file mode 100644 index 00000000000..edec50e4db1 --- /dev/null +++ b/queue-4.19/workqueue-move-the-position-of-debug_work_activate-i.patch @@ -0,0 +1,46 @@ +From 70e0fc087c8c256d60ffa9e4ea176d4360f96d8e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Feb 2021 11:16:49 +0800 +Subject: workqueue: Move the position of debug_work_activate() in + __queue_work() + +From: Zqiang + +[ Upstream commit 0687c66b5f666b5ad433f4e94251590d9bc9d10e ] + +The debug_work_activate() is called on the premise that +the work can be inserted, because if wq be in WQ_DRAINING +status, insert work may be failed. + +Fixes: e41e704bc4f4 ("workqueue: improve destroy_workqueue() debuggability") +Signed-off-by: Zqiang +Reviewed-by: Lai Jiangshan +Signed-off-by: Tejun Heo +Signed-off-by: Sasha Levin +--- + kernel/workqueue.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index 78600f97ffa7..1cc49340b68a 100644 +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -1377,7 +1377,6 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, + */ + lockdep_assert_irqs_disabled(); + +- debug_work_activate(work); + + /* if draining, only works from the same workqueue are allowed */ + if (unlikely(wq->flags & __WQ_DRAINING) && +@@ -1460,6 +1459,7 @@ retry: + worklist = &pwq->delayed_works; + } + ++ debug_work_activate(work); + insert_work(pwq, work, worklist, work_flags); + + spin_unlock(&pwq->pool->lock); +-- +2.30.2 + diff --git a/queue-4.19/xfrm-interface-fix-ipv4-pmtu-check-to-honor-ip-heade.patch b/queue-4.19/xfrm-interface-fix-ipv4-pmtu-check-to-honor-ip-heade.patch new file mode 100644 index 00000000000..5eec6821bfc --- /dev/null +++ b/queue-4.19/xfrm-interface-fix-ipv4-pmtu-check-to-honor-ip-heade.patch @@ -0,0 +1,48 @@ +From 1cbe7f6f57a11f69fa4e489d83d494d31862ab25 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 20 Feb 2021 15:01:15 +0200 +Subject: xfrm: interface: fix ipv4 pmtu check to honor ip header df + +From: Eyal Birger + +[ Upstream commit 8fc0e3b6a8666d656923d214e4dc791e9a17164a ] + +Frag needed should only be sent if the header enables DF. + +This fix allows packets larger than MTU to pass the xfrm interface +and be fragmented after encapsulation, aligning behavior with +non-interface xfrm. + +Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces") +Signed-off-by: Eyal Birger +Reviewed-by: Sabrina Dubroca +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +--- + net/xfrm/xfrm_interface.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c +index eae8b9086497..35a020a70985 100644 +--- a/net/xfrm/xfrm_interface.c ++++ b/net/xfrm/xfrm_interface.c +@@ -302,6 +302,8 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) + + icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); + } else { ++ if (!(ip_hdr(skb)->frag_off & htons(IP_DF))) ++ goto xmit; + icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, + htonl(mtu)); + } +@@ -310,6 +312,7 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) + return -EMSGSIZE; + } + ++xmit: + xfrmi_scrub_packet(skb, !net_eq(xi->net, dev_net(dev))); + skb_dst_set(skb, dst); + skb->dev = tdev; +-- +2.30.2 + -- 2.47.3