From: Sasha Levin Date: Sat, 13 Nov 2021 13:48:33 +0000 (-0500) Subject: Fixes for 4.9 X-Git-Tag: v5.4.160~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13cf1cdfa9196e691b38a2a4830f076e911d89f1;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/bpf-prevent-increasing-bpf_jit_limit-above-max.patch b/queue-4.9/bpf-prevent-increasing-bpf_jit_limit-above-max.patch new file mode 100644 index 00000000000..64ea5d43206 --- /dev/null +++ b/queue-4.9/bpf-prevent-increasing-bpf_jit_limit-above-max.patch @@ -0,0 +1,71 @@ +From b2b75f3a2d2caef11e5309b1385dfbe4499b13a6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Oct 2021 15:25:53 +0100 +Subject: bpf: Prevent increasing bpf_jit_limit above max + +From: Lorenz Bauer + +[ Upstream commit fadb7ff1a6c2c565af56b4aacdd086b067eed440 ] + +Restrict bpf_jit_limit to the maximum supported by the arch's JIT. + +Signed-off-by: Lorenz Bauer +Signed-off-by: Alexei Starovoitov +Link: https://lore.kernel.org/bpf/20211014142554.53120-4-lmb@cloudflare.com +Signed-off-by: Sasha Levin +--- + include/linux/filter.h | 1 + + kernel/bpf/core.c | 4 +++- + net/core/sysctl_net_core.c | 2 +- + 3 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/include/linux/filter.h b/include/linux/filter.h +index 0837d904405a3..05be3d84655e4 100644 +--- a/include/linux/filter.h ++++ b/include/linux/filter.h +@@ -600,6 +600,7 @@ void bpf_warn_invalid_xdp_action(u32 act); + extern int bpf_jit_enable; + extern int bpf_jit_harden; + extern long bpf_jit_limit; ++extern long bpf_jit_limit_max; + + typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size); + +diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c +index df2ebce927ec4..3ce69c0276c09 100644 +--- a/kernel/bpf/core.c ++++ b/kernel/bpf/core.c +@@ -212,6 +212,7 @@ struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, + int bpf_jit_enable __read_mostly = IS_BUILTIN(CONFIG_BPF_JIT_ALWAYS_ON); + int bpf_jit_harden __read_mostly; + long bpf_jit_limit __read_mostly; ++long bpf_jit_limit_max __read_mostly; + + static atomic_long_t bpf_jit_current; + +@@ -231,7 +232,8 @@ u64 __weak bpf_jit_alloc_exec_limit(void) + static int __init bpf_jit_charge_init(void) + { + /* Only used as heuristic here to derive limit. */ +- bpf_jit_limit = min_t(u64, round_up(bpf_jit_alloc_exec_limit() >> 2, ++ bpf_jit_limit_max = bpf_jit_alloc_exec_limit(); ++ bpf_jit_limit = min_t(u64, round_up(bpf_jit_limit_max >> 2, + PAGE_SIZE), LONG_MAX); + return 0; + } +diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c +index b4318c1b5b960..f62e177267c34 100644 +--- a/net/core/sysctl_net_core.c ++++ b/net/core/sysctl_net_core.c +@@ -368,7 +368,7 @@ static struct ctl_table net_core_table[] = { + .mode = 0600, + .proc_handler = proc_dolongvec_minmax_bpf_restricted, + .extra1 = &long_one, +- .extra2 = &long_max, ++ .extra2 = &bpf_jit_limit_max, + }, + #endif + { +-- +2.33.0 + diff --git a/queue-4.9/hyperv-vmbus-include-linux-bitops.h.patch b/queue-4.9/hyperv-vmbus-include-linux-bitops.h.patch new file mode 100644 index 00000000000..86e344def50 --- /dev/null +++ b/queue-4.9/hyperv-vmbus-include-linux-bitops.h.patch @@ -0,0 +1,45 @@ +From 8d69752e1ab5ed262de4e735cf00ed7cebf60f3a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 18 Oct 2021 15:19:08 +0200 +Subject: hyperv/vmbus: include linux/bitops.h + +From: Arnd Bergmann + +[ Upstream commit 8017c99680fa65e1e8d999df1583de476a187830 ] + +On arm64 randconfig builds, hyperv sometimes fails with this +error: + +In file included from drivers/hv/hv_trace.c:3: +In file included from drivers/hv/hyperv_vmbus.h:16: +In file included from arch/arm64/include/asm/sync_bitops.h:5: +arch/arm64/include/asm/bitops.h:11:2: error: only can be included directly +In file included from include/asm-generic/bitops/hweight.h:5: +include/asm-generic/bitops/arch_hweight.h:9:9: error: implicit declaration of function '__sw_hweight32' [-Werror,-Wimplicit-function-declaration] +include/asm-generic/bitops/atomic.h:17:7: error: implicit declaration of function 'BIT_WORD' [-Werror,-Wimplicit-function-declaration] + +Include the correct header first. + +Signed-off-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20211018131929.2260087-1-arnd@kernel.org +Signed-off-by: Wei Liu +Signed-off-by: Sasha Levin +--- + drivers/hv/hyperv_vmbus.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h +index 8d7f865c1133f..9d3605df1f489 100644 +--- a/drivers/hv/hyperv_vmbus.h ++++ b/drivers/hv/hyperv_vmbus.h +@@ -26,6 +26,7 @@ + #define _HYPERV_VMBUS_H + + #include ++#include + #include + #include + #include +-- +2.33.0 + diff --git a/queue-4.9/mmc-winbond-don-t-build-on-m68k.patch b/queue-4.9/mmc-winbond-don-t-build-on-m68k.patch new file mode 100644 index 00000000000..976bae06c3e --- /dev/null +++ b/queue-4.9/mmc-winbond-don-t-build-on-m68k.patch @@ -0,0 +1,45 @@ +From f3682e83a21606d684483988fa34b7f88ccceb93 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 17 Oct 2021 10:59:49 -0700 +Subject: mmc: winbond: don't build on M68K + +From: Randy Dunlap + +[ Upstream commit 162079f2dccd02cb4b6654defd32ca387dd6d4d4 ] + +The Winbond MMC driver fails to build on ARCH=m68k so prevent +that build config. Silences these build errors: + +../drivers/mmc/host/wbsd.c: In function 'wbsd_request_end': +../drivers/mmc/host/wbsd.c:212:28: error: implicit declaration of function 'claim_dma_lock' [-Werror=implicit-function-declaration] + 212 | dmaflags = claim_dma_lock(); +../drivers/mmc/host/wbsd.c:215:17: error: implicit declaration of function 'release_dma_lock'; did you mean 'release_task'? [-Werror=implicit-function-declaration] + 215 | release_dma_lock(dmaflags); + +Signed-off-by: Randy Dunlap +Cc: Pierre Ossman +Cc: Geert Uytterhoeven +Cc: Arnd Bergmann +Link: https://lore.kernel.org/r/20211017175949.23838-1-rdunlap@infradead.org +Signed-off-by: Ulf Hansson +Signed-off-by: Sasha Levin +--- + drivers/mmc/host/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig +index 5274f503a39ad..5c0bc817019f7 100644 +--- a/drivers/mmc/host/Kconfig ++++ b/drivers/mmc/host/Kconfig +@@ -367,7 +367,7 @@ config MMC_OMAP_HS + + config MMC_WBSD + tristate "Winbond W83L51xD SD/MMC Card Interface support" +- depends on ISA_DMA_API ++ depends on ISA_DMA_API && !M68K + help + This selects the Winbond(R) W83L51xD Secure digital and + Multimedia card Interface. +-- +2.33.0 + diff --git a/queue-4.9/series b/queue-4.9/series index 314195317f0..582ee2c64f5 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -16,3 +16,11 @@ alsa-timer-fix-use-after-free-problem.patch alsa-timer-unconditionally-unlink-slave-instances-too.patch fuse-fix-page-stealing.patch x86-irq-ensure-pi-wakeup-handler-is-unregistered-before-module-unload.patch +sfc-don-t-use-netif_info-before-net_device-setup.patch +hyperv-vmbus-include-linux-bitops.h.patch +mmc-winbond-don-t-build-on-m68k.patch +bpf-prevent-increasing-bpf_jit_limit-above-max.patch +xen-netfront-stop-tx-queues-during-live-migration.patch +spi-spl022-fix-microwire-full-duplex-mode.patch +watchdog-fix-omap-watchdog-early-handling.patch +vmxnet3-do-not-stop-tx-queues-after-netif_device_det.patch diff --git a/queue-4.9/sfc-don-t-use-netif_info-before-net_device-setup.patch b/queue-4.9/sfc-don-t-use-netif_info-before-net_device-setup.patch new file mode 100644 index 00000000000..6191e2aad54 --- /dev/null +++ b/queue-4.9/sfc-don-t-use-netif_info-before-net_device-setup.patch @@ -0,0 +1,66 @@ +From 69b0add49ba70d60d3f8323e6ab3e08076821421 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Oct 2021 00:40:16 +0200 +Subject: sfc: Don't use netif_info before net_device setup + +From: Erik Ekman + +[ Upstream commit bf6abf345dfa77786aca554bc58c64bd428ecb1d ] + +Use pci_info instead to avoid unnamed/uninitialized noise: + +[197088.688729] sfc 0000:01:00.0: Solarflare NIC detected +[197088.690333] sfc 0000:01:00.0: Part Number : SFN5122F +[197088.729061] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no SR-IOV VFs probed +[197088.729071] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no PTP support + +Inspired by fa44821a4ddd ("sfc: don't use netif_info et al before +net_device is registered") from Heiner Kallweit. + +Signed-off-by: Erik Ekman +Acked-by: Martin Habets +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/sfc/ptp.c | 4 ++-- + drivers/net/ethernet/sfc/siena_sriov.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c +index 04cbff7f1b23d..a48ff6fc66b44 100644 +--- a/drivers/net/ethernet/sfc/ptp.c ++++ b/drivers/net/ethernet/sfc/ptp.c +@@ -494,7 +494,7 @@ static int efx_ptp_get_attributes(struct efx_nic *efx) + } else if (rc == -EINVAL) { + fmt = MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS; + } else if (rc == -EPERM) { +- netif_info(efx, probe, efx->net_dev, "no PTP support\n"); ++ pci_info(efx->pci_dev, "no PTP support\n"); + return rc; + } else { + efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf), +@@ -613,7 +613,7 @@ static int efx_ptp_disable(struct efx_nic *efx) + * should only have been called during probe. + */ + if (rc == -ENOSYS || rc == -EPERM) +- netif_info(efx, probe, efx->net_dev, "no PTP support\n"); ++ pci_info(efx->pci_dev, "no PTP support\n"); + else if (rc) + efx_mcdi_display_error(efx, MC_CMD_PTP, + MC_CMD_PTP_IN_DISABLE_LEN, +diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c +index da7b94f346049..30d58f72725df 100644 +--- a/drivers/net/ethernet/sfc/siena_sriov.c ++++ b/drivers/net/ethernet/sfc/siena_sriov.c +@@ -1059,7 +1059,7 @@ void efx_siena_sriov_probe(struct efx_nic *efx) + return; + + if (efx_siena_sriov_cmd(efx, false, &efx->vi_scale, &count)) { +- netif_info(efx, probe, efx->net_dev, "no SR-IOV VFs probed\n"); ++ pci_info(efx->pci_dev, "no SR-IOV VFs probed\n"); + return; + } + if (count > 0 && count > max_vfs) +-- +2.33.0 + diff --git a/queue-4.9/spi-spl022-fix-microwire-full-duplex-mode.patch b/queue-4.9/spi-spl022-fix-microwire-full-duplex-mode.patch new file mode 100644 index 00000000000..9eb9b0b3370 --- /dev/null +++ b/queue-4.9/spi-spl022-fix-microwire-full-duplex-mode.patch @@ -0,0 +1,44 @@ +From b98dd9eaba5e158b02573dc05fe6d0550aac5372 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 22 Oct 2021 16:21:04 +0200 +Subject: spi: spl022: fix Microwire full duplex mode + +From: Thomas Perrot + +[ Upstream commit d81d0e41ed5fe7229a2c9a29d13bad288c7cf2d2 ] + +There are missing braces in the function that verify controller parameters, +then an error is always returned when the parameter to select Microwire +frames operation is used on devices allowing it. + +Signed-off-by: Thomas Perrot +Link: https://lore.kernel.org/r/20211022142104.1386379-1-thomas.perrot@bootlin.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-pl022.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c +index f7f7ba17b40e9..27cf77dfc6038 100644 +--- a/drivers/spi/spi-pl022.c ++++ b/drivers/spi/spi-pl022.c +@@ -1703,12 +1703,13 @@ static int verify_controller_parameters(struct pl022 *pl022, + return -EINVAL; + } + } else { +- if (chip_info->duplex != SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) ++ if (chip_info->duplex != SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) { + dev_err(&pl022->adev->dev, + "Microwire half duplex mode requested," + " but this is only available in the" + " ST version of PL022\n"); +- return -EINVAL; ++ return -EINVAL; ++ } + } + } + return 0; +-- +2.33.0 + diff --git a/queue-4.9/vmxnet3-do-not-stop-tx-queues-after-netif_device_det.patch b/queue-4.9/vmxnet3-do-not-stop-tx-queues-after-netif_device_det.patch new file mode 100644 index 00000000000..0eb61198797 --- /dev/null +++ b/queue-4.9/vmxnet3-do-not-stop-tx-queues-after-netif_device_det.patch @@ -0,0 +1,34 @@ +From 63866fd32bac9dcbcfd69a9411bc853f09f1117a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 26 Oct 2021 14:50:31 -0700 +Subject: vmxnet3: do not stop tx queues after netif_device_detach() + +From: Dongli Zhang + +[ Upstream commit 9159f102402a64ac85e676b75cc1f9c62c5b4b73 ] + +The netif_device_detach() conditionally stops all tx queues if the queues +are running. There is no need to call netif_tx_stop_all_queues() again. + +Signed-off-by: Dongli Zhang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/vmxnet3/vmxnet3_drv.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c +index c999b10531c59..56a8031b56b37 100644 +--- a/drivers/net/vmxnet3/vmxnet3_drv.c ++++ b/drivers/net/vmxnet3/vmxnet3_drv.c +@@ -3622,7 +3622,6 @@ vmxnet3_suspend(struct device *device) + vmxnet3_free_intr_resources(adapter); + + netif_device_detach(netdev); +- netif_tx_stop_all_queues(netdev); + + /* Create wake-up filters. */ + pmConf = adapter->pm_conf; +-- +2.33.0 + diff --git a/queue-4.9/watchdog-fix-omap-watchdog-early-handling.patch b/queue-4.9/watchdog-fix-omap-watchdog-early-handling.patch new file mode 100644 index 00000000000..7f61cd041d1 --- /dev/null +++ b/queue-4.9/watchdog-fix-omap-watchdog-early-handling.patch @@ -0,0 +1,44 @@ +From 6d8a3703dbffd852e4aed255d324304c86761ceb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Oct 2021 12:22:29 +0200 +Subject: watchdog: Fix OMAP watchdog early handling + +From: Walter Stoll + +[ Upstream commit cd004d8299f1dc6cfa6a4eea8f94cb45eaedf070 ] + +TI's implementation does not service the watchdog even if the kernel +command line parameter omap_wdt.early_enable is set to 1. This patch +fixes the issue. + +Signed-off-by: Walter Stoll +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/88a8fe5229cd68fa0f1fd22f5d66666c1b7057a0.camel@duagon.com +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Sasha Levin +--- + drivers/watchdog/omap_wdt.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c +index 1b02bfa81b296..40c006ee8492d 100644 +--- a/drivers/watchdog/omap_wdt.c ++++ b/drivers/watchdog/omap_wdt.c +@@ -271,8 +271,12 @@ static int omap_wdt_probe(struct platform_device *pdev) + wdev->wdog.bootstatus = WDIOF_CARDRESET; + } + +- if (!early_enable) ++ if (early_enable) { ++ omap_wdt_start(&wdev->wdog); ++ set_bit(WDOG_HW_RUNNING, &wdev->wdog.status); ++ } else { + omap_wdt_disable(wdev); ++ } + + ret = watchdog_register_device(&wdev->wdog); + if (ret) { +-- +2.33.0 + diff --git a/queue-4.9/xen-netfront-stop-tx-queues-during-live-migration.patch b/queue-4.9/xen-netfront-stop-tx-queues-during-live-migration.patch new file mode 100644 index 00000000000..cb871910922 --- /dev/null +++ b/queue-4.9/xen-netfront-stop-tx-queues-during-live-migration.patch @@ -0,0 +1,67 @@ +From a27f6fcf61d0592961f999baa0cf13182d1a3a62 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 22 Oct 2021 16:31:39 -0700 +Subject: xen/netfront: stop tx queues during live migration + +From: Dongli Zhang + +[ Upstream commit 042b2046d0f05cf8124c26ff65dbb6148a4404fb ] + +The tx queues are not stopped during the live migration. As a result, the +ndo_start_xmit() may access netfront_info->queues which is freed by +talk_to_netback()->xennet_destroy_queues(). + +This patch is to netif_device_detach() at the beginning of xen-netfront +resuming, and netif_device_attach() at the end of resuming. + + CPU A CPU B + + talk_to_netback() + -> if (info->queues) + xennet_destroy_queues(info); + to free netfront_info->queues + + xennet_start_xmit() + to access netfront_info->queues + + -> err = xennet_create_queues(info, &num_queues); + +The idea is borrowed from virtio-net. + +Cc: Joe Jin +Signed-off-by: Dongli Zhang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/xen-netfront.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c +index ceaf6b30d683d..0971c09363cbf 100644 +--- a/drivers/net/xen-netfront.c ++++ b/drivers/net/xen-netfront.c +@@ -1460,6 +1460,10 @@ static int netfront_resume(struct xenbus_device *dev) + + dev_dbg(&dev->dev, "%s\n", dev->nodename); + ++ netif_tx_lock_bh(info->netdev); ++ netif_device_detach(info->netdev); ++ netif_tx_unlock_bh(info->netdev); ++ + xennet_disconnect_backend(info); + return 0; + } +@@ -2020,6 +2024,10 @@ static int xennet_connect(struct net_device *dev) + * domain a kick because we've probably just requeued some + * packets. + */ ++ netif_tx_lock_bh(np->netdev); ++ netif_device_attach(np->netdev); ++ netif_tx_unlock_bh(np->netdev); ++ + netif_carrier_on(np->netdev); + for (j = 0; j < num_queues; ++j) { + queue = &np->queues[j]; +-- +2.33.0 +