From: Greg Kroah-Hartman Date: Mon, 1 Feb 2021 15:57:39 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.4.255~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f629a73a05df69d323ece17a5df05cae8934d856;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch drm-i915-check-for-all-subplatform-bits.patch drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch netfilter-nft_dynset-add-timeout-extension-to-template.patch tee-optee-replace-might_sleep-with-cond_resched.patch xen-blkfront-allow-discard-nodes-to-be-optional.patch --- diff --git a/queue-5.4/arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch b/queue-5.4/arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch new file mode 100644 index 00000000000..271edaf82cb --- /dev/null +++ b/queue-5.4/arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch @@ -0,0 +1,39 @@ +From a88afa46b86ff461c89cc33fc3a45267fff053e8 Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Mon, 11 Jan 2021 16:17:04 +0100 +Subject: ARM: imx: build suspend-imx6.S with arm instruction set + +From: Max Krummenacher + +commit a88afa46b86ff461c89cc33fc3a45267fff053e8 upstream. + +When the kernel is configured to use the Thumb-2 instruction set +"suspend-to-memory" fails to resume. Observed on a Colibri iMX6ULL +(i.MX 6ULL) and Apalis iMX6 (i.MX 6Q). + +It looks like the CPU resumes unconditionally in ARM instruction mode +and then chokes on the presented Thumb-2 code it should execute. + +Fix this by using the arm instruction set for all code in +suspend-imx6.S. + +Signed-off-by: Max Krummenacher +Fixes: df595746fa69 ("ARM: imx: add suspend in ocram support for i.mx6q") +Acked-by: Oleksandr Suvorov +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-imx/suspend-imx6.S | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mach-imx/suspend-imx6.S ++++ b/arch/arm/mach-imx/suspend-imx6.S +@@ -67,6 +67,7 @@ + #define MX6Q_CCM_CCR 0x0 + + .align 3 ++ .arm + + .macro sync_l2_cache + diff --git a/queue-5.4/drm-i915-check-for-all-subplatform-bits.patch b/queue-5.4/drm-i915-check-for-all-subplatform-bits.patch new file mode 100644 index 00000000000..1943bb7bf7d --- /dev/null +++ b/queue-5.4/drm-i915-check-for-all-subplatform-bits.patch @@ -0,0 +1,37 @@ +From 8f6d08c9af284d74276da6681348e4673f13caea Mon Sep 17 00:00:00 2001 +From: Umesh Nerlige Ramappa +Date: Thu, 21 Jan 2021 16:19:35 +0000 +Subject: drm/i915: Check for all subplatform bits + +From: Umesh Nerlige Ramappa + +commit 8f6d08c9af284d74276da6681348e4673f13caea upstream. + +Current code is checking only 2 bits in the subplatform, but actually 3 +bits are allocated for the field. Check all 3 bits. + +Fixes: 805446c8347c ("drm/i915: Introduce concept of a sub-platform") +Cc: Tvrtko Ursulin +Signed-off-by: Umesh Nerlige Ramappa +Reviewed-by: Tvrtko Ursulin +Signed-off-by: Chris Wilson +Link: https://patchwork.freedesktop.org/patch/msgid/20210121161936.746591-1-tvrtko.ursulin@linux.intel.com +(cherry picked from commit 27b695ee1af9bb36605e67055874ec081306ac28) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_drv.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/i915_drv.h ++++ b/drivers/gpu/drm/i915/i915_drv.h +@@ -1894,7 +1894,7 @@ intel_subplatform(const struct intel_run + { + const unsigned int pi = __platform_mask_index(info, p); + +- return info->platform_mask[pi] & INTEL_SUBPLATFORM_BITS; ++ return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1); + } + + static __always_inline bool diff --git a/queue-5.4/drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch b/queue-5.4/drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch new file mode 100644 index 00000000000..a339bc280ff --- /dev/null +++ b/queue-5.4/drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch @@ -0,0 +1,34 @@ +From dcd602cc5fe2803bf532d407cde24ba0b7808ff3 Mon Sep 17 00:00:00 2001 +From: Karol Herbst +Date: Mon, 18 Jan 2021 18:16:06 +0100 +Subject: drm/nouveau/svm: fail NOUVEAU_SVM_INIT ioctl on unsupported devices + +From: Karol Herbst + +commit dcd602cc5fe2803bf532d407cde24ba0b7808ff3 upstream. + +Fixes a crash when trying to create a channel on e.g. Turing GPUs when +NOUVEAU_SVM_INIT was called before. + +Fixes: eeaf06ac1a558 ("drm/nouveau/svm: initial support for shared virtual memory") +Signed-off-by: Karol Herbst +Signed-off-by: Ben Skeggs +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/nouveau/nouveau_svm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/nouveau/nouveau_svm.c ++++ b/drivers/gpu/drm/nouveau/nouveau_svm.c +@@ -306,6 +306,10 @@ nouveau_svmm_init(struct drm_device *dev + struct drm_nouveau_svm_init *args = data; + int ret; + ++ /* We need to fail if svm is disabled */ ++ if (!cli->drm->svm) ++ return -ENOSYS; ++ + /* Allocate tracking for SVM-enabled VMM. */ + if (!(svmm = kzalloc(sizeof(*svmm), GFP_KERNEL))) + return -ENOMEM; diff --git a/queue-5.4/netfilter-nft_dynset-add-timeout-extension-to-template.patch b/queue-5.4/netfilter-nft_dynset-add-timeout-extension-to-template.patch new file mode 100644 index 00000000000..9761ee61e13 --- /dev/null +++ b/queue-5.4/netfilter-nft_dynset-add-timeout-extension-to-template.patch @@ -0,0 +1,37 @@ +From 0c5b7a501e7400869ee905b4f7af3d6717802bcb Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Sat, 16 Jan 2021 19:20:15 +0100 +Subject: netfilter: nft_dynset: add timeout extension to template + +From: Pablo Neira Ayuso + +commit 0c5b7a501e7400869ee905b4f7af3d6717802bcb upstream. + +Otherwise, the newly create element shows no timeout when listing the +ruleset. If the set definition does not specify a default timeout, then +the set element only shows the expiration time, but not the timeout. +This is a problem when restoring a stateful ruleset listing since it +skips the timeout policy entirely. + +Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates") +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman + +--- + net/netfilter/nft_dynset.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/netfilter/nft_dynset.c ++++ b/net/netfilter/nft_dynset.c +@@ -233,8 +233,10 @@ static int nft_dynset_init(const struct + nft_set_ext_add_length(&priv->tmpl, NFT_SET_EXT_EXPR, + priv->expr->ops->size); + if (set->flags & NFT_SET_TIMEOUT) { +- if (timeout || set->timeout) ++ if (timeout || set->timeout) { ++ nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_TIMEOUT); + nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_EXPIRATION); ++ } + } + + priv->timeout = timeout; diff --git a/queue-5.4/series b/queue-5.4/series index ad65d9af920..283cee616ff 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -24,3 +24,9 @@ leds-trigger-fix-potential-deadlock-with-libata.patch arm64-dts-broadcom-fix-usb-dma-address-translation-for-stingray.patch mt7601u-fix-kernel-crash-unplugging-the-device.patch mt7601u-fix-rx-buffer-refcounting.patch +drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch +drm-i915-check-for-all-subplatform-bits.patch +tee-optee-replace-might_sleep-with-cond_resched.patch +xen-blkfront-allow-discard-nodes-to-be-optional.patch +arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch +netfilter-nft_dynset-add-timeout-extension-to-template.patch diff --git a/queue-5.4/tee-optee-replace-might_sleep-with-cond_resched.patch b/queue-5.4/tee-optee-replace-might_sleep-with-cond_resched.patch new file mode 100644 index 00000000000..cf142990fb6 --- /dev/null +++ b/queue-5.4/tee-optee-replace-might_sleep-with-cond_resched.patch @@ -0,0 +1,85 @@ +From dcb3b06d9c34f33a249f65c08805461fb0c4325b Mon Sep 17 00:00:00 2001 +From: Rouven Czerwinski +Date: Tue, 5 Jan 2021 11:28:44 +0100 +Subject: tee: optee: replace might_sleep with cond_resched + +From: Rouven Czerwinski + +commit dcb3b06d9c34f33a249f65c08805461fb0c4325b upstream. + +might_sleep() is a debugging aid and triggers rescheduling only for +certain kernel configurations. Replace with an explicit check and +reschedule to work for all kernel configurations. Fixes the following +trace: + + [ 572.945146] rcu: INFO: rcu_sched self-detected stall on CPU + [ 572.949275] rcu: 0-....: (2099 ticks this GP) idle=572/1/0x40000002 softirq=7412/7412 fqs=974 + [ 572.957964] (t=2100 jiffies g=10393 q=21) + [ 572.962054] NMI backtrace for cpu 0 + [ 572.965540] CPU: 0 PID: 165 Comm: xtest Not tainted 5.8.7 #1 + [ 572.971188] Hardware name: STM32 (Device Tree Support) + [ 572.976354] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) + [ 572.984080] [] (show_stack) from [] (dump_stack+0xc4/0xd8) + [ 572.991300] [] (dump_stack) from [] (nmi_cpu_backtrace+0x90/0xc4) + [ 572.999130] [] (nmi_cpu_backtrace) from [] (nmi_trigger_cpumask_backtrace+0xec/0x130) + [ 573.008706] [] (nmi_trigger_cpumask_backtrace) from [] (rcu_dump_cpu_stacks+0xe8/0x110) + [ 573.018453] [] (rcu_dump_cpu_stacks) from [] (rcu_sched_clock_irq+0x7fc/0xa88) + [ 573.027416] [] (rcu_sched_clock_irq) from [] (update_process_times+0x30/0x8c) + [ 573.036291] [] (update_process_times) from [] (tick_sched_timer+0x4c/0xa8) + [ 573.044905] [] (tick_sched_timer) from [] (__hrtimer_run_queues+0x174/0x358) + [ 573.053696] [] (__hrtimer_run_queues) from [] (hrtimer_interrupt+0x118/0x2bc) + [ 573.062573] [] (hrtimer_interrupt) from [] (arch_timer_handler_virt+0x28/0x30) + [ 573.071536] [] (arch_timer_handler_virt) from [] (handle_percpu_devid_irq+0x8c/0x240) + [ 573.081109] [] (handle_percpu_devid_irq) from [] (generic_handle_irq+0x34/0x44) + [ 573.090156] [] (generic_handle_irq) from [] (__handle_domain_irq+0x5c/0xb0) + [ 573.098857] [] (__handle_domain_irq) from [] (gic_handle_irq+0x4c/0x90) + [ 573.107209] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0x90) + [ 573.114682] Exception stack(0xd90dfcf8 to 0xd90dfd40) + [ 573.119732] fce0: ffff0004 00000000 + [ 573.127917] fd00: 00000000 00000000 00000000 00000000 00000000 00000000 d93493cc ffff0000 + [ 573.136098] fd20: d2bc39c0 be926998 d90dfd58 d90dfd48 c09f3384 c01151f0 400d0013 ffffffff + [ 573.144281] [] (__irq_svc) from [] (__arm_smccc_smc+0x10/0x20) + [ 573.151854] [] (__arm_smccc_smc) from [] (optee_smccc_smc+0x3c/0x44) + [ 573.159948] [] (optee_smccc_smc) from [] (optee_do_call_with_arg+0xb8/0x154) + [ 573.168735] [] (optee_do_call_with_arg) from [] (optee_invoke_func+0x110/0x190) + [ 573.177786] [] (optee_invoke_func) from [] (tee_ioctl+0x10b8/0x11c0) + [ 573.185879] [] (tee_ioctl) from [] (ksys_ioctl+0xe0/0xa4c) + [ 573.193101] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) + [ 573.200750] Exception stack(0xd90dffa8 to 0xd90dfff0) + [ 573.205803] ffa0: be926bf4 be926a78 00000003 8010a403 be926908 004e3cf8 + [ 573.213987] ffc0: be926bf4 be926a78 00000000 00000036 be926908 be926918 be9269b0 bffdf0f8 + [ 573.222162] ffe0: b6d76fb0 be9268fc b6d66621 b6c7e0d8 + +seen on STM32 DK2 with CONFIG_PREEMPT_NONE. + +Fixes: 9f02b8f61f29 ("tee: optee: add might_sleep for RPC requests") +Signed-off-by: Rouven Czerwinski +Tested-by: Sumit Garg +[jw: added fixes tag + small adjustments in the code] +Signed-off-by: Jens Wiklander +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tee/optee/call.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/tee/optee/call.c ++++ b/drivers/tee/optee/call.c +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -148,7 +149,8 @@ u32 optee_do_call_with_arg(struct tee_co + */ + optee_cq_wait_for_completion(&optee->call_queue, &w); + } else if (OPTEE_SMC_RETURN_IS_RPC(res.a0)) { +- might_sleep(); ++ if (need_resched()) ++ cond_resched(); + param.a0 = res.a0; + param.a1 = res.a1; + param.a2 = res.a2; diff --git a/queue-5.4/xen-blkfront-allow-discard-nodes-to-be-optional.patch b/queue-5.4/xen-blkfront-allow-discard-nodes-to-be-optional.patch new file mode 100644 index 00000000000..44ad092b492 --- /dev/null +++ b/queue-5.4/xen-blkfront-allow-discard-nodes-to-be-optional.patch @@ -0,0 +1,77 @@ +From 0549cd67b01016b579047bce045b386202a8bcfc Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Tue, 19 Jan 2021 11:57:27 +0100 +Subject: xen-blkfront: allow discard-* nodes to be optional +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Roger Pau Monne + +commit 0549cd67b01016b579047bce045b386202a8bcfc upstream. + +This is inline with the specification described in blkif.h: + + * discard-granularity: should be set to the physical block size if + node is not present. + * discard-alignment, discard-secure: should be set to 0 if node not + present. + +This was detected as QEMU would only create the discard-granularity +node but not discard-alignment, and thus the setup done in +blkfront_setup_discard would fail. + +Fix blkfront_setup_discard to not fail on missing nodes, and also fix +blkif_set_queue_limits to set the discard granularity to the physical +block size if none is specified in xenbus. + +Fixes: ed30bf317c5ce ('xen-blkfront: Handle discard requests.') +Reported-by: Arthur Borsboom +Signed-off-by: Roger Pau Monné +Reviewed-by: Juergen Gross +Tested-By: Arthur Borsboom +Link: https://lore.kernel.org/r/20210119105727.95173-1-roger.pau@citrix.com +Signed-off-by: Juergen Gross +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/xen-blkfront.c | 20 +++++++------------- + 1 file changed, 7 insertions(+), 13 deletions(-) + +--- a/drivers/block/xen-blkfront.c ++++ b/drivers/block/xen-blkfront.c +@@ -936,7 +936,8 @@ static void blkif_set_queue_limits(struc + if (info->feature_discard) { + blk_queue_flag_set(QUEUE_FLAG_DISCARD, rq); + blk_queue_max_discard_sectors(rq, get_capacity(gd)); +- rq->limits.discard_granularity = info->discard_granularity; ++ rq->limits.discard_granularity = info->discard_granularity ?: ++ info->physical_sector_size; + rq->limits.discard_alignment = info->discard_alignment; + if (info->feature_secdiscard) + blk_queue_flag_set(QUEUE_FLAG_SECERASE, rq); +@@ -2169,19 +2170,12 @@ static void blkfront_closing(struct blkf + + static void blkfront_setup_discard(struct blkfront_info *info) + { +- int err; +- unsigned int discard_granularity; +- unsigned int discard_alignment; +- + info->feature_discard = 1; +- err = xenbus_gather(XBT_NIL, info->xbdev->otherend, +- "discard-granularity", "%u", &discard_granularity, +- "discard-alignment", "%u", &discard_alignment, +- NULL); +- if (!err) { +- info->discard_granularity = discard_granularity; +- info->discard_alignment = discard_alignment; +- } ++ info->discard_granularity = xenbus_read_unsigned(info->xbdev->otherend, ++ "discard-granularity", ++ 0); ++ info->discard_alignment = xenbus_read_unsigned(info->xbdev->otherend, ++ "discard-alignment", 0); + info->feature_secdiscard = + !!xenbus_read_unsigned(info->xbdev->otherend, "discard-secure", + 0);