From: Greg Kroah-Hartman Date: Mon, 22 Aug 2022 13:10:59 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.9.326~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26fdb7debb0c642131e7c8d8fbe503ef9b588b57;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: fec-fix-timer-capture-timing-in-fec_ptp_enable_pps.patch gcc-plugins-undefine-latent_entropy_plugin-when-plugin-disabled-for-a-file.patch i2c-imx-make-sure-to-unregister-adapter-on-remove.patch i40e-fix-to-stop-tx_timeout-recovery-if-globr-fails.patch ice-ignore-eexist-when-setting-promisc-mode.patch igb-add-lock-to-avoid-data-race.patch kbuild-fix-the-modules-order-between-drivers-and-libs.patch net-dsa-felix-fix-ethtool-256-511-and-512-1023-tx-packet-counters.patch net-dsa-microchip-ksz9477-fix-fdb_dump-last-invalid-entry.patch net-dsa-mv88e6060-prevent-crash-on-an-unused-port.patch net-dsa-sja1105-fix-buffer-overflow-in-sja1105_setup_devlink_regions.patch net-genl-fix-error-path-memory-leak-in-policy-dumping.patch net-moxa-pass-pdev-instead-of-ndev-to-dma-functions.patch netfilter-nf_tables-check-nft_set_concat-flag-if-field_count-is-specified.patch netfilter-nf_tables-really-skip-inactive-sets-when-allocating-name.patch netfilter-nf_tables-validate-nfta_set_elem_objref-based-on-nft_set_object-flag.patch powerpc-pci-fix-get_phb_number-locking.patch regulator-pca9450-remove-restrictions-for-regulator-name.patch spi-meson-spicc-add-local-pow2-clock-ops-to-preserve-rate-between-messages.patch stmmac-intel-add-a-missing-clk_disable_unprepare-call-in-intel_eth_pci_remove.patch --- diff --git a/queue-5.10/fec-fix-timer-capture-timing-in-fec_ptp_enable_pps.patch b/queue-5.10/fec-fix-timer-capture-timing-in-fec_ptp_enable_pps.patch new file mode 100644 index 00000000000..9075c88e1db --- /dev/null +++ b/queue-5.10/fec-fix-timer-capture-timing-in-fec_ptp_enable_pps.patch @@ -0,0 +1,39 @@ +From 61d5e2a251fb20c2c5e998c3f1d52ed6d5360319 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cs=C3=B3k=C3=A1s=20Bence?= +Date: Thu, 11 Aug 2022 12:13:49 +0200 +Subject: fec: Fix timer capture timing in `fec_ptp_enable_pps()` +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Csókás Bence + +commit 61d5e2a251fb20c2c5e998c3f1d52ed6d5360319 upstream. + +Code reimplements functionality already in `fec_ptp_read()`, +but misses check for FEC_QUIRK_BUG_CAPTURE. Replace with function call. + +Fixes: 28b5f058cf1d ("net: fec: ptp: fix convergence issue to support LinuxPTP stack") +Signed-off-by: Csókás Bence +Link: https://lore.kernel.org/r/20220811101348.13755-1-csokas.bence@prolan.hu +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/freescale/fec_ptp.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +--- a/drivers/net/ethernet/freescale/fec_ptp.c ++++ b/drivers/net/ethernet/freescale/fec_ptp.c +@@ -136,11 +136,7 @@ static int fec_ptp_enable_pps(struct fec + * NSEC_PER_SEC - ts.tv_nsec. Add the remaining nanoseconds + * to current timer would be next second. + */ +- tempval = readl(fep->hwp + FEC_ATIME_CTRL); +- tempval |= FEC_T_CTRL_CAPTURE; +- writel(tempval, fep->hwp + FEC_ATIME_CTRL); +- +- tempval = readl(fep->hwp + FEC_ATIME); ++ tempval = fep->cc.read(&fep->cc); + /* Convert the ptp local counter to 1588 timestamp */ + ns = timecounter_cyc2time(&fep->tc, tempval); + ts = ns_to_timespec64(ns); diff --git a/queue-5.10/gcc-plugins-undefine-latent_entropy_plugin-when-plugin-disabled-for-a-file.patch b/queue-5.10/gcc-plugins-undefine-latent_entropy_plugin-when-plugin-disabled-for-a-file.patch new file mode 100644 index 00000000000..3f059392b3e --- /dev/null +++ b/queue-5.10/gcc-plugins-undefine-latent_entropy_plugin-when-plugin-disabled-for-a-file.patch @@ -0,0 +1,73 @@ +From 012e8d2034f1bda8863435cd589636e618d6a659 Mon Sep 17 00:00:00 2001 +From: Andrew Donnellan +Date: Tue, 16 Aug 2022 15:17:20 +1000 +Subject: gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file + +From: Andrew Donnellan + +commit 012e8d2034f1bda8863435cd589636e618d6a659 upstream. + +Commit 36d4b36b6959 ("lib/nodemask: inline next_node_in() and +node_random()") refactored some code by moving node_random() from +lib/nodemask.c to include/linux/nodemask.h, thus requiring nodemask.h to +include random.h, which conditionally defines add_latent_entropy() +depending on whether the macro LATENT_ENTROPY_PLUGIN is defined. + +This broke the build on powerpc, where nodemask.h is indirectly included +in arch/powerpc/kernel/prom_init.c, part of the early boot machinery that +is excluded from the latent entropy plugin using +DISABLE_LATENT_ENTROPY_PLUGIN. It turns out that while we add a gcc flag +to disable the actual plugin, we don't undefine LATENT_ENTROPY_PLUGIN. + +This leads to the following: + + CC arch/powerpc/kernel/prom_init.o + In file included from ./include/linux/nodemask.h:97, + from ./include/linux/mmzone.h:17, + from ./include/linux/gfp.h:7, + from ./include/linux/xarray.h:15, + from ./include/linux/radix-tree.h:21, + from ./include/linux/idr.h:15, + from ./include/linux/kernfs.h:12, + from ./include/linux/sysfs.h:16, + from ./include/linux/kobject.h:20, + from ./include/linux/pci.h:35, + from arch/powerpc/kernel/prom_init.c:24: + ./include/linux/random.h: In function 'add_latent_entropy': + ./include/linux/random.h:25:46: error: 'latent_entropy' undeclared (first use in this function); did you mean 'add_latent_entropy'? + 25 | add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy)); + | ^~~~~~~~~~~~~~ + | add_latent_entropy + ./include/linux/random.h:25:46: note: each undeclared identifier is reported only once for each function it appears in + make[2]: *** [scripts/Makefile.build:249: arch/powerpc/kernel/prom_init.o] Fehler 1 + make[1]: *** [scripts/Makefile.build:465: arch/powerpc/kernel] Fehler 2 + make: *** [Makefile:1855: arch/powerpc] Error 2 + +Change the DISABLE_LATENT_ENTROPY_PLUGIN flags to undefine +LATENT_ENTROPY_PLUGIN for files where the plugin is disabled. + +Cc: Yury Norov +Fixes: 38addce8b600 ("gcc-plugins: Add latent_entropy plugin") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=216367 +Link: https://lore.kernel.org/linuxppc-dev/alpine.DEB.2.22.394.2208152006320.289321@ramsan.of.borg/ +Reported-by: Erhard Furtner +Signed-off-by: Andrew Donnellan +Reviewed-by: Yury Norov +Signed-off-by: Kees Cook +Link: https://lore.kernel.org/r/20220816051720.44108-1-ajd@linux.ibm.com +Signed-off-by: Greg Kroah-Hartman +--- + scripts/Makefile.gcc-plugins | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/Makefile.gcc-plugins ++++ b/scripts/Makefile.gcc-plugins +@@ -6,7 +6,7 @@ gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_EN + gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \ + += -DLATENT_ENTROPY_PLUGIN + ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY +- DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable ++ DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable -ULATENT_ENTROPY_PLUGIN + endif + export DISABLE_LATENT_ENTROPY_PLUGIN + diff --git a/queue-5.10/i2c-imx-make-sure-to-unregister-adapter-on-remove.patch b/queue-5.10/i2c-imx-make-sure-to-unregister-adapter-on-remove.patch new file mode 100644 index 00000000000..3bb3050cd28 --- /dev/null +++ b/queue-5.10/i2c-imx-make-sure-to-unregister-adapter-on-remove.patch @@ -0,0 +1,71 @@ +From d98bdd3a5b50446d8e010be5b04ce81c4eabf728 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Wed, 20 Jul 2022 17:09:33 +0200 +Subject: i2c: imx: Make sure to unregister adapter on remove() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +commit d98bdd3a5b50446d8e010be5b04ce81c4eabf728 upstream. + +If for whatever reasons pm_runtime_resume_and_get() fails and .remove() is +exited early, the i2c adapter stays around and the irq still calls its +handler, while the driver data and the register mapping go away. So if +later the i2c adapter is accessed or the irq triggers this results in +havoc accessing freed memory and unmapped registers. + +So unregister the software resources even if resume failed, and only skip +the hardware access in that case. + +Fixes: 588eb93ea49f ("i2c: imx: add runtime pm support to improve the performance") +Signed-off-by: Uwe Kleine-König +Acked-by: Oleksij Rempel +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/busses/i2c-imx.c | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +--- a/drivers/i2c/busses/i2c-imx.c ++++ b/drivers/i2c/busses/i2c-imx.c +@@ -1280,9 +1280,7 @@ static int i2c_imx_remove(struct platfor + struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev); + int irq, ret; + +- ret = pm_runtime_resume_and_get(&pdev->dev); +- if (ret < 0) +- return ret; ++ ret = pm_runtime_get_sync(&pdev->dev); + + /* remove adapter */ + dev_dbg(&i2c_imx->adapter.dev, "adapter removed\n"); +@@ -1291,17 +1289,21 @@ static int i2c_imx_remove(struct platfor + if (i2c_imx->dma) + i2c_imx_dma_free(i2c_imx); + +- /* setup chip registers to defaults */ +- imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR); +- imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR); +- imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2CR); +- imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2SR); ++ if (ret == 0) { ++ /* setup chip registers to defaults */ ++ imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR); ++ imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR); ++ imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2CR); ++ imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2SR); ++ clk_disable(i2c_imx->clk); ++ } + + clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb); + irq = platform_get_irq(pdev, 0); + if (irq >= 0) + free_irq(irq, i2c_imx); +- clk_disable_unprepare(i2c_imx->clk); ++ ++ clk_unprepare(i2c_imx->clk); + + pm_runtime_put_noidle(&pdev->dev); + pm_runtime_disable(&pdev->dev); diff --git a/queue-5.10/i40e-fix-to-stop-tx_timeout-recovery-if-globr-fails.patch b/queue-5.10/i40e-fix-to-stop-tx_timeout-recovery-if-globr-fails.patch new file mode 100644 index 00000000000..a7857a89a39 --- /dev/null +++ b/queue-5.10/i40e-fix-to-stop-tx_timeout-recovery-if-globr-fails.patch @@ -0,0 +1,42 @@ +From 57c942bc3bef0970f0b21f8e0998e76a900ea80d Mon Sep 17 00:00:00 2001 +From: Alan Brady +Date: Tue, 2 Aug 2022 10:19:17 +0200 +Subject: i40e: Fix to stop tx_timeout recovery if GLOBR fails + +From: Alan Brady + +commit 57c942bc3bef0970f0b21f8e0998e76a900ea80d upstream. + +When a tx_timeout fires, the PF attempts to recover by incrementally +resetting. First we try a PFR, then CORER and finally a GLOBR. If the +GLOBR fails, then we keep hitting the tx_timeout and incrementing the +recovery level and issuing dmesgs, which is both annoying to the user +and accomplishes nothing. + +If the GLOBR fails, then we're pretty much totally hosed, and there's +not much else we can do to recover, so this makes it such that we just +kill the VSI and stop hitting the tx_timeout in such a case. + +Fixes: 41c445ff0f48 ("i40e: main driver core") +Signed-off-by: Alan Brady +Signed-off-by: Mateusz Palczewski +Tested-by: Gurucharan (A Contingent worker at Intel) +Signed-off-by: Tony Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c +@@ -382,7 +382,9 @@ static void i40e_tx_timeout(struct net_d + set_bit(__I40E_GLOBAL_RESET_REQUESTED, pf->state); + break; + default: +- netdev_err(netdev, "tx_timeout recovery unsuccessful\n"); ++ netdev_err(netdev, "tx_timeout recovery unsuccessful, device is in non-recoverable state.\n"); ++ set_bit(__I40E_DOWN_REQUESTED, pf->state); ++ set_bit(__I40E_VSI_DOWN_REQUESTED, vsi->state); + break; + } + diff --git a/queue-5.10/ice-ignore-eexist-when-setting-promisc-mode.patch b/queue-5.10/ice-ignore-eexist-when-setting-promisc-mode.patch new file mode 100644 index 00000000000..7308c5f0255 --- /dev/null +++ b/queue-5.10/ice-ignore-eexist-when-setting-promisc-mode.patch @@ -0,0 +1,38 @@ +From 11e551a2efa4481bd4f616ab75374a2710b480e9 Mon Sep 17 00:00:00 2001 +From: Grzegorz Siwik +Date: Fri, 12 Aug 2022 15:25:48 +0200 +Subject: ice: Ignore EEXIST when setting promisc mode + +From: Grzegorz Siwik + +commit 11e551a2efa4481bd4f616ab75374a2710b480e9 upstream. + +Ignore EEXIST error when setting promiscuous mode. +This fix is needed because the driver could set promiscuous mode +when it still has not cleared properly. +Promiscuous mode could be set only once, so setting it second +time will be rejected. + +Fixes: 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode") +Signed-off-by: Grzegorz Siwik +Link: https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/ +Tested-by: Jaroslav Pulchart +Tested-by: Igor Raits +Tested-by: Gurucharan (A Contingent worker at Intel) +Signed-off-by: Tony Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ice/ice_switch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/ice/ice_switch.c ++++ b/drivers/net/ethernet/intel/ice/ice_switch.c +@@ -2590,7 +2590,7 @@ ice_set_vlan_vsi_promisc(struct ice_hw * + else + status = ice_set_vsi_promisc(hw, vsi_handle, + promisc_mask, vlan_id); +- if (status) ++ if (status && status != -EEXIST) + break; + } + diff --git a/queue-5.10/igb-add-lock-to-avoid-data-race.patch b/queue-5.10/igb-add-lock-to-avoid-data-race.patch new file mode 100644 index 00000000000..e7baa87e3eb --- /dev/null +++ b/queue-5.10/igb-add-lock-to-avoid-data-race.patch @@ -0,0 +1,126 @@ +From 6faee3d4ee8be0f0367d0c3d826afb3571b7a5e0 Mon Sep 17 00:00:00 2001 +From: Lin Ma +Date: Wed, 17 Aug 2022 11:49:21 -0700 +Subject: igb: Add lock to avoid data race + +From: Lin Ma + +commit 6faee3d4ee8be0f0367d0c3d826afb3571b7a5e0 upstream. + +The commit c23d92b80e0b ("igb: Teardown SR-IOV before +unregister_netdev()") places the unregister_netdev() call after the +igb_disable_sriov() call to avoid functionality issue. + +However, it introduces several race conditions when detaching a device. +For example, when .remove() is called, the below interleaving leads to +use-after-free. + + (FREE from device detaching) | (USE from netdev core) +igb_remove | igb_ndo_get_vf_config + igb_disable_sriov | vf >= adapter->vfs_allocated_count? + kfree(adapter->vf_data) | + adapter->vfs_allocated_count = 0 | + | memcpy(... adapter->vf_data[vf] + +Moreover, the igb_disable_sriov() also suffers from data race with the +requests from VF driver. + + (FREE from device detaching) | (USE from requests) +igb_remove | igb_msix_other + igb_disable_sriov | igb_msg_task + kfree(adapter->vf_data) | vf < adapter->vfs_allocated_count + adapter->vfs_allocated_count = 0 | + +To this end, this commit first eliminates the data races from netdev +core by using rtnl_lock (similar to commit 719479230893 ("dpaa2-eth: add +MAC/PHY support through phylink")). And then adds a spinlock to +eliminate races from driver requests. (similar to commit 1e53834ce541 +("ixgbe: Add locking to prevent panic when setting sriov_numvfs to zero") + +Fixes: c23d92b80e0b ("igb: Teardown SR-IOV before unregister_netdev()") +Signed-off-by: Lin Ma +Tested-by: Konrad Jankowski +Signed-off-by: Tony Nguyen +Link: https://lore.kernel.org/r/20220817184921.735244-1-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igb/igb.h | 2 ++ + drivers/net/ethernet/intel/igb/igb_main.c | 12 +++++++++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/igb/igb.h ++++ b/drivers/net/ethernet/intel/igb/igb.h +@@ -664,6 +664,8 @@ struct igb_adapter { + struct igb_mac_addr *mac_table; + struct vf_mac_filter vf_macs; + struct vf_mac_filter *vf_mac_list; ++ /* lock for VF resources */ ++ spinlock_t vfs_lock; + }; + + /* flags controlling PTP/1588 function */ +--- a/drivers/net/ethernet/intel/igb/igb_main.c ++++ b/drivers/net/ethernet/intel/igb/igb_main.c +@@ -3638,6 +3638,7 @@ static int igb_disable_sriov(struct pci_ + struct net_device *netdev = pci_get_drvdata(pdev); + struct igb_adapter *adapter = netdev_priv(netdev); + struct e1000_hw *hw = &adapter->hw; ++ unsigned long flags; + + /* reclaim resources allocated to VFs */ + if (adapter->vf_data) { +@@ -3650,12 +3651,13 @@ static int igb_disable_sriov(struct pci_ + pci_disable_sriov(pdev); + msleep(500); + } +- ++ spin_lock_irqsave(&adapter->vfs_lock, flags); + kfree(adapter->vf_mac_list); + adapter->vf_mac_list = NULL; + kfree(adapter->vf_data); + adapter->vf_data = NULL; + adapter->vfs_allocated_count = 0; ++ spin_unlock_irqrestore(&adapter->vfs_lock, flags); + wr32(E1000_IOVCTL, E1000_IOVCTL_REUSE_VFQ); + wrfl(); + msleep(100); +@@ -3815,7 +3817,9 @@ static void igb_remove(struct pci_dev *p + igb_release_hw_control(adapter); + + #ifdef CONFIG_PCI_IOV ++ rtnl_lock(); + igb_disable_sriov(pdev); ++ rtnl_unlock(); + #endif + + unregister_netdev(netdev); +@@ -3975,6 +3979,9 @@ static int igb_sw_init(struct igb_adapte + + spin_lock_init(&adapter->nfc_lock); + spin_lock_init(&adapter->stats64_lock); ++ ++ /* init spinlock to avoid concurrency of VF resources */ ++ spin_lock_init(&adapter->vfs_lock); + #ifdef CONFIG_PCI_IOV + switch (hw->mac.type) { + case e1000_82576: +@@ -7852,8 +7859,10 @@ unlock: + static void igb_msg_task(struct igb_adapter *adapter) + { + struct e1000_hw *hw = &adapter->hw; ++ unsigned long flags; + u32 vf; + ++ spin_lock_irqsave(&adapter->vfs_lock, flags); + for (vf = 0; vf < adapter->vfs_allocated_count; vf++) { + /* process any reset requests */ + if (!igb_check_for_rst(hw, vf)) +@@ -7867,6 +7876,7 @@ static void igb_msg_task(struct igb_adap + if (!igb_check_for_ack(hw, vf)) + igb_rcv_ack_from_vf(adapter, vf); + } ++ spin_unlock_irqrestore(&adapter->vfs_lock, flags); + } + + /** diff --git a/queue-5.10/kbuild-fix-the-modules-order-between-drivers-and-libs.patch b/queue-5.10/kbuild-fix-the-modules-order-between-drivers-and-libs.patch new file mode 100644 index 00000000000..c91940168d1 --- /dev/null +++ b/queue-5.10/kbuild-fix-the-modules-order-between-drivers-and-libs.patch @@ -0,0 +1,48 @@ +From 113147510b48e764e624e3d0e6707a1e48bc05a9 Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Sun, 14 Aug 2022 08:09:28 +0900 +Subject: kbuild: fix the modules order between drivers and libs + +From: Masahiro Yamada + +commit 113147510b48e764e624e3d0e6707a1e48bc05a9 upstream. + +Commit b2c885549122 ("kbuild: update modules.order only when contained +modules are updated") accidentally changed the modules order. + +Prior to that commit, the modules order was determined based on +vmlinux-dirs, which lists core-y/m, drivers-y/m, libs-y/m, in this order. + +Now, subdir-modorder lists them in a different order: core-y/m, libs-y/m, +drivers-y/m. + +Presumably, there was no practical issue because the modules in drivers +and libs are orthogonal, but there is no reason to have this distortion. + +Get back to the original order. + +Fixes: b2c885549122 ("kbuild: update modules.order only when contained modules are updated") +Signed-off-by: Masahiro Yamada +Signed-off-by: Greg Kroah-Hartman +--- + Makefile | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1133,13 +1133,11 @@ vmlinux-alldirs := $(sort $(vmlinux-dirs + $(patsubst %/,%,$(filter %/, $(core-) \ + $(drivers-) $(libs-)))) + +-subdir-modorder := $(addsuffix modules.order,$(filter %/, \ +- $(core-y) $(core-m) $(libs-y) $(libs-m) \ +- $(drivers-y) $(drivers-m))) +- + build-dirs := $(vmlinux-dirs) + clean-dirs := $(vmlinux-alldirs) + ++subdir-modorder := $(addsuffix /modules.order, $(build-dirs)) ++ + # Externally visible symbols (used by link-vmlinux.sh) + KBUILD_VMLINUX_OBJS := $(head-y) $(patsubst %/,%/built-in.a, $(core-y)) + KBUILD_VMLINUX_OBJS += $(addsuffix built-in.a, $(filter %/, $(libs-y))) diff --git a/queue-5.10/net-dsa-felix-fix-ethtool-256-511-and-512-1023-tx-packet-counters.patch b/queue-5.10/net-dsa-felix-fix-ethtool-256-511-and-512-1023-tx-packet-counters.patch new file mode 100644 index 00000000000..fa0464d916a --- /dev/null +++ b/queue-5.10/net-dsa-felix-fix-ethtool-256-511-and-512-1023-tx-packet-counters.patch @@ -0,0 +1,32 @@ +From 40d21c4565bce064c73a03b79a157a3493c518b9 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Tue, 16 Aug 2022 16:53:45 +0300 +Subject: net: dsa: felix: fix ethtool 256-511 and 512-1023 TX packet counters + +From: Vladimir Oltean + +commit 40d21c4565bce064c73a03b79a157a3493c518b9 upstream. + +What the driver actually reports as 256-511 is in fact 512-1023, and the +TX packets in the 256-511 bucket are not reported. Fix that. + +Fixes: 56051948773e ("net: dsa: ocelot: add driver for Felix switch family") +Signed-off-by: Vladimir Oltean +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/dsa/ocelot/felix_vsc9959.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/dsa/ocelot/felix_vsc9959.c ++++ b/drivers/net/dsa/ocelot/felix_vsc9959.c +@@ -578,7 +578,8 @@ static const struct ocelot_stat_layout v + { .offset = 0x87, .name = "tx_frames_below_65_octets", }, + { .offset = 0x88, .name = "tx_frames_65_to_127_octets", }, + { .offset = 0x89, .name = "tx_frames_128_255_octets", }, +- { .offset = 0x8B, .name = "tx_frames_256_511_octets", }, ++ { .offset = 0x8A, .name = "tx_frames_256_511_octets", }, ++ { .offset = 0x8B, .name = "tx_frames_512_1023_octets", }, + { .offset = 0x8C, .name = "tx_frames_1024_1526_octets", }, + { .offset = 0x8D, .name = "tx_frames_over_1526_octets", }, + { .offset = 0x8E, .name = "tx_yellow_prio_0", }, diff --git a/queue-5.10/net-dsa-microchip-ksz9477-fix-fdb_dump-last-invalid-entry.patch b/queue-5.10/net-dsa-microchip-ksz9477-fix-fdb_dump-last-invalid-entry.patch new file mode 100644 index 00000000000..f4a3e8781af --- /dev/null +++ b/queue-5.10/net-dsa-microchip-ksz9477-fix-fdb_dump-last-invalid-entry.patch @@ -0,0 +1,41 @@ +From 36c0d935015766bf20d621c18313f17691bda5e3 Mon Sep 17 00:00:00 2001 +From: Arun Ramadoss +Date: Tue, 16 Aug 2022 16:25:16 +0530 +Subject: net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry + +From: Arun Ramadoss + +commit 36c0d935015766bf20d621c18313f17691bda5e3 upstream. + +In the ksz9477_fdb_dump function it reads the ALU control register and +exit from the timeout loop if there is valid entry or search is +complete. After exiting the loop, it reads the alu entry and report to +the user space irrespective of entry is valid. It works till the valid +entry. If the loop exited when search is complete, it reads the alu +table. The table returns all ones and it is reported to user space. So +bridge fdb show gives ff:ff:ff:ff:ff:ff as last entry for every port. +To fix it, after exiting the loop the entry is reported only if it is +valid one. + +Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") +Signed-off-by: Arun Ramadoss +Reviewed-by: Vladimir Oltean +Link: https://lore.kernel.org/r/20220816105516.18350-1-arun.ramadoss@microchip.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/dsa/microchip/ksz9477.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/dsa/microchip/ksz9477.c ++++ b/drivers/net/dsa/microchip/ksz9477.c +@@ -762,6 +762,9 @@ static int ksz9477_port_fdb_dump(struct + goto exit; + } + ++ if (!(ksz_data & ALU_VALID)) ++ continue; ++ + /* read ALU table */ + ksz9477_read_table(dev, alu_table); + diff --git a/queue-5.10/net-dsa-mv88e6060-prevent-crash-on-an-unused-port.patch b/queue-5.10/net-dsa-mv88e6060-prevent-crash-on-an-unused-port.patch new file mode 100644 index 00000000000..e0cda12acf2 --- /dev/null +++ b/queue-5.10/net-dsa-mv88e6060-prevent-crash-on-an-unused-port.patch @@ -0,0 +1,53 @@ +From 246bbf2f977ea36aaf41f5d24370fef433250728 Mon Sep 17 00:00:00 2001 +From: Sergei Antonov +Date: Thu, 11 Aug 2022 10:09:39 +0300 +Subject: net: dsa: mv88e6060: prevent crash on an unused port + +From: Sergei Antonov + +commit 246bbf2f977ea36aaf41f5d24370fef433250728 upstream. + +If the port isn't a CPU port nor a user port, 'cpu_dp' +is a null pointer and a crash happened on dereferencing +it in mv88e6060_setup_port(): + +[ 9.575872] Unable to handle kernel NULL pointer dereference at virtual address 00000014 +... +[ 9.942216] mv88e6060_setup from dsa_register_switch+0x814/0xe84 +[ 9.948616] dsa_register_switch from mdio_probe+0x2c/0x54 +[ 9.954433] mdio_probe from really_probe.part.0+0x98/0x2a0 +[ 9.960375] really_probe.part.0 from driver_probe_device+0x30/0x10c +[ 9.967029] driver_probe_device from __device_attach_driver+0xb8/0x13c +[ 9.973946] __device_attach_driver from bus_for_each_drv+0x90/0xe0 +[ 9.980509] bus_for_each_drv from __device_attach+0x110/0x184 +[ 9.986632] __device_attach from bus_probe_device+0x8c/0x94 +[ 9.992577] bus_probe_device from deferred_probe_work_func+0x78/0xa8 +[ 9.999311] deferred_probe_work_func from process_one_work+0x290/0x73c +[ 10.006292] process_one_work from worker_thread+0x30/0x4b8 +[ 10.012155] worker_thread from kthread+0xd4/0x10c +[ 10.017238] kthread from ret_from_fork+0x14/0x3c + +Fixes: 0abfd494deef ("net: dsa: use dedicated CPU port") +CC: Vivien Didelot +CC: Florian Fainelli +Signed-off-by: Sergei Antonov +Signed-off-by: Vladimir Oltean +Link: https://lore.kernel.org/r/20220811070939.1717146-1-saproj@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/dsa/mv88e6060.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/dsa/mv88e6060.c ++++ b/drivers/net/dsa/mv88e6060.c +@@ -118,6 +118,9 @@ static int mv88e6060_setup_port(struct m + int addr = REG_PORT(p); + int ret; + ++ if (dsa_is_unused_port(priv->ds, p)) ++ return 0; ++ + /* Do not force flow control, disable Ingress and Egress + * Header tagging, disable VLAN tunneling, and set the port + * state to Forwarding. Additionally, if this is the CPU diff --git a/queue-5.10/net-dsa-sja1105-fix-buffer-overflow-in-sja1105_setup_devlink_regions.patch b/queue-5.10/net-dsa-sja1105-fix-buffer-overflow-in-sja1105_setup_devlink_regions.patch new file mode 100644 index 00000000000..1a53267b172 --- /dev/null +++ b/queue-5.10/net-dsa-sja1105-fix-buffer-overflow-in-sja1105_setup_devlink_regions.patch @@ -0,0 +1,39 @@ +From fd8e899cdb5ecaf8e8ee73854a99e10807eef1de Mon Sep 17 00:00:00 2001 +From: Rustam Subkhankulov +Date: Wed, 17 Aug 2022 03:38:45 +0300 +Subject: net: dsa: sja1105: fix buffer overflow in sja1105_setup_devlink_regions() + +From: Rustam Subkhankulov + +commit fd8e899cdb5ecaf8e8ee73854a99e10807eef1de upstream. + +If an error occurs in dsa_devlink_region_create(), then 'priv->regions' +array will be accessed by negative index '-1'. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Rustam Subkhankulov +Fixes: bf425b82059e ("net: dsa: sja1105: expose static config as devlink region") +Link: https://lore.kernel.org/r/20220817003845.389644-1-subkhankulov@ispras.ru +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/dsa/sja1105/sja1105_devlink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/dsa/sja1105/sja1105_devlink.c b/drivers/net/dsa/sja1105/sja1105_devlink.c +index 0569ff066634..10c6fea1227f 100644 +--- a/drivers/net/dsa/sja1105/sja1105_devlink.c ++++ b/drivers/net/dsa/sja1105/sja1105_devlink.c +@@ -93,7 +93,7 @@ static int sja1105_setup_devlink_regions(struct dsa_switch *ds) + + region = dsa_devlink_region_create(ds, ops, 1, size); + if (IS_ERR(region)) { +- while (i-- >= 0) ++ while (--i >= 0) + dsa_devlink_region_destroy(priv->regions[i]); + return PTR_ERR(region); + } +-- +2.37.2 + diff --git a/queue-5.10/net-genl-fix-error-path-memory-leak-in-policy-dumping.patch b/queue-5.10/net-genl-fix-error-path-memory-leak-in-policy-dumping.patch new file mode 100644 index 00000000000..77971b38450 --- /dev/null +++ b/queue-5.10/net-genl-fix-error-path-memory-leak-in-policy-dumping.patch @@ -0,0 +1,84 @@ +From 249801360db3dec4f73768c502192020bfddeacc Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Tue, 16 Aug 2022 09:19:39 -0700 +Subject: net: genl: fix error path memory leak in policy dumping + +From: Jakub Kicinski + +commit 249801360db3dec4f73768c502192020bfddeacc upstream. + +If construction of the array of policies fails when recording +non-first policy we need to unwind. + +netlink_policy_dump_add_policy() itself also needs fixing as +it currently gives up on error without recording the allocated +pointer in the pstate pointer. + +Reported-by: syzbot+dc54d9ba8153b216cae0@syzkaller.appspotmail.com +Fixes: 50a896cf2d6f ("genetlink: properly support per-op policy dumping") +Link: https://lore.kernel.org/r/20220816161939.577583-1-kuba@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/netlink/genetlink.c | 6 +++++- + net/netlink/policy.c | 14 ++++++++++++-- + 2 files changed, 17 insertions(+), 3 deletions(-) + +--- a/net/netlink/genetlink.c ++++ b/net/netlink/genetlink.c +@@ -1182,13 +1182,17 @@ static int ctrl_dumppolicy_start(struct + op.policy, + op.maxattr); + if (err) +- return err; ++ goto err_free_state; + } + } + + if (!ctx->state) + return -ENODATA; + return 0; ++ ++err_free_state: ++ netlink_policy_dump_free(ctx->state); ++ return err; + } + + static void *ctrl_dumppolicy_prep(struct sk_buff *skb, +--- a/net/netlink/policy.c ++++ b/net/netlink/policy.c +@@ -144,7 +144,7 @@ int netlink_policy_dump_add_policy(struc + + err = add_policy(&state, policy, maxtype); + if (err) +- return err; ++ goto err_try_undo; + + for (policy_idx = 0; + policy_idx < state->n_alloc && state->policies[policy_idx].policy; +@@ -164,7 +164,7 @@ int netlink_policy_dump_add_policy(struc + policy[type].nested_policy, + policy[type].len); + if (err) +- return err; ++ goto err_try_undo; + break; + default: + break; +@@ -174,6 +174,16 @@ int netlink_policy_dump_add_policy(struc + + *pstate = state; + return 0; ++ ++err_try_undo: ++ /* Try to preserve reasonable unwind semantics - if we're starting from ++ * scratch clean up fully, otherwise record what we got and caller will. ++ */ ++ if (!*pstate) ++ netlink_policy_dump_free(state); ++ else ++ *pstate = state; ++ return err; + } + + static bool diff --git a/queue-5.10/net-moxa-pass-pdev-instead-of-ndev-to-dma-functions.patch b/queue-5.10/net-moxa-pass-pdev-instead-of-ndev-to-dma-functions.patch new file mode 100644 index 00000000000..746f35f08f0 --- /dev/null +++ b/queue-5.10/net-moxa-pass-pdev-instead-of-ndev-to-dma-functions.patch @@ -0,0 +1,111 @@ +From 3a12df22a8f68954a4ba48435c06b3d1791c87c4 Mon Sep 17 00:00:00 2001 +From: Sergei Antonov +Date: Fri, 12 Aug 2022 20:13:39 +0300 +Subject: net: moxa: pass pdev instead of ndev to DMA functions + +From: Sergei Antonov + +commit 3a12df22a8f68954a4ba48435c06b3d1791c87c4 upstream. + +dma_map_single() calls fail in moxart_mac_setup_desc_ring() and +moxart_mac_start_xmit() which leads to an incessant output of this: + +[ 16.043925] moxart-ethernet 92000000.mac eth0: DMA mapping error +[ 16.050957] moxart-ethernet 92000000.mac eth0: DMA mapping error +[ 16.058229] moxart-ethernet 92000000.mac eth0: DMA mapping error + +Passing pdev to DMA is a common approach among net drivers. + +Fixes: 6c821bd9edc9 ("net: Add MOXA ART SoCs ethernet driver") +Signed-off-by: Sergei Antonov +Suggested-by: Andrew Lunn +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/20220812171339.2271788-1-saproj@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/moxa/moxart_ether.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +--- a/drivers/net/ethernet/moxa/moxart_ether.c ++++ b/drivers/net/ethernet/moxa/moxart_ether.c +@@ -77,7 +77,7 @@ static void moxart_mac_free_memory(struc + int i; + + for (i = 0; i < RX_DESC_NUM; i++) +- dma_unmap_single(&ndev->dev, priv->rx_mapping[i], ++ dma_unmap_single(&priv->pdev->dev, priv->rx_mapping[i], + priv->rx_buf_size, DMA_FROM_DEVICE); + + if (priv->tx_desc_base) +@@ -147,11 +147,11 @@ static void moxart_mac_setup_desc_ring(s + desc + RX_REG_OFFSET_DESC1); + + priv->rx_buf[i] = priv->rx_buf_base + priv->rx_buf_size * i; +- priv->rx_mapping[i] = dma_map_single(&ndev->dev, ++ priv->rx_mapping[i] = dma_map_single(&priv->pdev->dev, + priv->rx_buf[i], + priv->rx_buf_size, + DMA_FROM_DEVICE); +- if (dma_mapping_error(&ndev->dev, priv->rx_mapping[i])) ++ if (dma_mapping_error(&priv->pdev->dev, priv->rx_mapping[i])) + netdev_err(ndev, "DMA mapping error\n"); + + moxart_desc_write(priv->rx_mapping[i], +@@ -240,7 +240,7 @@ static int moxart_rx_poll(struct napi_st + if (len > RX_BUF_SIZE) + len = RX_BUF_SIZE; + +- dma_sync_single_for_cpu(&ndev->dev, ++ dma_sync_single_for_cpu(&priv->pdev->dev, + priv->rx_mapping[rx_head], + priv->rx_buf_size, DMA_FROM_DEVICE); + skb = netdev_alloc_skb_ip_align(ndev, len); +@@ -294,7 +294,7 @@ static void moxart_tx_finished(struct ne + unsigned int tx_tail = priv->tx_tail; + + while (tx_tail != tx_head) { +- dma_unmap_single(&ndev->dev, priv->tx_mapping[tx_tail], ++ dma_unmap_single(&priv->pdev->dev, priv->tx_mapping[tx_tail], + priv->tx_len[tx_tail], DMA_TO_DEVICE); + + ndev->stats.tx_packets++; +@@ -358,9 +358,9 @@ static netdev_tx_t moxart_mac_start_xmit + + len = skb->len > TX_BUF_SIZE ? TX_BUF_SIZE : skb->len; + +- priv->tx_mapping[tx_head] = dma_map_single(&ndev->dev, skb->data, ++ priv->tx_mapping[tx_head] = dma_map_single(&priv->pdev->dev, skb->data, + len, DMA_TO_DEVICE); +- if (dma_mapping_error(&ndev->dev, priv->tx_mapping[tx_head])) { ++ if (dma_mapping_error(&priv->pdev->dev, priv->tx_mapping[tx_head])) { + netdev_err(ndev, "DMA mapping error\n"); + goto out_unlock; + } +@@ -379,7 +379,7 @@ static netdev_tx_t moxart_mac_start_xmit + len = ETH_ZLEN; + } + +- dma_sync_single_for_device(&ndev->dev, priv->tx_mapping[tx_head], ++ dma_sync_single_for_device(&priv->pdev->dev, priv->tx_mapping[tx_head], + priv->tx_buf_size, DMA_TO_DEVICE); + + txdes1 = TX_DESC1_LTS | TX_DESC1_FTS | (len & TX_DESC1_BUF_SIZE_MASK); +@@ -494,7 +494,7 @@ static int moxart_mac_probe(struct platf + priv->tx_buf_size = TX_BUF_SIZE; + priv->rx_buf_size = RX_BUF_SIZE; + +- priv->tx_desc_base = dma_alloc_coherent(&pdev->dev, TX_REG_DESC_SIZE * ++ priv->tx_desc_base = dma_alloc_coherent(p_dev, TX_REG_DESC_SIZE * + TX_DESC_NUM, &priv->tx_base, + GFP_DMA | GFP_KERNEL); + if (!priv->tx_desc_base) { +@@ -502,7 +502,7 @@ static int moxart_mac_probe(struct platf + goto init_fail; + } + +- priv->rx_desc_base = dma_alloc_coherent(&pdev->dev, RX_REG_DESC_SIZE * ++ priv->rx_desc_base = dma_alloc_coherent(p_dev, RX_REG_DESC_SIZE * + RX_DESC_NUM, &priv->rx_base, + GFP_DMA | GFP_KERNEL); + if (!priv->rx_desc_base) { diff --git a/queue-5.10/netfilter-nf_tables-check-nft_set_concat-flag-if-field_count-is-specified.patch b/queue-5.10/netfilter-nf_tables-check-nft_set_concat-flag-if-field_count-is-specified.patch new file mode 100644 index 00000000000..c3620dc2767 --- /dev/null +++ b/queue-5.10/netfilter-nf_tables-check-nft_set_concat-flag-if-field_count-is-specified.patch @@ -0,0 +1,40 @@ +From 1b6345d4160ecd3d04bd8cd75df90c67811e8cc9 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Mon, 15 Aug 2022 17:55:07 +0200 +Subject: netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified + +From: Pablo Neira Ayuso + +commit 1b6345d4160ecd3d04bd8cd75df90c67811e8cc9 upstream. + +Since f3a2181e16f1 ("netfilter: nf_tables: Support for sets with +multiple ranged fields"), it possible to combine intervals and +concatenations. Later on, ef516e8625dd ("netfilter: nf_tables: +reintroduce the NFT_SET_CONCAT flag") provides the NFT_SET_CONCAT flag +for userspace to report that the set stores a concatenation. + +Make sure NFT_SET_CONCAT is set on if field_count is specified for +consistency. Otherwise, if NFT_SET_CONCAT is specified with no +field_count, bail out with EINVAL. + +Fixes: ef516e8625dd ("netfilter: nf_tables: reintroduce the NFT_SET_CONCAT flag") +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman +--- + net/netfilter/nf_tables_api.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/net/netfilter/nf_tables_api.c ++++ b/net/netfilter/nf_tables_api.c +@@ -4241,6 +4241,11 @@ static int nf_tables_newset(struct net * + err = nf_tables_set_desc_parse(&desc, nla[NFTA_SET_DESC]); + if (err < 0) + return err; ++ ++ if (desc.field_count > 1 && !(flags & NFT_SET_CONCAT)) ++ return -EINVAL; ++ } else if (flags & NFT_SET_CONCAT) { ++ return -EINVAL; + } + + if (nla[NFTA_SET_EXPR]) diff --git a/queue-5.10/netfilter-nf_tables-really-skip-inactive-sets-when-allocating-name.patch b/queue-5.10/netfilter-nf_tables-really-skip-inactive-sets-when-allocating-name.patch new file mode 100644 index 00000000000..6eed60ad38b --- /dev/null +++ b/queue-5.10/netfilter-nf_tables-really-skip-inactive-sets-when-allocating-name.patch @@ -0,0 +1,30 @@ +From 271c5ca826e0c3c53e0eb4032f8eaedea1ee391c Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Tue, 9 Aug 2022 17:23:53 +0200 +Subject: netfilter: nf_tables: really skip inactive sets when allocating name + +From: Pablo Neira Ayuso + +commit 271c5ca826e0c3c53e0eb4032f8eaedea1ee391c upstream. + +While looping to build the bitmap of used anonymous set names, check the +current set in the iteration, instead of the one that is being created. + +Fixes: 37a9cc525525 ("netfilter: nf_tables: add generation mask to sets") +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman +--- + net/netfilter/nf_tables_api.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/netfilter/nf_tables_api.c ++++ b/net/netfilter/nf_tables_api.c +@@ -3702,7 +3702,7 @@ cont: + list_for_each_entry(i, &ctx->table->sets, list) { + int tmp; + +- if (!nft_is_active_next(ctx->net, set)) ++ if (!nft_is_active_next(ctx->net, i)) + continue; + if (!sscanf(i->name, name, &tmp)) + continue; diff --git a/queue-5.10/netfilter-nf_tables-validate-nfta_set_elem_objref-based-on-nft_set_object-flag.patch b/queue-5.10/netfilter-nf_tables-validate-nfta_set_elem_objref-based-on-nft_set_object-flag.patch new file mode 100644 index 00000000000..d410f96385b --- /dev/null +++ b/queue-5.10/netfilter-nf_tables-validate-nfta_set_elem_objref-based-on-nft_set_object-flag.patch @@ -0,0 +1,51 @@ +From 5a2f3dc31811e93be15522d9eb13ed61460b76c8 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Fri, 12 Aug 2022 16:19:23 +0200 +Subject: netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag + +From: Pablo Neira Ayuso + +commit 5a2f3dc31811e93be15522d9eb13ed61460b76c8 upstream. + +If the NFTA_SET_ELEM_OBJREF netlink attribute is present and +NFT_SET_OBJECT flag is set on, report EINVAL. + +Move existing sanity check earlier to validate that NFT_SET_OBJECT +requires NFTA_SET_ELEM_OBJREF. + +Fixes: 8aeff920dcc9 ("netfilter: nf_tables: add stateful object reference to set elements") +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman +--- + net/netfilter/nf_tables_api.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/net/netfilter/nf_tables_api.c ++++ b/net/netfilter/nf_tables_api.c +@@ -5245,6 +5245,15 @@ static int nft_add_set_elem(struct nft_c + return -EINVAL; + } + ++ if (set->flags & NFT_SET_OBJECT) { ++ if (!nla[NFTA_SET_ELEM_OBJREF] && ++ !(flags & NFT_SET_ELEM_INTERVAL_END)) ++ return -EINVAL; ++ } else { ++ if (nla[NFTA_SET_ELEM_OBJREF]) ++ return -EINVAL; ++ } ++ + if ((flags & NFT_SET_ELEM_INTERVAL_END) && + (nla[NFTA_SET_ELEM_DATA] || + nla[NFTA_SET_ELEM_OBJREF] || +@@ -5322,10 +5331,6 @@ static int nft_add_set_elem(struct nft_c + expr->ops->size); + + if (nla[NFTA_SET_ELEM_OBJREF] != NULL) { +- if (!(set->flags & NFT_SET_OBJECT)) { +- err = -EINVAL; +- goto err_parse_key_end; +- } + obj = nft_obj_lookup(ctx->net, ctx->table, + nla[NFTA_SET_ELEM_OBJREF], + set->objtype, genmask); diff --git a/queue-5.10/powerpc-pci-fix-get_phb_number-locking.patch b/queue-5.10/powerpc-pci-fix-get_phb_number-locking.patch new file mode 100644 index 00000000000..21c325e9e33 --- /dev/null +++ b/queue-5.10/powerpc-pci-fix-get_phb_number-locking.patch @@ -0,0 +1,105 @@ +From 8d48562a2729742f767b0fdd994d6b2a56a49c63 Mon Sep 17 00:00:00 2001 +From: Michael Ellerman +Date: Mon, 15 Aug 2022 16:55:23 +1000 +Subject: powerpc/pci: Fix get_phb_number() locking + +From: Michael Ellerman + +commit 8d48562a2729742f767b0fdd994d6b2a56a49c63 upstream. + +The recent change to get_phb_number() causes a DEBUG_ATOMIC_SLEEP +warning on some systems: + + BUG: sleeping function called from invalid context at kernel/locking/mutex.c:580 + in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper + preempt_count: 1, expected: 0 + RCU nest depth: 0, expected: 0 + 1 lock held by swapper/1: + #0: c157efb0 (hose_spinlock){+.+.}-{2:2}, at: pcibios_alloc_controller+0x64/0x220 + Preemption disabled at: + [<00000000>] 0x0 + CPU: 0 PID: 1 Comm: swapper Not tainted 5.19.0-yocto-standard+ #1 + Call Trace: + [d101dc90] [c073b264] dump_stack_lvl+0x50/0x8c (unreliable) + [d101dcb0] [c0093b70] __might_resched+0x258/0x2a8 + [d101dcd0] [c0d3e634] __mutex_lock+0x6c/0x6ec + [d101dd50] [c0a84174] of_alias_get_id+0x50/0xf4 + [d101dd80] [c002ec78] pcibios_alloc_controller+0x1b8/0x220 + [d101ddd0] [c140c9dc] pmac_pci_init+0x198/0x784 + [d101de50] [c140852c] discover_phbs+0x30/0x4c + [d101de60] [c0007fd4] do_one_initcall+0x94/0x344 + [d101ded0] [c1403b40] kernel_init_freeable+0x1a8/0x22c + [d101df10] [c00086e0] kernel_init+0x34/0x160 + [d101df30] [c001b334] ret_from_kernel_thread+0x5c/0x64 + +This is because pcibios_alloc_controller() holds hose_spinlock but +of_alias_get_id() takes of_mutex which can sleep. + +The hose_spinlock protects the phb_bitmap, and also the hose_list, but +it doesn't need to be held while get_phb_number() calls the OF routines, +because those are only looking up information in the device tree. + +So fix it by having get_phb_number() take the hose_spinlock itself, only +where required, and then dropping the lock before returning. +pcibios_alloc_controller() then needs to take the lock again before the +list_add() but that's safe, the order of the list is not important. + +Fixes: 0fe1e96fef0a ("powerpc/pci: Prefer PCI domain assignment via DT 'linux,pci-domain' and alias") +Reported-by: Guenter Roeck +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20220815065550.1303620-1-mpe@ellerman.id.au +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/kernel/pci-common.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/arch/powerpc/kernel/pci-common.c ++++ b/arch/powerpc/kernel/pci-common.c +@@ -66,10 +66,6 @@ void set_pci_dma_ops(const struct dma_ma + pci_dma_ops = dma_ops; + } + +-/* +- * This function should run under locking protection, specifically +- * hose_spinlock. +- */ + static int get_phb_number(struct device_node *dn) + { + int ret, phb_id = -1; +@@ -106,15 +102,20 @@ static int get_phb_number(struct device_ + if (!ret) + phb_id = (int)(prop & (MAX_PHBS - 1)); + ++ spin_lock(&hose_spinlock); ++ + /* We need to be sure to not use the same PHB number twice. */ + if ((phb_id >= 0) && !test_and_set_bit(phb_id, phb_bitmap)) +- return phb_id; ++ goto out_unlock; + + /* If everything fails then fallback to dynamic PHB numbering. */ + phb_id = find_first_zero_bit(phb_bitmap, MAX_PHBS); + BUG_ON(phb_id >= MAX_PHBS); + set_bit(phb_id, phb_bitmap); + ++out_unlock: ++ spin_unlock(&hose_spinlock); ++ + return phb_id; + } + +@@ -125,10 +126,13 @@ struct pci_controller *pcibios_alloc_con + phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL); + if (phb == NULL) + return NULL; +- spin_lock(&hose_spinlock); ++ + phb->global_number = get_phb_number(dev); ++ ++ spin_lock(&hose_spinlock); + list_add_tail(&phb->list_node, &hose_list); + spin_unlock(&hose_spinlock); ++ + phb->dn = dev; + phb->is_dynamic = slab_is_available(); + #ifdef CONFIG_PPC64 diff --git a/queue-5.10/regulator-pca9450-remove-restrictions-for-regulator-name.patch b/queue-5.10/regulator-pca9450-remove-restrictions-for-regulator-name.patch new file mode 100644 index 00000000000..f0ff0ac319d --- /dev/null +++ b/queue-5.10/regulator-pca9450-remove-restrictions-for-regulator-name.patch @@ -0,0 +1,55 @@ +From b0de7fa706506bf0591037908376351beda8c5d6 Mon Sep 17 00:00:00 2001 +From: Frieder Schrempf +Date: Tue, 2 Aug 2022 08:43:34 +0200 +Subject: regulator: pca9450: Remove restrictions for regulator-name + +From: Frieder Schrempf + +commit b0de7fa706506bf0591037908376351beda8c5d6 upstream. + +The device bindings shouldn't put any constraints on the regulator-name +property specified in the generic bindings. This allows using arbitrary +and descriptive names for the regulators. + +Suggested-by: Mark Brown +Fixes: 7ae9e3a6bf3f ("dt-bindings: regulator: add pca9450 regulator yaml") +Signed-off-by: Frieder Schrempf +Link: https://lore.kernel.org/r/20220802064335.8481-1-frieder@fris.de +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + .../bindings/regulator/nxp,pca9450-regulator.yaml | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml +index b539781e39aa..835b53302db8 100644 +--- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml ++++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml +@@ -47,12 +47,6 @@ properties: + description: + Properties for single LDO regulator. + +- properties: +- regulator-name: +- pattern: "^LDO[1-5]$" +- description: +- should be "LDO1", ..., "LDO5" +- + unevaluatedProperties: false + + "^BUCK[1-6]$": +@@ -62,11 +56,6 @@ properties: + Properties for single BUCK regulator. + + properties: +- regulator-name: +- pattern: "^BUCK[1-6]$" +- description: +- should be "BUCK1", ..., "BUCK6" +- + nxp,dvs-run-voltage: + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 600000 +-- +2.37.2 + diff --git a/queue-5.10/series b/queue-5.10/series index d2b1bd6192e..df79c2608f8 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -72,3 +72,23 @@ asoc-tas2770-set-correct-fsync-polarity.patch asoc-tas2770-allow-mono-streams.patch asoc-tas2770-drop-conflicting-set_bias_level-power-setting.patch asoc-tas2770-fix-handling-of-mute-unmute.patch +netfilter-nf_tables-really-skip-inactive-sets-when-allocating-name.patch +netfilter-nf_tables-validate-nfta_set_elem_objref-based-on-nft_set_object-flag.patch +netfilter-nf_tables-check-nft_set_concat-flag-if-field_count-is-specified.patch +powerpc-pci-fix-get_phb_number-locking.patch +spi-meson-spicc-add-local-pow2-clock-ops-to-preserve-rate-between-messages.patch +net-dsa-mv88e6060-prevent-crash-on-an-unused-port.patch +net-moxa-pass-pdev-instead-of-ndev-to-dma-functions.patch +net-dsa-microchip-ksz9477-fix-fdb_dump-last-invalid-entry.patch +net-dsa-felix-fix-ethtool-256-511-and-512-1023-tx-packet-counters.patch +net-genl-fix-error-path-memory-leak-in-policy-dumping.patch +net-dsa-sja1105-fix-buffer-overflow-in-sja1105_setup_devlink_regions.patch +ice-ignore-eexist-when-setting-promisc-mode.patch +i2c-imx-make-sure-to-unregister-adapter-on-remove.patch +regulator-pca9450-remove-restrictions-for-regulator-name.patch +i40e-fix-to-stop-tx_timeout-recovery-if-globr-fails.patch +fec-fix-timer-capture-timing-in-fec_ptp_enable_pps.patch +stmmac-intel-add-a-missing-clk_disable_unprepare-call-in-intel_eth_pci_remove.patch +igb-add-lock-to-avoid-data-race.patch +kbuild-fix-the-modules-order-between-drivers-and-libs.patch +gcc-plugins-undefine-latent_entropy_plugin-when-plugin-disabled-for-a-file.patch diff --git a/queue-5.10/spi-meson-spicc-add-local-pow2-clock-ops-to-preserve-rate-between-messages.patch b/queue-5.10/spi-meson-spicc-add-local-pow2-clock-ops-to-preserve-rate-between-messages.patch new file mode 100644 index 00000000000..9504df0a68e --- /dev/null +++ b/queue-5.10/spi-meson-spicc-add-local-pow2-clock-ops-to-preserve-rate-between-messages.patch @@ -0,0 +1,255 @@ +From 09992025dacd258c823f50e82db09d7ef06cdac4 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Thu, 11 Aug 2022 15:44:45 +0200 +Subject: spi: meson-spicc: add local pow2 clock ops to preserve rate between messages + +From: Neil Armstrong + +commit 09992025dacd258c823f50e82db09d7ef06cdac4 upstream. + +At the end of a message, the HW gets a reset in meson_spicc_unprepare_transfer(), +this resets the SPICC_CONREG register and notably the value set by the +Common Clock Framework. + +This is problematic because: +- the register value CCF can be different from the corresponding CCF cached rate +- CCF is allowed to change the clock rate whenever the HW state + +This introduces: +- local pow2 clock ops checking the HW state before allowing a clock operation +- separation of legacy pow2 clock patch and new enhanced clock path +- SPICC_CONREG datarate value is now value kepts across messages + +It has been checked that: +- SPICC_CONREG datarate value is kept across messages +- CCF is only allowed to change the SPICC_CONREG datarate value when busy +- SPICC_CONREG datarate value is correct for each transfer + +This didn't appear before commit 3e0cf4d3fc29 ("spi: meson-spicc: add a linear clock divider support") +because we recalculated and wrote the rate for each xfer. + +Fixes: 3e0cf4d3fc29 ("spi: meson-spicc: add a linear clock divider support") +Reported-by: Da Xue +Signed-off-by: Neil Armstrong +Link: https://lore.kernel.org/r/20220811134445.678446-1-narmstrong@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-meson-spicc.c | 129 ++++++++++++++++++++++++++++++++---------- + 1 file changed, 101 insertions(+), 28 deletions(-) + +--- a/drivers/spi/spi-meson-spicc.c ++++ b/drivers/spi/spi-meson-spicc.c +@@ -156,6 +156,7 @@ struct meson_spicc_device { + void __iomem *base; + struct clk *core; + struct clk *pclk; ++ struct clk_divider pow2_div; + struct clk *clk; + struct spi_message *message; + struct spi_transfer *xfer; +@@ -168,6 +169,8 @@ struct meson_spicc_device { + unsigned long xfer_remain; + }; + ++#define pow2_clk_to_spicc(_div) container_of(_div, struct meson_spicc_device, pow2_div) ++ + static void meson_spicc_oen_enable(struct meson_spicc_device *spicc) + { + u32 conf; +@@ -421,7 +424,7 @@ static int meson_spicc_prepare_message(s + { + struct meson_spicc_device *spicc = spi_master_get_devdata(master); + struct spi_device *spi = message->spi; +- u32 conf = 0; ++ u32 conf = readl_relaxed(spicc->base + SPICC_CONREG) & SPICC_DATARATE_MASK; + + /* Store current message */ + spicc->message = message; +@@ -458,8 +461,6 @@ static int meson_spicc_prepare_message(s + /* Select CS */ + conf |= FIELD_PREP(SPICC_CS_MASK, spi->chip_select); + +- /* Default Clock rate core/4 */ +- + /* Default 8bit word */ + conf |= FIELD_PREP(SPICC_BITLENGTH_MASK, 8 - 1); + +@@ -476,12 +477,16 @@ static int meson_spicc_prepare_message(s + static int meson_spicc_unprepare_transfer(struct spi_master *master) + { + struct meson_spicc_device *spicc = spi_master_get_devdata(master); ++ u32 conf = readl_relaxed(spicc->base + SPICC_CONREG) & SPICC_DATARATE_MASK; + + /* Disable all IRQs */ + writel(0, spicc->base + SPICC_INTREG); + + device_reset_optional(&spicc->pdev->dev); + ++ /* Set default configuration, keeping datarate field */ ++ writel_relaxed(conf, spicc->base + SPICC_CONREG); ++ + return 0; + } + +@@ -518,14 +523,60 @@ static void meson_spicc_cleanup(struct s + * Clk path for G12A series: + * pclk -> pow2 fixed div -> pow2 div -> mux -> out + * pclk -> enh fixed div -> enh div -> mux -> out ++ * ++ * The pow2 divider is tied to the controller HW state, and the ++ * divider is only valid when the controller is initialized. ++ * ++ * A set of clock ops is added to make sure we don't read/set this ++ * clock rate while the controller is in an unknown state. + */ + +-static int meson_spicc_clk_init(struct meson_spicc_device *spicc) ++static unsigned long meson_spicc_pow2_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ struct clk_divider *divider = to_clk_divider(hw); ++ struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider); ++ ++ if (!spicc->master->cur_msg || !spicc->master->busy) ++ return 0; ++ ++ return clk_divider_ops.recalc_rate(hw, parent_rate); ++} ++ ++static int meson_spicc_pow2_determine_rate(struct clk_hw *hw, ++ struct clk_rate_request *req) ++{ ++ struct clk_divider *divider = to_clk_divider(hw); ++ struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider); ++ ++ if (!spicc->master->cur_msg || !spicc->master->busy) ++ return -EINVAL; ++ ++ return clk_divider_ops.determine_rate(hw, req); ++} ++ ++static int meson_spicc_pow2_set_rate(struct clk_hw *hw, unsigned long rate, ++ unsigned long parent_rate) ++{ ++ struct clk_divider *divider = to_clk_divider(hw); ++ struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider); ++ ++ if (!spicc->master->cur_msg || !spicc->master->busy) ++ return -EINVAL; ++ ++ return clk_divider_ops.set_rate(hw, rate, parent_rate); ++} ++ ++const struct clk_ops meson_spicc_pow2_clk_ops = { ++ .recalc_rate = meson_spicc_pow2_recalc_rate, ++ .determine_rate = meson_spicc_pow2_determine_rate, ++ .set_rate = meson_spicc_pow2_set_rate, ++}; ++ ++static int meson_spicc_pow2_clk_init(struct meson_spicc_device *spicc) + { + struct device *dev = &spicc->pdev->dev; +- struct clk_fixed_factor *pow2_fixed_div, *enh_fixed_div; +- struct clk_divider *pow2_div, *enh_div; +- struct clk_mux *mux; ++ struct clk_fixed_factor *pow2_fixed_div; + struct clk_init_data init; + struct clk *clk; + struct clk_parent_data parent_data[2]; +@@ -560,31 +611,45 @@ static int meson_spicc_clk_init(struct m + if (WARN_ON(IS_ERR(clk))) + return PTR_ERR(clk); + +- pow2_div = devm_kzalloc(dev, sizeof(*pow2_div), GFP_KERNEL); +- if (!pow2_div) +- return -ENOMEM; +- + snprintf(name, sizeof(name), "%s#pow2_div", dev_name(dev)); + init.name = name; +- init.ops = &clk_divider_ops; +- init.flags = CLK_SET_RATE_PARENT; ++ init.ops = &meson_spicc_pow2_clk_ops; ++ /* ++ * Set NOCACHE here to make sure we read the actual HW value ++ * since we reset the HW after each transfer. ++ */ ++ init.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE; + parent_data[0].hw = &pow2_fixed_div->hw; + init.num_parents = 1; + +- pow2_div->shift = 16, +- pow2_div->width = 3, +- pow2_div->flags = CLK_DIVIDER_POWER_OF_TWO, +- pow2_div->reg = spicc->base + SPICC_CONREG; +- pow2_div->hw.init = &init; ++ spicc->pow2_div.shift = 16, ++ spicc->pow2_div.width = 3, ++ spicc->pow2_div.flags = CLK_DIVIDER_POWER_OF_TWO, ++ spicc->pow2_div.reg = spicc->base + SPICC_CONREG; ++ spicc->pow2_div.hw.init = &init; + +- clk = devm_clk_register(dev, &pow2_div->hw); +- if (WARN_ON(IS_ERR(clk))) +- return PTR_ERR(clk); ++ spicc->clk = devm_clk_register(dev, &spicc->pow2_div.hw); ++ if (WARN_ON(IS_ERR(spicc->clk))) ++ return PTR_ERR(spicc->clk); + +- if (!spicc->data->has_enhance_clk_div) { +- spicc->clk = clk; +- return 0; +- } ++ return 0; ++} ++ ++static int meson_spicc_enh_clk_init(struct meson_spicc_device *spicc) ++{ ++ struct device *dev = &spicc->pdev->dev; ++ struct clk_fixed_factor *enh_fixed_div; ++ struct clk_divider *enh_div; ++ struct clk_mux *mux; ++ struct clk_init_data init; ++ struct clk *clk; ++ struct clk_parent_data parent_data[2]; ++ char name[64]; ++ ++ memset(&init, 0, sizeof(init)); ++ memset(&parent_data, 0, sizeof(parent_data)); ++ ++ init.parent_data = parent_data; + + /* algorithm for enh div: rate = freq / 2 / (N + 1) */ + +@@ -637,7 +702,7 @@ static int meson_spicc_clk_init(struct m + snprintf(name, sizeof(name), "%s#sel", dev_name(dev)); + init.name = name; + init.ops = &clk_mux_ops; +- parent_data[0].hw = &pow2_div->hw; ++ parent_data[0].hw = &spicc->pow2_div.hw; + parent_data[1].hw = &enh_div->hw; + init.num_parents = 2; + init.flags = CLK_SET_RATE_PARENT; +@@ -754,12 +819,20 @@ static int meson_spicc_probe(struct plat + + meson_spicc_oen_enable(spicc); + +- ret = meson_spicc_clk_init(spicc); ++ ret = meson_spicc_pow2_clk_init(spicc); + if (ret) { +- dev_err(&pdev->dev, "clock registration failed\n"); ++ dev_err(&pdev->dev, "pow2 clock registration failed\n"); + goto out_clk; + } + ++ if (spicc->data->has_enhance_clk_div) { ++ ret = meson_spicc_enh_clk_init(spicc); ++ if (ret) { ++ dev_err(&pdev->dev, "clock registration failed\n"); ++ goto out_clk; ++ } ++ } ++ + ret = devm_spi_register_master(&pdev->dev, master); + if (ret) { + dev_err(&pdev->dev, "spi master registration failed\n"); diff --git a/queue-5.10/stmmac-intel-add-a-missing-clk_disable_unprepare-call-in-intel_eth_pci_remove.patch b/queue-5.10/stmmac-intel-add-a-missing-clk_disable_unprepare-call-in-intel_eth_pci_remove.patch new file mode 100644 index 00000000000..ce8bd7ce885 --- /dev/null +++ b/queue-5.10/stmmac-intel-add-a-missing-clk_disable_unprepare-call-in-intel_eth_pci_remove.patch @@ -0,0 +1,47 @@ +From 5c23d6b717e4e956376f3852b90f58e262946b50 Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Tue, 16 Aug 2022 16:23:57 +0200 +Subject: stmmac: intel: Add a missing clk_disable_unprepare() call in intel_eth_pci_remove() + +From: Christophe JAILLET + +commit 5c23d6b717e4e956376f3852b90f58e262946b50 upstream. + +Commit 09f012e64e4b ("stmmac: intel: Fix clock handling on error and remove +paths") removed this clk_disable_unprepare() + +This was partly revert by commit ac322f86b56c ("net: stmmac: Fix clock +handling on remove path") which removed this clk_disable_unprepare() +because: +" + While unloading the dwmac-intel driver, clk_disable_unprepare() is + being called twice in stmmac_dvr_remove() and + intel_eth_pci_remove(). This causes kernel panic on the second call. +" + +However later on, commit 5ec55823438e8 ("net: stmmac: add clocks management +for gmac driver") has updated stmmac_dvr_remove() which do not call +clk_disable_unprepare() anymore. + +So this call should now be called from intel_eth_pci_remove(). + +Fixes: 5ec55823438e8 ("net: stmmac: add clocks management for gmac driver") +Signed-off-by: Christophe JAILLET +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/d7c8c1dadf40df3a7c9e643f76ffadd0ccc1ad1b.1660659689.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +@@ -669,6 +669,7 @@ static void intel_eth_pci_remove(struct + + pci_free_irq_vectors(pdev); + ++ clk_disable_unprepare(priv->plat->stmmac_clk); + clk_unregister_fixed_rate(priv->plat->stmmac_clk); + + pcim_iounmap_regions(pdev, BIT(0));