From: Sasha Levin Date: Wed, 20 Oct 2021 21:21:33 +0000 (-0400) Subject: Fixes for 4.9 X-Git-Tag: v4.4.290~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=143a400002a4f78b9ca055372c5cb14b4dc27745;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- 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 index 00000000000..85a22988be8 --- /dev/null +++ b/queue-4.9/nfsd-keep-existing-listeners-on-portlist-error.patch @@ -0,0 +1,42 @@ +From 2412cdce00ba0343d7b2848c5a232013f858e7cb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Oct 2021 13:20:44 -0400 +Subject: NFSD: Keep existing listeners on portlist error + +From: Benjamin Coddington + +[ 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 +Signed-off-by: Chuck Lever +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-4.9/series b/queue-4.9/series index 7874127be02..c80d7d67689 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -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 index 00000000000..6c68c745936 --- /dev/null +++ b/queue-4.9/xtensa-xtfpga-try-software-restart-before-simulating.patch @@ -0,0 +1,56 @@ +From d605e77fbdbdb6cba8591774a8d901dd20ecedd2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 1 Aug 2021 10:36:59 -0700 +Subject: xtensa: xtfpga: Try software restart before simulating CPU reset + +From: Guenter Roeck + +[ 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 +Signed-off-by: Max Filippov +Signed-off-by: Sasha Levin +--- + 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 index 00000000000..31ce1efb25c --- /dev/null +++ b/queue-4.9/xtensa-xtfpga-use-config_use_of-instead-of-config_of.patch @@ -0,0 +1,41 @@ +From c60f87802b34d7e1f5163f417f16d893fdb333c8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Oct 2021 11:36:01 -0700 +Subject: xtensa: xtfpga: use CONFIG_USE_OF instead of CONFIG_OF + +From: Max Filippov + +[ 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 +Signed-off-by: Sasha Levin +--- + 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 +