]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Sun, 19 Jun 2022 13:03:27 +0000 (09:03 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 19 Jun 2022 13:03:27 +0000 (09:03 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
12 files changed:
queue-5.4/arm64-ftrace-fix-branch-range-checks.patch [new file with mode: 0644]
queue-5.4/certs-blacklist_hashes.c-fix-const-confusion-in-cert.patch [new file with mode: 0644]
queue-5.4/clocksource-hyper-v-unexport-__init-annotated-hv_ini.patch [new file with mode: 0644]
queue-5.4/i40e-fix-adding-adq-filter-to-tc0.patch [new file with mode: 0644]
queue-5.4/i40e-fix-calculating-the-number-of-queue-pairs.patch [new file with mode: 0644]
queue-5.4/i40e-fix-call-trace-in-setup_tx_descriptors.patch [new file with mode: 0644]
queue-5.4/misc-atmel-ssc-fix-irq-check-in-ssc_probe.patch [new file with mode: 0644]
queue-5.4/mlxsw-spectrum_cnt-reorder-counter-pools.patch [new file with mode: 0644]
queue-5.4/net-bgmac-fix-an-erroneous-kfree-in-bgmac_remove.patch [new file with mode: 0644]
queue-5.4/pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/tty-goldfish-fix-free_irq-on-remove.patch [new file with mode: 0644]

diff --git a/queue-5.4/arm64-ftrace-fix-branch-range-checks.patch b/queue-5.4/arm64-ftrace-fix-branch-range-checks.patch
new file mode 100644 (file)
index 0000000..1b0d147
--- /dev/null
@@ -0,0 +1,86 @@
+From ad7b85ff8c9d0a7ace012755777ba2203e924fc1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 14 Jun 2022 09:09:42 +0100
+Subject: arm64: ftrace: fix branch range checks
+
+From: Mark Rutland <mark.rutland@arm.com>
+
+[ Upstream commit 3eefdf9d1e406f3da47470b2854347009ffcb6fa ]
+
+The branch range checks in ftrace_make_call() and ftrace_make_nop() are
+incorrect, erroneously permitting a forwards branch of 128M and
+erroneously rejecting a backwards branch of 128M.
+
+This is because both functions calculate the offset backwards,
+calculating the offset *from* the target *to* the branch, rather than
+the other way around as the later comparisons expect.
+
+If an out-of-range branch were erroeously permitted, this would later be
+rejected by aarch64_insn_gen_branch_imm() as branch_imm_common() checks
+the bounds correctly, resulting in warnings and the placement of a BRK
+instruction. Note that this can only happen for a forwards branch of
+exactly 128M, and so the caller would need to be exactly 128M bytes
+below the relevant ftrace trampoline.
+
+If an in-range branch were erroeously rejected, then:
+
+* For modules when CONFIG_ARM64_MODULE_PLTS=y, this would result in the
+  use of a PLT entry, which is benign.
+
+  Note that this is the common case, as this is selected by
+  CONFIG_RANDOMIZE_BASE (and therefore RANDOMIZE_MODULE_REGION_FULL),
+  which distributions typically seelct. This is also selected by
+  CONFIG_ARM64_ERRATUM_843419.
+
+* For modules when CONFIG_ARM64_MODULE_PLTS=n, this would result in
+  internal ftrace failures.
+
+* For core kernel text, this would result in internal ftrace failues.
+
+  Note that for this to happen, the kernel text would need to be at
+  least 128M bytes in size, and typical configurations are smaller tha
+  this.
+
+Fix this by calculating the offset *from* the branch *to* the target in
+both functions.
+
+Fixes: f8af0b364e24 ("arm64: ftrace: don't validate branch via PLT in ftrace_make_nop()")
+Fixes: e71a4e1bebaf ("arm64: ftrace: add support for far branches to dynamic ftrace")
+Signed-off-by: Mark Rutland <mark.rutland@arm.com>
+Cc: Ard Biesheuvel <ardb@kernel.org>
+Cc: Will Deacon <will@kernel.org>
+Tested-by: "Ivan T. Ivanov" <iivanov@suse.de>
+Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>
+Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
+Link: https://lore.kernel.org/r/20220614080944.1349146-2-mark.rutland@arm.com
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm64/kernel/ftrace.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c
+index 822718eafdb4..d4a4be02d309 100644
+--- a/arch/arm64/kernel/ftrace.c
++++ b/arch/arm64/kernel/ftrace.c
+@@ -69,7 +69,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
+ {
+       unsigned long pc = rec->ip;
+       u32 old, new;
+-      long offset = (long)pc - (long)addr;
++      long offset = (long)addr - (long)pc;
+       if (offset < -SZ_128M || offset >= SZ_128M) {
+ #ifdef CONFIG_ARM64_MODULE_PLTS
+@@ -126,7 +126,7 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
+       unsigned long pc = rec->ip;
+       bool validate = true;
+       u32 old = 0, new;
+-      long offset = (long)pc - (long)addr;
++      long offset = (long)addr - (long)pc;
+       if (offset < -SZ_128M || offset >= SZ_128M) {
+ #ifdef CONFIG_ARM64_MODULE_PLTS
+-- 
+2.35.1
+
diff --git a/queue-5.4/certs-blacklist_hashes.c-fix-const-confusion-in-cert.patch b/queue-5.4/certs-blacklist_hashes.c-fix-const-confusion-in-cert.patch
new file mode 100644 (file)
index 0000000..b5b0a47
--- /dev/null
@@ -0,0 +1,52 @@
+From ad92f0a82e9056fb7ef40ef2be1d19760c98fa07 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 12 Jun 2022 02:22:30 +0900
+Subject: certs/blacklist_hashes.c: fix const confusion in certs blacklist
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit 6a1c3767d82ed8233de1263aa7da81595e176087 ]
+
+This file fails to compile as follows:
+
+  CC      certs/blacklist_hashes.o
+certs/blacklist_hashes.c:4:1: error: ignoring attribute ‘section (".init.data")’ because it conflicts with previous ‘section (".init.rodata")’ [-Werror=attributes]
+    4 | const char __initdata *const blacklist_hashes[] = {
+      | ^~~~~
+In file included from certs/blacklist_hashes.c:2:
+certs/blacklist.h:5:38: note: previous declaration here
+    5 | extern const char __initconst *const blacklist_hashes[];
+      |                                      ^~~~~~~~~~~~~~~~
+
+Apply the same fix as commit 2be04df5668d ("certs/blacklist_nohashes.c:
+fix const confusion in certs blacklist").
+
+Fixes: 734114f8782f ("KEYS: Add a system blacklist keyring")
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
+Reviewed-by: Mickaël Salaün <mic@linux.microsoft.com>
+Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ certs/blacklist_hashes.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/certs/blacklist_hashes.c b/certs/blacklist_hashes.c
+index 344892337be0..d5961aa3d338 100644
+--- a/certs/blacklist_hashes.c
++++ b/certs/blacklist_hashes.c
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: GPL-2.0
+ #include "blacklist.h"
+-const char __initdata *const blacklist_hashes[] = {
++const char __initconst *const blacklist_hashes[] = {
+ #include CONFIG_SYSTEM_BLACKLIST_HASH_LIST
+       , NULL
+ };
+-- 
+2.35.1
+
diff --git a/queue-5.4/clocksource-hyper-v-unexport-__init-annotated-hv_ini.patch b/queue-5.4/clocksource-hyper-v-unexport-__init-annotated-hv_ini.patch
new file mode 100644 (file)
index 0000000..2ef7e65
--- /dev/null
@@ -0,0 +1,52 @@
+From c6a3c4e60de520fb677728e154f15dd7594e0a11 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 6 Jun 2022 14:02:38 +0900
+Subject: clocksource: hyper-v: unexport __init-annotated hv_init_clocksource()
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit 245b993d8f6c4e25f19191edfbd8080b645e12b1 ]
+
+EXPORT_SYMBOL and __init is a bad combination because the .init.text
+section is freed up after the initialization. Hence, modules cannot
+use symbols annotated __init. The access to a freed symbol may end up
+with kernel panic.
+
+modpost used to detect it, but it has been broken for a decade.
+
+Recently, I fixed modpost so it started to warn it again, then this
+showed up in linux-next builds.
+
+There are two ways to fix it:
+
+  - Remove __init
+  - Remove EXPORT_SYMBOL
+
+I chose the latter for this case because the only in-tree call-site,
+arch/x86/kernel/cpu/mshyperv.c is never compiled as modular.
+(CONFIG_HYPERVISOR_GUEST is boolean)
+
+Fixes: dd2cb348613b ("clocksource/drivers: Continue making Hyper-V clocksource ISA agnostic")
+Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
+Reviewed-by: Michael Kelley <mikelley@microsoft.com>
+Link: https://lore.kernel.org/r/20220606050238.4162200-1-masahiroy@kernel.org
+Signed-off-by: Wei Liu <wei.liu@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clocksource/hyperv_timer.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
+index 36933e2b3b0d..80b4b8fee54d 100644
+--- a/drivers/clocksource/hyperv_timer.c
++++ b/drivers/clocksource/hyperv_timer.c
+@@ -325,4 +325,3 @@ void __init hv_init_clocksource(void)
+       hv_sched_clock_offset = hyperv_cs->read(hyperv_cs);
+       hv_setup_sched_clock(read_hv_sched_clock_msr);
+ }
+-EXPORT_SYMBOL_GPL(hv_init_clocksource);
+-- 
+2.35.1
+
diff --git a/queue-5.4/i40e-fix-adding-adq-filter-to-tc0.patch b/queue-5.4/i40e-fix-adding-adq-filter-to-tc0.patch
new file mode 100644 (file)
index 0000000..6a2351a
--- /dev/null
@@ -0,0 +1,45 @@
+From a1f43d88fc28f60f8d5897d151375e27c2877302 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 29 Apr 2022 14:27:08 +0200
+Subject: i40e: Fix adding ADQ filter to TC0
+
+From: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
+
+[ Upstream commit c3238d36c3a2be0a29a9d848d6c51e1b14be6692 ]
+
+Procedure of configure tc flower filters erroneously allows to create
+filters on TC0 where unfiltered packets are also directed by default.
+Issue was caused by insufficient checks of hw_tc parameter specifying
+the hardware traffic class to pass matching packets to.
+
+Fix checking hw_tc parameter which blocks creation of filters on TC0.
+
+Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower")
+Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
+Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
+Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com>
+Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
+index 7f4aa2239786..05442bbc218c 100644
+--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
+@@ -8108,6 +8108,11 @@ static int i40e_configure_clsflower(struct i40e_vsi *vsi,
+               return -EOPNOTSUPP;
+       }
++      if (!tc) {
++              dev_err(&pf->pdev->dev, "Unable to add filter because of invalid destination");
++              return -EINVAL;
++      }
++
+       if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
+           test_bit(__I40E_RESET_INTR_RECEIVED, pf->state))
+               return -EBUSY;
+-- 
+2.35.1
+
diff --git a/queue-5.4/i40e-fix-calculating-the-number-of-queue-pairs.patch b/queue-5.4/i40e-fix-calculating-the-number-of-queue-pairs.patch
new file mode 100644 (file)
index 0000000..e2d1f36
--- /dev/null
@@ -0,0 +1,41 @@
+From a8dfa3d8f550d2f92eb60e8738c8950e0e8adacc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 29 Apr 2022 14:40:23 +0200
+Subject: i40e: Fix calculating the number of queue pairs
+
+From: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
+
+[ Upstream commit 0bb050670ac90a167ecfa3f9590f92966c9a3677 ]
+
+If ADQ is enabled for a VF, then actual number of queue pair
+is a number of currently available traffic classes for this VF.
+
+Without this change the configuration of the Rx/Tx queues
+fails with error.
+
+Fixes: d29e0d233e0d ("i40e: missing input validation on VF message handling by the PF")
+Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
+Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
+Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com>
+Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+index 4962e6193eec..4080fdacca4c 100644
+--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
++++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+@@ -2149,7 +2149,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
+       }
+       if (vf->adq_enabled) {
+-              for (i = 0; i < I40E_MAX_VF_VSI; i++)
++              for (i = 0; i < vf->num_tc; i++)
+                       num_qps_all += vf->ch[i].num_qps;
+               if (num_qps_all != qci->num_queue_pairs) {
+                       aq_ret = I40E_ERR_PARAM;
+-- 
+2.35.1
+
diff --git a/queue-5.4/i40e-fix-call-trace-in-setup_tx_descriptors.patch b/queue-5.4/i40e-fix-call-trace-in-setup_tx_descriptors.patch
new file mode 100644 (file)
index 0000000..bea91db
--- /dev/null
@@ -0,0 +1,83 @@
+From de1c5c9ab9d54b0fd4ed7d746177786f1ad34e6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 19 May 2022 16:01:45 +0200
+Subject: i40e: Fix call trace in setup_tx_descriptors
+
+From: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
+
+[ Upstream commit fd5855e6b1358e816710afee68a1d2bc685176ca ]
+
+After PF reset and ethtool -t there was call trace in dmesg
+sometimes leading to panic. When there was some time, around 5
+seconds, between reset and test there were no errors.
+
+Problem was that pf reset calls i40e_vsi_close in prep_for_reset
+and ethtool -t calls i40e_vsi_close in diag_test. If there was not
+enough time between those commands the second i40e_vsi_close starts
+before previous i40e_vsi_close was done which leads to crash.
+
+Add check to diag_test if pf is in reset and don't start offline
+tests if it is true.
+Add netif_info("testing failed") into unhappy path of i40e_diag_test()
+
+Fixes: e17bc411aea8 ("i40e: Disable offline diagnostics if VFs are enabled")
+Fixes: 510efb2682b3 ("i40e: Fix ethtool offline diagnostic with netqueues")
+Signed-off-by: Michal Jaron <michalx.jaron@intel.com>
+Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
+Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
+Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../net/ethernet/intel/i40e/i40e_ethtool.c    | 25 +++++++++++++------
+ 1 file changed, 17 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+index 2cc4f63b1e91..689deecb4e1a 100644
+--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
++++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+@@ -2578,15 +2578,16 @@ static void i40e_diag_test(struct net_device *netdev,
+               set_bit(__I40E_TESTING, pf->state);
++              if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
++                  test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) {
++                      dev_warn(&pf->pdev->dev,
++                               "Cannot start offline testing when PF is in reset state.\n");
++                      goto skip_ol_tests;
++              }
++
+               if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
+                       dev_warn(&pf->pdev->dev,
+                                "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
+-                      data[I40E_ETH_TEST_REG]         = 1;
+-                      data[I40E_ETH_TEST_EEPROM]      = 1;
+-                      data[I40E_ETH_TEST_INTR]        = 1;
+-                      data[I40E_ETH_TEST_LINK]        = 1;
+-                      eth_test->flags |= ETH_TEST_FL_FAILED;
+-                      clear_bit(__I40E_TESTING, pf->state);
+                       goto skip_ol_tests;
+               }
+@@ -2633,9 +2634,17 @@ static void i40e_diag_test(struct net_device *netdev,
+               data[I40E_ETH_TEST_INTR] = 0;
+       }
+-skip_ol_tests:
+-
+       netif_info(pf, drv, netdev, "testing finished\n");
++      return;
++
++skip_ol_tests:
++      data[I40E_ETH_TEST_REG]         = 1;
++      data[I40E_ETH_TEST_EEPROM]      = 1;
++      data[I40E_ETH_TEST_INTR]        = 1;
++      data[I40E_ETH_TEST_LINK]        = 1;
++      eth_test->flags |= ETH_TEST_FL_FAILED;
++      clear_bit(__I40E_TESTING, pf->state);
++      netif_info(pf, drv, netdev, "testing failed\n");
+ }
+ static void i40e_get_wol(struct net_device *netdev,
+-- 
+2.35.1
+
diff --git a/queue-5.4/misc-atmel-ssc-fix-irq-check-in-ssc_probe.patch b/queue-5.4/misc-atmel-ssc-fix-irq-check-in-ssc_probe.patch
new file mode 100644 (file)
index 0000000..9ae8a6d
--- /dev/null
@@ -0,0 +1,47 @@
+From 1c81670682481d8c507bbe1a9a27e217df0921fa Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 1 Jun 2022 16:30:26 +0400
+Subject: misc: atmel-ssc: Fix IRQ check in ssc_probe
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+[ Upstream commit 1c245358ce0b13669f6d1625f7a4e05c41f28980 ]
+
+platform_get_irq() returns negative error number instead 0 on failure.
+And the doc of platform_get_irq() provides a usage example:
+
+    int irq = platform_get_irq(pdev, 0);
+    if (irq < 0)
+        return irq;
+
+Fix the check of return value to catch errors correctly.
+
+Fixes: eb1f2930609b ("Driver for the Atmel on-chip SSC on AT32AP and AT91")
+Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Link: https://lore.kernel.org/r/20220601123026.7119-1-linmq006@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/atmel-ssc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
+index d6cd5537126c..69f9b0336410 100644
+--- a/drivers/misc/atmel-ssc.c
++++ b/drivers/misc/atmel-ssc.c
+@@ -232,9 +232,9 @@ static int ssc_probe(struct platform_device *pdev)
+       clk_disable_unprepare(ssc->clk);
+       ssc->irq = platform_get_irq(pdev, 0);
+-      if (!ssc->irq) {
++      if (ssc->irq < 0) {
+               dev_dbg(&pdev->dev, "could not get irq\n");
+-              return -ENXIO;
++              return ssc->irq;
+       }
+       mutex_lock(&user_lock);
+-- 
+2.35.1
+
diff --git a/queue-5.4/mlxsw-spectrum_cnt-reorder-counter-pools.patch b/queue-5.4/mlxsw-spectrum_cnt-reorder-counter-pools.patch
new file mode 100644 (file)
index 0000000..0608633
--- /dev/null
@@ -0,0 +1,51 @@
+From 9c2d101ec5429c8cf3f65930c4498836a5c4560e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 13 Jun 2022 15:50:17 +0300
+Subject: mlxsw: spectrum_cnt: Reorder counter pools
+
+From: Petr Machata <petrm@nvidia.com>
+
+[ Upstream commit 4b7a632ac4e7101ceefee8484d5c2ca505d347b3 ]
+
+Both RIF and ACL flow counters use a 24-bit SW-managed counter address to
+communicate which counter they want to bind.
+
+In a number of Spectrum FW releases, binding a RIF counter is broken and
+slices the counter index to 16 bits. As a result, on Spectrum-2 and above,
+no more than about 410 RIF counters can be effectively used. This
+translates to 205 netdevices for which L3 HW stats can be enabled. (This
+does not happen on Spectrum-1, because there are fewer counters available
+overall and the counter index never exceeds 16 bits.)
+
+Binding counters to ACLs does not have this issue. Therefore reorder the
+counter allocation scheme so that RIF counters come first and therefore get
+lower indices that are below the 16-bit barrier.
+
+Fixes: 98e60dce4da1 ("Merge branch 'mlxsw-Introduce-initial-Spectrum-2-support'")
+Reported-by: Maksym Yaremchuk <maksymy@nvidia.com>
+Signed-off-by: Petr Machata <petrm@nvidia.com>
+Signed-off-by: Ido Schimmel <idosch@nvidia.com>
+Link: https://lore.kernel.org/r/20220613125017.2018162-1-idosch@nvidia.com
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h
+index 81465e267b10..b7eb3674e285 100644
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h
+@@ -7,8 +7,8 @@
+ #include "spectrum.h"
+ enum mlxsw_sp_counter_sub_pool_id {
+-      MLXSW_SP_COUNTER_SUB_POOL_FLOW,
+       MLXSW_SP_COUNTER_SUB_POOL_RIF,
++      MLXSW_SP_COUNTER_SUB_POOL_FLOW,
+ };
+ int mlxsw_sp_counter_alloc(struct mlxsw_sp *mlxsw_sp,
+-- 
+2.35.1
+
diff --git a/queue-5.4/net-bgmac-fix-an-erroneous-kfree-in-bgmac_remove.patch b/queue-5.4/net-bgmac-fix-an-erroneous-kfree-in-bgmac_remove.patch
new file mode 100644 (file)
index 0000000..017649d
--- /dev/null
@@ -0,0 +1,39 @@
+From 158e72520dc98d19da9e81c5a2f2bde04bc05cba Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 13 Jun 2022 22:53:50 +0200
+Subject: net: bgmac: Fix an erroneous kfree() in bgmac_remove()
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ Upstream commit d7dd6eccfbc95ac47a12396f84e7e1b361db654b ]
+
+'bgmac' is part of a managed resource allocated with bgmac_alloc(). It
+should not be freed explicitly.
+
+Remove the erroneous kfree() from the .remove() function.
+
+Fixes: 34a5102c3235 ("net: bgmac: allocate struct bgmac just once & don't copy it")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Link: https://lore.kernel.org/r/a026153108dd21239036a032b95c25b5cece253b.1655153616.git.christophe.jaillet@wanadoo.fr
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma.c b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+index 34d18302b1a3..2d52754afc33 100644
+--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+@@ -323,7 +323,6 @@ static void bgmac_remove(struct bcma_device *core)
+       bcma_mdio_mii_unregister(bgmac->mii_bus);
+       bgmac_enet_remove(bgmac);
+       bcma_set_drvdata(core, NULL);
+-      kfree(bgmac);
+ }
+ static struct bcma_driver bgmac_bcma_driver = {
+-- 
+2.35.1
+
diff --git a/queue-5.4/pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch b/queue-5.4/pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch
new file mode 100644 (file)
index 0000000..823e8bb
--- /dev/null
@@ -0,0 +1,42 @@
+From 78dfae0685bca68eba3fc451db05bf64e5e58ba7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 31 May 2022 11:03:06 -0400
+Subject: pNFS: Don't keep retrying if the server replied
+ NFS4ERR_LAYOUTUNAVAILABLE
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+[ Upstream commit fe44fb23d6ccde4c914c44ef74ab8d9d9ba02bea ]
+
+If the server tells us that a pNFS layout is not available for a
+specific file, then we should not keep pounding it with further
+layoutget requests.
+
+Fixes: 183d9e7b112a ("pnfs: rework LAYOUTGET retry handling")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/nfs/pnfs.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
+index 2fe48982fbb4..3b19fa74b062 100644
+--- a/fs/nfs/pnfs.c
++++ b/fs/nfs/pnfs.c
+@@ -2111,6 +2111,12 @@ pnfs_update_layout(struct inode *ino,
+               case -ERECALLCONFLICT:
+               case -EAGAIN:
+                       break;
++              case -ENODATA:
++                      /* The server returned NFS4ERR_LAYOUTUNAVAILABLE */
++                      pnfs_layout_set_fail_bit(
++                              lo, pnfs_iomode_to_fail_bit(iomode));
++                      lseg = NULL;
++                      goto out_put_layout_hdr;
+               default:
+                       if (!nfs_error_is_fatal(PTR_ERR(lseg))) {
+                               pnfs_layout_clear_fail_bit(lo, pnfs_iomode_to_fail_bit(iomode));
+-- 
+2.35.1
+
index c94e35a1e5ddfdcb07d6be67c950ba692806d41d..ab8ff7024920d586a7094f4b86451cff1eba9791 100644 (file)
@@ -202,3 +202,14 @@ ipv6-fix-signed-integer-overflow-in-l2tp_ip6_sendmsg.patch
 net-ethernet-mtk_eth_soc-fix-misuse-of-mem-alloc-int.patch
 netfs-gcc-12-temporarily-disable-wattribute-warning-.patch
 random-credit-cpu-and-bootloader-seeds-by-default.patch
+pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch
+clocksource-hyper-v-unexport-__init-annotated-hv_ini.patch
+i40e-fix-adding-adq-filter-to-tc0.patch
+i40e-fix-calculating-the-number-of-queue-pairs.patch
+i40e-fix-call-trace-in-setup_tx_descriptors.patch
+tty-goldfish-fix-free_irq-on-remove.patch
+misc-atmel-ssc-fix-irq-check-in-ssc_probe.patch
+mlxsw-spectrum_cnt-reorder-counter-pools.patch
+net-bgmac-fix-an-erroneous-kfree-in-bgmac_remove.patch
+arm64-ftrace-fix-branch-range-checks.patch
+certs-blacklist_hashes.c-fix-const-confusion-in-cert.patch
diff --git a/queue-5.4/tty-goldfish-fix-free_irq-on-remove.patch b/queue-5.4/tty-goldfish-fix-free_irq-on-remove.patch
new file mode 100644 (file)
index 0000000..1f378e4
--- /dev/null
@@ -0,0 +1,51 @@
+From 2342e350d920ef71498f8927ca6ad0ef72083f82 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 9 Jun 2022 16:17:04 +0200
+Subject: tty: goldfish: Fix free_irq() on remove
+
+From: Vincent Whitchurch <vincent.whitchurch@axis.com>
+
+[ Upstream commit 499e13aac6c762e1e828172b0f0f5275651d6512 ]
+
+Pass the correct dev_id to free_irq() to fix this splat when the driver
+is unbound:
+
+ WARNING: CPU: 0 PID: 30 at kernel/irq/manage.c:1895 free_irq
+ Trying to free already-free IRQ 65
+ Call Trace:
+  warn_slowpath_fmt
+  free_irq
+  goldfish_tty_remove
+  platform_remove
+  device_remove
+  device_release_driver_internal
+  device_driver_detach
+  unbind_store
+  drv_attr_store
+  ...
+
+Fixes: 465893e18878e119 ("tty: goldfish: support platform_device with id -1")
+Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
+Link: https://lore.kernel.org/r/20220609141704.1080024-1-vincent.whitchurch@axis.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/tty/goldfish.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
+index abc84d84f638..9180ca5e4dcd 100644
+--- a/drivers/tty/goldfish.c
++++ b/drivers/tty/goldfish.c
+@@ -428,7 +428,7 @@ static int goldfish_tty_remove(struct platform_device *pdev)
+       tty_unregister_device(goldfish_tty_driver, qtty->console.index);
+       iounmap(qtty->base);
+       qtty->base = NULL;
+-      free_irq(qtty->irq, pdev);
++      free_irq(qtty->irq, qtty);
+       tty_port_destroy(&qtty->port);
+       goldfish_tty_current_line_count--;
+       if (goldfish_tty_current_line_count == 0)
+-- 
+2.35.1
+