]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Wed, 20 Oct 2021 21:21:33 +0000 (17:21 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 20 Oct 2021 21:21:33 +0000 (17:21 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/nfsd-keep-existing-listeners-on-portlist-error.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/xtensa-xtfpga-try-software-restart-before-simulating.patch [new file with mode: 0644]
queue-4.9/xtensa-xtfpga-use-config_use_of-instead-of-config_of.patch [new file with mode: 0644]

diff --git a/queue-4.9/nfsd-keep-existing-listeners-on-portlist-error.patch b/queue-4.9/nfsd-keep-existing-listeners-on-portlist-error.patch
new file mode 100644 (file)
index 0000000..85a2298
--- /dev/null
@@ -0,0 +1,42 @@
+From 2412cdce00ba0343d7b2848c5a232013f858e7cb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 6 Oct 2021 13:20:44 -0400
+Subject: NFSD: Keep existing listeners on portlist error
+
+From: Benjamin Coddington <bcodding@redhat.com>
+
+[ Upstream commit c20106944eb679fa3ab7e686fe5f6ba30fbc51e5 ]
+
+If nfsd has existing listening sockets without any processes, then an error
+returned from svc_create_xprt() for an additional transport will remove
+those existing listeners.  We're seeing this in practice when userspace
+attempts to create rpcrdma transports without having the rpcrdma modules
+present before creating nfsd kernel processes.  Fix this by checking for
+existing sockets before calling nfsd_destroy().
+
+Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/nfsd/nfsctl.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
+index f704f90db36c..2418b9d829ae 100644
+--- a/fs/nfsd/nfsctl.c
++++ b/fs/nfsd/nfsctl.c
+@@ -765,7 +765,10 @@ out_close:
+               svc_xprt_put(xprt);
+       }
+ out_err:
+-      nfsd_destroy(net);
++      if (!list_empty(&nn->nfsd_serv->sv_permsocks))
++              nn->nfsd_serv->sv_nrthreads--;
++       else
++              nfsd_destroy(net);
+       return err;
+ }
+-- 
+2.33.0
+
index 7874127be0242bffb84b3a15a7aee5eb46ca0d09..c80d7d6768998389bc0cf6a41921fb53ecd4acbb 100644 (file)
@@ -23,3 +23,6 @@ pata_legacy-fix-a-couple-uninitialized-variable-bugs.patch
 drm-msm-fix-null-pointer-dereference-on-pointer-edp.patch
 drm-msm-dsi-fix-off-by-one-in-dsi_bus_clk_enable-error-handling.patch
 r8152-select-crc32-and-crypto-crypto_hash-crypto_sha256.patch
+xtensa-xtfpga-use-config_use_of-instead-of-config_of.patch
+xtensa-xtfpga-try-software-restart-before-simulating.patch
+nfsd-keep-existing-listeners-on-portlist-error.patch
diff --git a/queue-4.9/xtensa-xtfpga-try-software-restart-before-simulating.patch b/queue-4.9/xtensa-xtfpga-try-software-restart-before-simulating.patch
new file mode 100644 (file)
index 0000000..6c68c74
--- /dev/null
@@ -0,0 +1,56 @@
+From d605e77fbdbdb6cba8591774a8d901dd20ecedd2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 1 Aug 2021 10:36:59 -0700
+Subject: xtensa: xtfpga: Try software restart before simulating CPU reset
+
+From: Guenter Roeck <linux@roeck-us.net>
+
+[ Upstream commit 012e974501a270d8dfd4ee2039e1fdf7579c907e ]
+
+Rebooting xtensa images loaded with the '-kernel' option in qemu does
+not work. When executing a reboot command, the qemu session either hangs
+or experiences an endless sequence of error messages.
+
+  Kernel panic - not syncing: Unrecoverable error in exception handler
+
+Reset code jumps to the CPU restart address, but Linux can not recover
+from there because code and data in the kernel init sections have been
+discarded and overwritten at this point.
+
+XTFPGA platforms have a means to reset the CPU by writing 0xdead into a
+specific FPGA IO address. When used in QEMU the kernel image loaded with
+the '-kernel' option gets restored to its original state allowing the
+machine to boot successfully.
+
+Use that mechanism to attempt a platform reset. If it does not work,
+fall back to the existing mechanism.
+
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/xtensa/platforms/xtfpga/setup.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
+index 982e7c22e7ca..db5122765f16 100644
+--- a/arch/xtensa/platforms/xtfpga/setup.c
++++ b/arch/xtensa/platforms/xtfpga/setup.c
+@@ -54,8 +54,12 @@ void platform_power_off(void)
+ void platform_restart(void)
+ {
+-      /* Flush and reset the mmu, simulate a processor reset, and
+-       * jump to the reset vector. */
++      /* Try software reset first. */
++      WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead);
++
++      /* If software reset did not work, flush and reset the mmu,
++       * simulate a processor reset, and jump to the reset vector.
++       */
+       cpu_reset();
+       /* control never gets here */
+ }
+-- 
+2.33.0
+
diff --git a/queue-4.9/xtensa-xtfpga-use-config_use_of-instead-of-config_of.patch b/queue-4.9/xtensa-xtfpga-use-config_use_of-instead-of-config_of.patch
new file mode 100644 (file)
index 0000000..31ce1ef
--- /dev/null
@@ -0,0 +1,41 @@
+From c60f87802b34d7e1f5163f417f16d893fdb333c8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 5 Oct 2021 11:36:01 -0700
+Subject: xtensa: xtfpga: use CONFIG_USE_OF instead of CONFIG_OF
+
+From: Max Filippov <jcmvbkbc@gmail.com>
+
+[ Upstream commit f3d7c2cdf6dc0d5402ec29c3673893b3542c5ad1 ]
+
+Use platform data to initialize xtfpga device drivers when CONFIG_USE_OF
+is not selected. This fixes xtfpga networking when CONFIG_USE_OF is not
+selected but CONFIG_OF is.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/xtensa/platforms/xtfpga/setup.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
+index 42285f35d313..982e7c22e7ca 100644
+--- a/arch/xtensa/platforms/xtfpga/setup.c
++++ b/arch/xtensa/platforms/xtfpga/setup.c
+@@ -85,7 +85,7 @@ void __init platform_calibrate_ccount(void)
+ #endif
+-#ifdef CONFIG_OF
++#ifdef CONFIG_USE_OF
+ static void __init xtfpga_clk_setup(struct device_node *np)
+ {
+@@ -303,4 +303,4 @@ static int __init xtavnet_init(void)
+  */
+ arch_initcall(xtavnet_init);
+-#endif /* CONFIG_OF */
++#endif /* CONFIG_USE_OF */
+-- 
+2.33.0
+