--- /dev/null
+From 40507e7aada8422c38aafa0c8a1a09e4623c712a Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Wed, 13 Oct 2021 16:35:49 +0200
+Subject: ethernet: s2io: fix setting mac address during resume
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 40507e7aada8422c38aafa0c8a1a09e4623c712a upstream.
+
+After recent cleanups, gcc started warning about a suspicious
+memcpy() call during the s2io_io_resume() function:
+
+In function '__dev_addr_set',
+ inlined from 'eth_hw_addr_set' at include/linux/etherdevice.h:318:2,
+ inlined from 's2io_set_mac_addr' at drivers/net/ethernet/neterion/s2io.c:5205:2,
+ inlined from 's2io_io_resume' at drivers/net/ethernet/neterion/s2io.c:8569:7:
+arch/x86/include/asm/string_32.h:182:25: error: '__builtin_memcpy' accessing 6 bytes at offsets 0 and 2 overlaps 4 bytes at offset 2 [-Werror=restrict]
+ 182 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~
+include/linux/netdevice.h:4648:9: note: in expansion of macro 'memcpy'
+ 4648 | memcpy(dev->dev_addr, addr, len);
+ | ^~~~~~
+
+What apparently happened is that an old cleanup changed the calling
+conventions for s2io_set_mac_addr() from taking an ethernet address
+as a character array to taking a struct sockaddr, but one of the
+callers was not changed at the same time.
+
+Change it to instead call the low-level do_s2io_prog_unicast() function
+that still takes the old argument type.
+
+Fixes: 2fd376884558 ("S2io: Added support set_mac_address driver entry point")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Link: https://lore.kernel.org/r/20211013143613.2049096-1-arnd@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/neterion/s2io.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/neterion/s2io.c
++++ b/drivers/net/ethernet/neterion/s2io.c
+@@ -8555,7 +8555,7 @@ static void s2io_io_resume(struct pci_de
+ return;
+ }
+
+- if (s2io_set_mac_addr(netdev, netdev->dev_addr) == FAILURE) {
++ if (do_s2io_prog_unicast(netdev, netdev->dev_addr) == FAILURE) {
+ s2io_card_down(sp);
+ pr_err("Can't restore mac addr after reset.\n");
+ return;
--- /dev/null
+From 55a9968c7e139209a9e93d4ca4321731bea5fc95 Mon Sep 17 00:00:00 2001
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Date: Fri, 24 Sep 2021 01:46:40 +0300
+Subject: gpio: pca953x: Improve bias setting
+
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+
+commit 55a9968c7e139209a9e93d4ca4321731bea5fc95 upstream.
+
+The commit 15add06841a3 ("gpio: pca953x: add ->set_config implementation")
+introduced support for bias setting. However this, due to being half-baked,
+brought potential issues:
+ - the turning bias via disabling makes the pin floating for a while;
+ - once enabled, bias can't be disabled.
+
+Fix all these by adding support for bias disabling and move the disabling
+part under the corresponding conditional.
+
+While at it, add support for default setting, since it's cheap to add.
+
+Fixes: 15add06841a3 ("gpio: pca953x: add ->set_config implementation")
+Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpio-pca953x.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/drivers/gpio/gpio-pca953x.c
++++ b/drivers/gpio/gpio-pca953x.c
+@@ -558,21 +558,21 @@ static int pca953x_gpio_set_pull_up_down
+
+ mutex_lock(&chip->i2c_lock);
+
+- /* Disable pull-up/pull-down */
+- ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, 0);
+- if (ret)
+- goto exit;
+-
+ /* Configure pull-up/pull-down */
+ if (config == PIN_CONFIG_BIAS_PULL_UP)
+ ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, bit);
+ else if (config == PIN_CONFIG_BIAS_PULL_DOWN)
+ ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, 0);
++ else
++ ret = 0;
+ if (ret)
+ goto exit;
+
+- /* Enable pull-up/pull-down */
+- ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, bit);
++ /* Disable/Enable pull-up/pull-down */
++ if (config == PIN_CONFIG_BIAS_DISABLE)
++ ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, 0);
++ else
++ ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, bit);
+
+ exit:
+ mutex_unlock(&chip->i2c_lock);
+@@ -586,7 +586,9 @@ static int pca953x_gpio_set_config(struc
+
+ switch (pinconf_to_config_param(config)) {
+ case PIN_CONFIG_BIAS_PULL_UP:
++ case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
+ case PIN_CONFIG_BIAS_PULL_DOWN:
++ case PIN_CONFIG_BIAS_DISABLE:
+ return pca953x_gpio_set_pull_up_down(chip, offset, config);
+ default:
+ return -ENOTSUPP;
--- /dev/null
+From e599ee234ad4fdfe241d937bbabd96e0d8f9d868 Mon Sep 17 00:00:00 2001
+From: Vegard Nossum <vegard.nossum@oracle.com>
+Date: Tue, 12 Oct 2021 11:34:46 +0200
+Subject: net: arc: select CRC32
+
+From: Vegard Nossum <vegard.nossum@oracle.com>
+
+commit e599ee234ad4fdfe241d937bbabd96e0d8f9d868 upstream.
+
+Fix the following build/link error by adding a dependency on the CRC32
+routines:
+
+ ld: drivers/net/ethernet/arc/emac_main.o: in function `arc_emac_set_rx_mode':
+ emac_main.c:(.text+0xb11): undefined reference to `crc32_le'
+
+The crc32_le() call comes through the ether_crc_le() call in
+arc_emac_set_rx_mode().
+
+[v2: moved the select to ARC_EMAC_CORE; the Makefile is a bit confusing,
+but the error comes from emac_main.o, which is part of the arc_emac module,
+which in turn is enabled by CONFIG_ARC_EMAC_CORE. Note that arc_emac is
+different from emac_arc...]
+
+Fixes: 775dd682e2b0ec ("arc_emac: implement promiscuous mode and multicast filtering")
+Cc: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
+Link: https://lore.kernel.org/r/20211012093446.1575-1-vegard.nossum@oracle.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/arc/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/arc/Kconfig
++++ b/drivers/net/ethernet/arc/Kconfig
+@@ -21,6 +21,7 @@ config ARC_EMAC_CORE
+ depends on ARC || ARCH_ROCKCHIP || COMPILE_TEST
+ select MII
+ select PHYLIB
++ select CRC32
+
+ config ARC_EMAC
+ tristate "ARC EMAC support"
--- /dev/null
+From ef1100ef20f29aec4e62abeccdb5bdbebba1e378 Mon Sep 17 00:00:00 2001
+From: Arun Ramadoss <arun.ramadoss@microchip.com>
+Date: Mon, 11 Oct 2021 21:18:08 +0530
+Subject: net: dsa: microchip: Added the condition for scheduling ksz_mib_read_work
+
+From: Arun Ramadoss <arun.ramadoss@microchip.com>
+
+commit ef1100ef20f29aec4e62abeccdb5bdbebba1e378 upstream.
+
+When the ksz module is installed and removed using rmmod, kernel crashes
+with null pointer dereferrence error. During rmmod, ksz_switch_remove
+function tries to cancel the mib_read_workqueue using
+cancel_delayed_work_sync routine and unregister switch from dsa.
+
+During dsa_unregister_switch it calls ksz_mac_link_down, which in turn
+reschedules the workqueue since mib_interval is non-zero.
+Due to which queue executed after mib_interval and it tries to access
+dp->slave. But the slave is unregistered in the ksz_switch_remove
+function. Hence kernel crashes.
+
+To avoid this crash, before canceling the workqueue, resetted the
+mib_interval to 0.
+
+v1 -> v2:
+-Removed the if condition in ksz_mib_read_work
+
+Fixes: 469b390e1ba3 ("net: dsa: microchip: use delayed_work instead of timer + work")
+Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/dsa/microchip/ksz_common.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/dsa/microchip/ksz_common.c
++++ b/drivers/net/dsa/microchip/ksz_common.c
+@@ -460,8 +460,10 @@ EXPORT_SYMBOL(ksz_switch_register);
+ void ksz_switch_remove(struct ksz_device *dev)
+ {
+ /* timer started */
+- if (dev->mib_read_interval)
++ if (dev->mib_read_interval) {
++ dev->mib_read_interval = 0;
+ cancel_delayed_work_sync(&dev->mib_read);
++ }
+
+ dev->dev_ops->exit(dev);
+ dsa_unregister_switch(dev->ds);
--- /dev/null
+From f03dca0c9e2297c84a018e306f8a9cd534ee4287 Mon Sep 17 00:00:00 2001
+From: Nanyong Sun <sunnanyong@huawei.com>
+Date: Tue, 12 Oct 2021 20:59:01 +0800
+Subject: net: encx24j600: check error in devm_regmap_init_encx24j600
+
+From: Nanyong Sun <sunnanyong@huawei.com>
+
+commit f03dca0c9e2297c84a018e306f8a9cd534ee4287 upstream.
+
+devm_regmap_init may return error which caused by like out of memory,
+this will results in null pointer dereference later when reading
+or writing register:
+
+general protection fault in encx24j600_spi_probe
+KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097]
+CPU: 0 PID: 286 Comm: spi-encx24j600- Not tainted 5.15.0-rc2-00142-g9978db750e31-dirty #11 9c53a778c1306b1b02359f3c2bbedc0222cba652
+Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
+RIP: 0010:regcache_cache_bypass drivers/base/regmap/regcache.c:540
+Code: 54 41 89 f4 55 53 48 89 fb 48 83 ec 08 e8 26 94 a8 fe 48 8d bb a0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 4a 03 00 00 4c 8d ab b0 00 00 00 48 8b ab a0 00
+RSP: 0018:ffffc900010476b8 EFLAGS: 00010207
+RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: 0000000000000000
+RDX: 0000000000000012 RSI: ffff888002de0000 RDI: 0000000000000094
+RBP: ffff888013c9a000 R08: 0000000000000000 R09: fffffbfff3f9cc6a
+R10: ffffc900010476e8 R11: fffffbfff3f9cc69 R12: 0000000000000001
+R13: 000000000000000a R14: ffff888013c9af54 R15: ffff888013c9ad08
+FS: 00007ffa984ab580(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000
+CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 000055a6384136c8 CR3: 000000003bbe6003 CR4: 0000000000770ef0
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+PKRU: 55555554
+Call Trace:
+ encx24j600_spi_probe drivers/net/ethernet/microchip/encx24j600.c:459
+ spi_probe drivers/spi/spi.c:397
+ really_probe drivers/base/dd.c:517
+ __driver_probe_device drivers/base/dd.c:751
+ driver_probe_device drivers/base/dd.c:782
+ __device_attach_driver drivers/base/dd.c:899
+ bus_for_each_drv drivers/base/bus.c:427
+ __device_attach drivers/base/dd.c:971
+ bus_probe_device drivers/base/bus.c:487
+ device_add drivers/base/core.c:3364
+ __spi_add_device drivers/spi/spi.c:599
+ spi_add_device drivers/spi/spi.c:641
+ spi_new_device drivers/spi/spi.c:717
+ new_device_store+0x18c/0x1f1 [spi_stub 4e02719357f1ff33f5a43d00630982840568e85e]
+ dev_attr_store drivers/base/core.c:2074
+ sysfs_kf_write fs/sysfs/file.c:139
+ kernfs_fop_write_iter fs/kernfs/file.c:300
+ new_sync_write fs/read_write.c:508 (discriminator 4)
+ vfs_write fs/read_write.c:594
+ ksys_write fs/read_write.c:648
+ do_syscall_64 arch/x86/entry/common.c:50
+ entry_SYSCALL_64_after_hwframe arch/x86/entry/entry_64.S:113
+
+Add error check in devm_regmap_init_encx24j600 to avoid this situation.
+
+Fixes: 04fbfce7a222 ("net: Microchip encx24j600 driver")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
+Link: https://lore.kernel.org/r/20211012125901.3623144-1-sunnanyong@huawei.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/microchip/encx24j600-regmap.c | 10 ++++++++--
+ drivers/net/ethernet/microchip/encx24j600.c | 5 ++++-
+ drivers/net/ethernet/microchip/encx24j600_hw.h | 4 ++--
+ 3 files changed, 14 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/ethernet/microchip/encx24j600-regmap.c
++++ b/drivers/net/ethernet/microchip/encx24j600-regmap.c
+@@ -497,13 +497,19 @@ static struct regmap_bus phymap_encx24j6
+ .reg_read = regmap_encx24j600_phy_reg_read,
+ };
+
+-void devm_regmap_init_encx24j600(struct device *dev,
+- struct encx24j600_context *ctx)
++int devm_regmap_init_encx24j600(struct device *dev,
++ struct encx24j600_context *ctx)
+ {
+ mutex_init(&ctx->mutex);
+ regcfg.lock_arg = ctx;
+ ctx->regmap = devm_regmap_init(dev, ®map_encx24j600, ctx, ®cfg);
++ if (IS_ERR(ctx->regmap))
++ return PTR_ERR(ctx->regmap);
+ ctx->phymap = devm_regmap_init(dev, &phymap_encx24j600, ctx, &phycfg);
++ if (IS_ERR(ctx->phymap))
++ return PTR_ERR(ctx->phymap);
++
++ return 0;
+ }
+ EXPORT_SYMBOL_GPL(devm_regmap_init_encx24j600);
+
+--- a/drivers/net/ethernet/microchip/encx24j600.c
++++ b/drivers/net/ethernet/microchip/encx24j600.c
+@@ -1024,10 +1024,13 @@ static int encx24j600_spi_probe(struct s
+ priv->speed = SPEED_100;
+
+ priv->ctx.spi = spi;
+- devm_regmap_init_encx24j600(&spi->dev, &priv->ctx);
+ ndev->irq = spi->irq;
+ ndev->netdev_ops = &encx24j600_netdev_ops;
+
++ ret = devm_regmap_init_encx24j600(&spi->dev, &priv->ctx);
++ if (ret)
++ goto out_free;
++
+ mutex_init(&priv->lock);
+
+ /* Reset device and check if it is connected */
+--- a/drivers/net/ethernet/microchip/encx24j600_hw.h
++++ b/drivers/net/ethernet/microchip/encx24j600_hw.h
+@@ -15,8 +15,8 @@ struct encx24j600_context {
+ int bank;
+ };
+
+-void devm_regmap_init_encx24j600(struct device *dev,
+- struct encx24j600_context *ctx);
++int devm_regmap_init_encx24j600(struct device *dev,
++ struct encx24j600_context *ctx);
+
+ /* Single-byte instructions */
+ #define BANK_SELECT(bank) (0xC0 | ((bank & (BANK_MASK >> BANK_SHIFT)) << 1))
--- /dev/null
+From 427f974d9727ca681085ddcd0530c97ab5811ae0 Mon Sep 17 00:00:00 2001
+From: Vegard Nossum <vegard.nossum@oracle.com>
+Date: Tue, 12 Oct 2021 17:25:09 +0200
+Subject: net: korina: select CRC32
+
+From: Vegard Nossum <vegard.nossum@oracle.com>
+
+commit 427f974d9727ca681085ddcd0530c97ab5811ae0 upstream.
+
+Fix the following build/link error by adding a dependency on the CRC32
+routines:
+
+ ld: drivers/net/ethernet/korina.o: in function `korina_multicast_list':
+ korina.c:(.text+0x1af): undefined reference to `crc32_le'
+
+Fixes: ef11291bcd5f9 ("Add support the Korina (IDT RC32434) Ethernet MAC")
+Cc: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
+Acked-by: Florian fainelli <f.fainelli@gmail.com>
+Link: https://lore.kernel.org/r/20211012152509.21771-1-vegard.nossum@oracle.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/Kconfig
++++ b/drivers/net/ethernet/Kconfig
+@@ -99,6 +99,7 @@ config JME
+ config KORINA
+ tristate "Korina (IDT RC32434) Ethernet support"
+ depends on MIKROTIK_RB532
++ select CRC32
+ help
+ If you have a Mikrotik RouterBoard 500 or IDT RC32434
+ based system say Y. Otherwise say N.
--- /dev/null
+From 94b960b9deffc02fc0747afc01f72cc62ab099e3 Mon Sep 17 00:00:00 2001
+From: Valentine Fatiev <valentinef@nvidia.com>
+Date: Sun, 15 Aug 2021 17:43:19 +0300
+Subject: net/mlx5e: Fix memory leak in mlx5_core_destroy_cq() error path
+
+From: Valentine Fatiev <valentinef@nvidia.com>
+
+commit 94b960b9deffc02fc0747afc01f72cc62ab099e3 upstream.
+
+Prior to this patch in case mlx5_core_destroy_cq() failed it returns
+without completing all destroy operations and that leads to memory leak.
+Instead, complete the destroy flow before return error.
+
+Also move mlx5_debug_cq_remove() to the beginning of mlx5_core_destroy_cq()
+to be symmetrical with mlx5_core_create_cq().
+
+kmemleak complains on:
+
+unreferenced object 0xc000000038625100 (size 64):
+ comm "ethtool", pid 28301, jiffies 4298062946 (age 785.380s)
+ hex dump (first 32 bytes):
+ 60 01 48 94 00 00 00 c0 b8 05 34 c3 00 00 00 c0 `.H.......4.....
+ 02 00 00 00 00 00 00 00 00 db 7d c1 00 00 00 c0 ..........}.....
+ backtrace:
+ [<000000009e8643cb>] add_res_tree+0xd0/0x270 [mlx5_core]
+ [<00000000e7cb8e6c>] mlx5_debug_cq_add+0x5c/0xc0 [mlx5_core]
+ [<000000002a12918f>] mlx5_core_create_cq+0x1d0/0x2d0 [mlx5_core]
+ [<00000000cef0a696>] mlx5e_create_cq+0x210/0x3f0 [mlx5_core]
+ [<000000009c642c26>] mlx5e_open_cq+0xb4/0x130 [mlx5_core]
+ [<0000000058dfa578>] mlx5e_ptp_open+0x7f4/0xe10 [mlx5_core]
+ [<0000000081839561>] mlx5e_open_channels+0x9cc/0x13e0 [mlx5_core]
+ [<0000000009cf05d4>] mlx5e_switch_priv_channels+0xa4/0x230
+[mlx5_core]
+ [<0000000042bbedd8>] mlx5e_safe_switch_params+0x14c/0x300
+[mlx5_core]
+ [<0000000004bc9db8>] set_pflag_tx_port_ts+0x9c/0x160 [mlx5_core]
+ [<00000000a0553443>] mlx5e_set_priv_flags+0xd0/0x1b0 [mlx5_core]
+ [<00000000a8f3d84b>] ethnl_set_privflags+0x234/0x2d0
+ [<00000000fd27f27c>] genl_family_rcv_msg_doit+0x108/0x1d0
+ [<00000000f495e2bb>] genl_family_rcv_msg+0xe4/0x1f0
+ [<00000000646c5c2c>] genl_rcv_msg+0x78/0x120
+ [<00000000d53e384e>] netlink_rcv_skb+0x74/0x1a0
+
+Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
+Signed-off-by: Valentine Fatiev <valentinef@nvidia.com>
+Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/cq.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/cq.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c
+@@ -154,6 +154,8 @@ int mlx5_core_destroy_cq(struct mlx5_cor
+ u32 in[MLX5_ST_SZ_DW(destroy_cq_in)] = {};
+ int err;
+
++ mlx5_debug_cq_remove(dev, cq);
++
+ mlx5_eq_del_cq(mlx5_get_async_eq(dev), cq);
+ mlx5_eq_del_cq(&cq->eq->core, cq);
+
+@@ -161,16 +163,13 @@ int mlx5_core_destroy_cq(struct mlx5_cor
+ MLX5_SET(destroy_cq_in, in, cqn, cq->cqn);
+ MLX5_SET(destroy_cq_in, in, uid, cq->uid);
+ err = mlx5_cmd_exec_in(dev, destroy_cq, in);
+- if (err)
+- return err;
+
+ synchronize_irq(cq->irqn);
+
+- mlx5_debug_cq_remove(dev, cq);
+ mlx5_cq_put(cq);
+ wait_for_completion(&cq->free);
+
+- return 0;
++ return err;
+ }
+ EXPORT_SYMBOL(mlx5_core_destroy_cq);
+
--- /dev/null
+From 0bc73ad46a76ed6ece4dcacb28858e7b38561e1c Mon Sep 17 00:00:00 2001
+From: Aya Levin <ayal@nvidia.com>
+Date: Sun, 26 Sep 2021 17:55:41 +0300
+Subject: net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp
+
+From: Aya Levin <ayal@nvidia.com>
+
+commit 0bc73ad46a76ed6ece4dcacb28858e7b38561e1c upstream.
+
+Due to current HW arch limitations, RX-FCS (scattering FCS frame field
+to software) and RX-port-timestamp (improved timestamp accuracy on the
+receive side) can't work together.
+RX-port-timestamp is not controlled by the user and it is enabled by
+default when supported by the HW/FW.
+This patch sets RX-port-timestamp opposite to RX-FCS configuration.
+
+Fixes: 102722fc6832 ("net/mlx5e: Add support for RXFCS feature flag")
+Signed-off-by: Aya Levin <ayal@nvidia.com>
+Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
+Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 57 ++++++++++++++++++++--
+ include/linux/mlx5/mlx5_ifc.h | 10 +++
+ 2 files changed, 60 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+@@ -3819,20 +3819,67 @@ static int set_feature_rx_all(struct net
+ return mlx5_set_port_fcs(mdev, !enable);
+ }
+
++static int mlx5e_set_rx_port_ts(struct mlx5_core_dev *mdev, bool enable)
++{
++ u32 in[MLX5_ST_SZ_DW(pcmr_reg)] = {};
++ bool supported, curr_state;
++ int err;
++
++ if (!MLX5_CAP_GEN(mdev, ports_check))
++ return 0;
++
++ err = mlx5_query_ports_check(mdev, in, sizeof(in));
++ if (err)
++ return err;
++
++ supported = MLX5_GET(pcmr_reg, in, rx_ts_over_crc_cap);
++ curr_state = MLX5_GET(pcmr_reg, in, rx_ts_over_crc);
++
++ if (!supported || enable == curr_state)
++ return 0;
++
++ MLX5_SET(pcmr_reg, in, local_port, 1);
++ MLX5_SET(pcmr_reg, in, rx_ts_over_crc, enable);
++
++ return mlx5_set_ports_check(mdev, in, sizeof(in));
++}
++
+ static int set_feature_rx_fcs(struct net_device *netdev, bool enable)
+ {
+ struct mlx5e_priv *priv = netdev_priv(netdev);
++ struct mlx5e_channels *chs = &priv->channels;
++ struct mlx5_core_dev *mdev = priv->mdev;
+ int err;
+
+ mutex_lock(&priv->state_lock);
+
+- priv->channels.params.scatter_fcs_en = enable;
+- err = mlx5e_modify_channels_scatter_fcs(&priv->channels, enable);
+- if (err)
+- priv->channels.params.scatter_fcs_en = !enable;
++ if (enable) {
++ err = mlx5e_set_rx_port_ts(mdev, false);
++ if (err)
++ goto out;
++
++ chs->params.scatter_fcs_en = true;
++ err = mlx5e_modify_channels_scatter_fcs(chs, true);
++ if (err) {
++ chs->params.scatter_fcs_en = false;
++ mlx5e_set_rx_port_ts(mdev, true);
++ }
++ } else {
++ chs->params.scatter_fcs_en = false;
++ err = mlx5e_modify_channels_scatter_fcs(chs, false);
++ if (err) {
++ chs->params.scatter_fcs_en = true;
++ goto out;
++ }
++ err = mlx5e_set_rx_port_ts(mdev, true);
++ if (err) {
++ mlx5_core_warn(mdev, "Failed to set RX port timestamp %d\n", err);
++ err = 0;
++ }
++ }
+
++out:
+ mutex_unlock(&priv->state_lock);
+-
+ return err;
+ }
+
+--- a/include/linux/mlx5/mlx5_ifc.h
++++ b/include/linux/mlx5/mlx5_ifc.h
+@@ -9274,16 +9274,22 @@ struct mlx5_ifc_pcmr_reg_bits {
+ u8 reserved_at_0[0x8];
+ u8 local_port[0x8];
+ u8 reserved_at_10[0x10];
++
+ u8 entropy_force_cap[0x1];
+ u8 entropy_calc_cap[0x1];
+ u8 entropy_gre_calc_cap[0x1];
+- u8 reserved_at_23[0x1b];
++ u8 reserved_at_23[0xf];
++ u8 rx_ts_over_crc_cap[0x1];
++ u8 reserved_at_33[0xb];
+ u8 fcs_cap[0x1];
+ u8 reserved_at_3f[0x1];
++
+ u8 entropy_force[0x1];
+ u8 entropy_calc[0x1];
+ u8 entropy_gre_calc[0x1];
+- u8 reserved_at_43[0x1b];
++ u8 reserved_at_43[0xf];
++ u8 rx_ts_over_crc[0x1];
++ u8 reserved_at_53[0xb];
+ u8 fcs_chk[0x1];
+ u8 reserved_at_5f[0x1];
+ };
--- /dev/null
+From 075da584bae2da6a37428d59a477b6bdad430ac3 Mon Sep 17 00:00:00 2001
+From: Herve Codina <herve.codina@bootlin.com>
+Date: Fri, 8 Oct 2021 12:34:37 +0200
+Subject: net: stmmac: fix get_hw_feature() on old hardware
+
+From: Herve Codina <herve.codina@bootlin.com>
+
+commit 075da584bae2da6a37428d59a477b6bdad430ac3 upstream.
+
+Some old IPs do not provide the hardware feature register.
+On these IPs, this register is read 0x00000000.
+
+In old driver version, this feature was handled but a regression came
+with the commit f10a6a3541b4 ("stmmac: rework get_hw_feature function").
+Indeed, this commit removes the return value in dma->get_hw_feature().
+This return value was used to indicate the validity of retrieved
+information and used later on in stmmac_hw_init() to override
+priv->plat data if this hardware feature were valid.
+
+This patch restores the return code in ->get_hw_feature() in order
+to indicate the hardware feature validity and override priv->plat
+data only if this hardware feature is valid.
+
+Fixes: f10a6a3541b4 ("stmmac: rework get_hw_feature function")
+Signed-off-by: Herve Codina <herve.codina@bootlin.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c | 13 +++++++++++--
+ drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 6 ++++--
+ drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 6 ++++--
+ drivers/net/ethernet/stmicro/stmmac/hwif.h | 6 +++---
+ 4 files changed, 22 insertions(+), 9 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
+@@ -218,11 +218,18 @@ static void dwmac1000_dump_dma_regs(void
+ readl(ioaddr + DMA_BUS_MODE + i * 4);
+ }
+
+-static void dwmac1000_get_hw_feature(void __iomem *ioaddr,
+- struct dma_features *dma_cap)
++static int dwmac1000_get_hw_feature(void __iomem *ioaddr,
++ struct dma_features *dma_cap)
+ {
+ u32 hw_cap = readl(ioaddr + DMA_HW_FEATURE);
+
++ if (!hw_cap) {
++ /* 0x00000000 is the value read on old hardware that does not
++ * implement this register
++ */
++ return -EOPNOTSUPP;
++ }
++
+ dma_cap->mbps_10_100 = (hw_cap & DMA_HW_FEAT_MIISEL);
+ dma_cap->mbps_1000 = (hw_cap & DMA_HW_FEAT_GMIISEL) >> 1;
+ dma_cap->half_duplex = (hw_cap & DMA_HW_FEAT_HDSEL) >> 2;
+@@ -252,6 +259,8 @@ static void dwmac1000_get_hw_feature(voi
+ dma_cap->number_tx_channel = (hw_cap & DMA_HW_FEAT_TXCHCNT) >> 22;
+ /* Alternate (enhanced) DESC mode */
+ dma_cap->enh_desc = (hw_cap & DMA_HW_FEAT_ENHDESSEL) >> 24;
++
++ return 0;
+ }
+
+ static void dwmac1000_rx_watchdog(void __iomem *ioaddr, u32 riwt,
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
+@@ -337,8 +337,8 @@ static void dwmac4_dma_tx_chan_op_mode(v
+ writel(mtl_tx_op, ioaddr + MTL_CHAN_TX_OP_MODE(channel));
+ }
+
+-static void dwmac4_get_hw_feature(void __iomem *ioaddr,
+- struct dma_features *dma_cap)
++static int dwmac4_get_hw_feature(void __iomem *ioaddr,
++ struct dma_features *dma_cap)
+ {
+ u32 hw_cap = readl(ioaddr + GMAC_HW_FEATURE0);
+
+@@ -425,6 +425,8 @@ static void dwmac4_get_hw_feature(void _
+ dma_cap->frpbs = (hw_cap & GMAC_HW_FEAT_FRPBS) >> 11;
+ dma_cap->frpsel = (hw_cap & GMAC_HW_FEAT_FRPSEL) >> 10;
+ dma_cap->dvlan = (hw_cap & GMAC_HW_FEAT_DVLAN) >> 5;
++
++ return 0;
+ }
+
+ /* Enable/disable TSO feature and set MSS */
+--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
++++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
+@@ -365,8 +365,8 @@ static int dwxgmac2_dma_interrupt(void _
+ return ret;
+ }
+
+-static void dwxgmac2_get_hw_feature(void __iomem *ioaddr,
+- struct dma_features *dma_cap)
++static int dwxgmac2_get_hw_feature(void __iomem *ioaddr,
++ struct dma_features *dma_cap)
+ {
+ u32 hw_cap;
+
+@@ -439,6 +439,8 @@ static void dwxgmac2_get_hw_feature(void
+ dma_cap->frpes = (hw_cap & XGMAC_HWFEAT_FRPES) >> 11;
+ dma_cap->frpbs = (hw_cap & XGMAC_HWFEAT_FRPPB) >> 9;
+ dma_cap->frpsel = (hw_cap & XGMAC_HWFEAT_FRPSEL) >> 3;
++
++ return 0;
+ }
+
+ static void dwxgmac2_rx_watchdog(void __iomem *ioaddr, u32 riwt, u32 nchan)
+--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
++++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
+@@ -203,8 +203,8 @@ struct stmmac_dma_ops {
+ int (*dma_interrupt) (void __iomem *ioaddr,
+ struct stmmac_extra_stats *x, u32 chan);
+ /* If supported then get the optional core features */
+- void (*get_hw_feature)(void __iomem *ioaddr,
+- struct dma_features *dma_cap);
++ int (*get_hw_feature)(void __iomem *ioaddr,
++ struct dma_features *dma_cap);
+ /* Program the HW RX Watchdog */
+ void (*rx_watchdog)(void __iomem *ioaddr, u32 riwt, u32 number_chan);
+ void (*set_tx_ring_len)(void __iomem *ioaddr, u32 len, u32 chan);
+@@ -255,7 +255,7 @@ struct stmmac_dma_ops {
+ #define stmmac_dma_interrupt_status(__priv, __args...) \
+ stmmac_do_callback(__priv, dma, dma_interrupt, __args)
+ #define stmmac_get_hw_feature(__priv, __args...) \
+- stmmac_do_void_callback(__priv, dma, get_hw_feature, __args)
++ stmmac_do_callback(__priv, dma, get_hw_feature, __args)
+ #define stmmac_rx_watchdog(__priv, __args...) \
+ stmmac_do_void_callback(__priv, dma, rx_watchdog, __args)
+ #define stmmac_set_tx_ring_len(__priv, __args...) \
--- /dev/null
+From 85f74acf097a63a07f5a7c215db6883e5c35e3ff Mon Sep 17 00:00:00 2001
+From: Keith Busch <kbusch@kernel.org>
+Date: Wed, 6 Oct 2021 23:50:31 -0700
+Subject: nvme-pci: Fix abort command id
+
+From: Keith Busch <kbusch@kernel.org>
+
+commit 85f74acf097a63a07f5a7c215db6883e5c35e3ff upstream.
+
+The request tag is no longer the only component of the command id.
+
+Fixes: e7006de6c2380 ("nvme: code command_id with a genctr for use-after-free validation")
+Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/nvme/host/pci.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/nvme/host/pci.c
++++ b/drivers/nvme/host/pci.c
+@@ -1342,7 +1342,7 @@ static enum blk_eh_timer_return nvme_tim
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.abort.opcode = nvme_admin_abort_cmd;
+- cmd.abort.cid = req->tag;
++ cmd.abort.cid = nvme_cid(req);
+ cmd.abort.sqid = cpu_to_le16(nvmeq->qid);
+
+ dev_warn(nvmeq->dev->ctrl.device,
--- /dev/null
+From a2d859e3fc97e79d907761550dbc03ff1b36479c Mon Sep 17 00:00:00 2001
+From: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
+Date: Wed, 13 Oct 2021 17:27:29 -0300
+Subject: sctp: account stream padding length for reconf chunk
+
+From: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
+
+commit a2d859e3fc97e79d907761550dbc03ff1b36479c upstream.
+
+sctp_make_strreset_req() makes repeated calls to sctp_addto_chunk()
+which will automatically account for padding on each call. inreq and
+outreq are already 4 bytes aligned, but the payload is not and doing
+SCTP_PAD4(a + b) (which _sctp_make_chunk() did implicitly here) is
+different from SCTP_PAD4(a) + SCTP_PAD4(b) and not enough. It led to
+possible attempt to use more buffer than it was allocated and triggered
+a BUG_ON.
+
+Cc: Vlad Yasevich <vyasevich@gmail.com>
+Cc: Neil Horman <nhorman@tuxdriver.com>
+Cc: Greg KH <gregkh@linuxfoundation.org>
+Fixes: cc16f00f6529 ("sctp: add support for generating stream reconf ssn reset request chunk")
+Reported-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
+Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
+Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
+Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
+Reviewed-by: Xin Long <lucien.xin@gmail.com>
+Link: https://lore.kernel.org/r/b97c1f8b0c7ff79ac4ed206fc2c49d3612e0850c.1634156849.git.mleitner@redhat.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sctp/sm_make_chunk.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/sctp/sm_make_chunk.c
++++ b/net/sctp/sm_make_chunk.c
+@@ -3651,7 +3651,7 @@ struct sctp_chunk *sctp_make_strreset_re
+ outlen = (sizeof(outreq) + stream_len) * out;
+ inlen = (sizeof(inreq) + stream_len) * in;
+
+- retval = sctp_make_reconf(asoc, outlen + inlen);
++ retval = sctp_make_reconf(asoc, SCTP_PAD4(outlen) + SCTP_PAD4(inlen));
+ if (!retval)
+ return NULL;
+
arm-dts-bcm2711-fix-mdio-address-and-size-cells.patch
arm-dts-bcm2711-rpi-4-b-fix-sd_io_1v8_reg-regulator-states.patch
arm-dts-bcm2711-rpi-4-b-fix-pcie0-s-unit-address-formatting.patch
+nvme-pci-fix-abort-command-id.patch
+sctp-account-stream-padding-length-for-reconf-chunk.patch
+gpio-pca953x-improve-bias-setting.patch
+net-arc-select-crc32.patch
+net-korina-select-crc32.patch
+net-mlx5e-fix-memory-leak-in-mlx5_core_destroy_cq-error-path.patch
+net-mlx5e-mutually-exclude-rx-fcs-and-rx-port-timestamp.patch
+net-stmmac-fix-get_hw_feature-on-old-hardware.patch
+net-dsa-microchip-added-the-condition-for-scheduling-ksz_mib_read_work.patch
+net-encx24j600-check-error-in-devm_regmap_init_encx24j600.patch
+ethernet-s2io-fix-setting-mac-address-during-resume.patch