]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Feb 2021 15:57:56 +0000 (16:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Feb 2021 15:57:56 +0000 (16:57 +0100)
added patches:
arm-dts-imx6qdl-kontron-samx6i-fix-pwms-for-lcd-backlight.patch
arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch
arm-zimage-atags_to_fdt-fix-node-names-on-added-root-nodes.patch
blk-mq-test-queue_flag_hctx_active-for-sbitmap_shared-in-hctx_may_queue.patch
clk-imx-fix-kconfig-warning-for-i.mx-scu-clk.patch
clk-mmp2-fix-build-without-config_pm.patch
clk-qcom-gcc-sm250-use-floor-ops-for-sdcc-clks.patch
drm-i915-check-for-all-subplatform-bits.patch
drm-i915-selftest-fix-potential-memory-leak.patch
drm-nouveau-dispnv50-restore-pushing-of-all-data.patch
drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch
drm-vc4-correct-lbm-size-and-calculation.patch
drm-vc4-correct-pos1_scl-for-hvs5.patch
kvm-documentation-fix-spec-for-kvm_cap_enable_cap_vm.patch
net-mlx5e-fix-ipsec-stats.patch
netfilter-nft_dynset-add-timeout-extension-to-template.patch
revert-block-simplify-set_init_blocksize-to-regain-lost-performance.patch
revert-rdma-mlx5-fix-devlink-deadlock-on-net-namespace-deletion.patch
tee-optee-replace-might_sleep-with-cond_resched.patch
uapi-fix-big-endian-definition-of-ipv6_rpl_sr_hdr.patch
xen-blkfront-allow-discard-nodes-to-be-optional.patch

22 files changed:
queue-5.10/arm-dts-imx6qdl-kontron-samx6i-fix-pwms-for-lcd-backlight.patch [new file with mode: 0644]
queue-5.10/arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch [new file with mode: 0644]
queue-5.10/arm-zimage-atags_to_fdt-fix-node-names-on-added-root-nodes.patch [new file with mode: 0644]
queue-5.10/blk-mq-test-queue_flag_hctx_active-for-sbitmap_shared-in-hctx_may_queue.patch [new file with mode: 0644]
queue-5.10/clk-imx-fix-kconfig-warning-for-i.mx-scu-clk.patch [new file with mode: 0644]
queue-5.10/clk-mmp2-fix-build-without-config_pm.patch [new file with mode: 0644]
queue-5.10/clk-qcom-gcc-sm250-use-floor-ops-for-sdcc-clks.patch [new file with mode: 0644]
queue-5.10/drm-i915-check-for-all-subplatform-bits.patch [new file with mode: 0644]
queue-5.10/drm-i915-selftest-fix-potential-memory-leak.patch [new file with mode: 0644]
queue-5.10/drm-nouveau-dispnv50-restore-pushing-of-all-data.patch [new file with mode: 0644]
queue-5.10/drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch [new file with mode: 0644]
queue-5.10/drm-vc4-correct-lbm-size-and-calculation.patch [new file with mode: 0644]
queue-5.10/drm-vc4-correct-pos1_scl-for-hvs5.patch [new file with mode: 0644]
queue-5.10/kvm-documentation-fix-spec-for-kvm_cap_enable_cap_vm.patch [new file with mode: 0644]
queue-5.10/net-mlx5e-fix-ipsec-stats.patch [new file with mode: 0644]
queue-5.10/netfilter-nft_dynset-add-timeout-extension-to-template.patch [new file with mode: 0644]
queue-5.10/revert-block-simplify-set_init_blocksize-to-regain-lost-performance.patch [new file with mode: 0644]
queue-5.10/revert-rdma-mlx5-fix-devlink-deadlock-on-net-namespace-deletion.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/tee-optee-replace-might_sleep-with-cond_resched.patch [new file with mode: 0644]
queue-5.10/uapi-fix-big-endian-definition-of-ipv6_rpl_sr_hdr.patch [new file with mode: 0644]
queue-5.10/xen-blkfront-allow-discard-nodes-to-be-optional.patch [new file with mode: 0644]

diff --git a/queue-5.10/arm-dts-imx6qdl-kontron-samx6i-fix-pwms-for-lcd-backlight.patch b/queue-5.10/arm-dts-imx6qdl-kontron-samx6i-fix-pwms-for-lcd-backlight.patch
new file mode 100644 (file)
index 0000000..d16bec0
--- /dev/null
@@ -0,0 +1,37 @@
+From 6337c2353a069b6f1276dc35421e421ef6c1ead9 Mon Sep 17 00:00:00 2001
+From: Marco Felsch <m.felsch@pengutronix.de>
+Date: Wed, 2 Dec 2020 19:05:58 +0100
+Subject: ARM: dts: imx6qdl-kontron-samx6i: fix pwms for lcd-backlight
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Marco Felsch <m.felsch@pengutronix.de>
+
+commit 6337c2353a069b6f1276dc35421e421ef6c1ead9 upstream.
+
+The pwms property have to specify the no-/inverted flag since
+commit fa28d8212ede ("ARM: dts: imx: default to #pwm-cells = <3>
+in the SoC dtsi files").
+
+Fixes: fa28d8212ede ("ARM: dts: imx: default to #pwm-cells = <3> in the SoC dtsi files")
+Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
+Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi
++++ b/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi
+@@ -137,7 +137,7 @@
+       lcd_backlight: lcd-backlight {
+               compatible = "pwm-backlight";
+-              pwms = <&pwm4 0 5000000>;
++              pwms = <&pwm4 0 5000000 0>;
+               pwm-names = "LCD_BKLT_PWM";
+               brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
diff --git a/queue-5.10/arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch b/queue-5.10/arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch
new file mode 100644 (file)
index 0000000..271edaf
--- /dev/null
@@ -0,0 +1,39 @@
+From a88afa46b86ff461c89cc33fc3a45267fff053e8 Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.oss.09@gmail.com>
+Date: Mon, 11 Jan 2021 16:17:04 +0100
+Subject: ARM: imx: build suspend-imx6.S with arm instruction set
+
+From: Max Krummenacher <max.oss.09@gmail.com>
+
+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 <max.krummenacher@toradex.com>
+Fixes: df595746fa69 ("ARM: imx: add suspend in ocram support for i.mx6q")
+Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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.10/arm-zimage-atags_to_fdt-fix-node-names-on-added-root-nodes.patch b/queue-5.10/arm-zimage-atags_to_fdt-fix-node-names-on-added-root-nodes.patch
new file mode 100644 (file)
index 0000000..a8feeda
--- /dev/null
@@ -0,0 +1,42 @@
+From 30596ae0547dbda469d31a2678d9072fb0a3fa27 Mon Sep 17 00:00:00 2001
+From: Rob Herring <robh@kernel.org>
+Date: Mon, 25 Jan 2021 20:39:05 -0600
+Subject: ARM: zImage: atags_to_fdt: Fix node names on added root nodes
+
+From: Rob Herring <robh@kernel.org>
+
+commit 30596ae0547dbda469d31a2678d9072fb0a3fa27 upstream.
+
+Commit 7536c7e03e74 ("of/fdt: Remove redundant kbasename function
+call") exposed a bug creating DT nodes in the ATAGS to DT fixup code.
+Non-existent nodes would mistaken get created with a leading '/'. The
+problem was fdt_path_offset() takes a full path while creating a node
+with fdt_add_subnode() takes just the basename.
+
+Since this we only add root child nodes, we can just skip over the '/'.
+
+Fixes: 7536c7e03e74 ("of/fdt: Remove redundant kbasename function call")
+Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
+Cc: Qi Zheng <arch0.zheng@gmail.com>
+Cc: Russell King <linux@armlinux.org.uk>
+Signed-off-by: Rob Herring <robh@kernel.org>
+Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
+Link: https://lore.kernel.org/r/20210126023905.1631161-1-robh@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/compressed/atags_to_fdt.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/compressed/atags_to_fdt.c
++++ b/arch/arm/boot/compressed/atags_to_fdt.c
+@@ -15,7 +15,8 @@ static int node_offset(void *fdt, const
+ {
+       int offset = fdt_path_offset(fdt, node_path);
+       if (offset == -FDT_ERR_NOTFOUND)
+-              offset = fdt_add_subnode(fdt, 0, node_path);
++              /* Add the node to root if not found, dropping the leading '/' */
++              offset = fdt_add_subnode(fdt, 0, node_path + 1);
+       return offset;
+ }
diff --git a/queue-5.10/blk-mq-test-queue_flag_hctx_active-for-sbitmap_shared-in-hctx_may_queue.patch b/queue-5.10/blk-mq-test-queue_flag_hctx_active-for-sbitmap_shared-in-hctx_may_queue.patch
new file mode 100644 (file)
index 0000000..5dc480b
--- /dev/null
@@ -0,0 +1,37 @@
+From 2569063c7140c65a0d0ad075e95ddfbcda9ba3c0 Mon Sep 17 00:00:00 2001
+From: Ming Lei <ming.lei@redhat.com>
+Date: Sun, 27 Dec 2020 19:34:58 +0800
+Subject: blk-mq: test QUEUE_FLAG_HCTX_ACTIVE for sbitmap_shared in hctx_may_queue
+
+From: Ming Lei <ming.lei@redhat.com>
+
+commit 2569063c7140c65a0d0ad075e95ddfbcda9ba3c0 upstream.
+
+In case of blk_mq_is_sbitmap_shared(), we should test QUEUE_FLAG_HCTX_ACTIVE against
+q->queue_flags instead of BLK_MQ_S_TAG_ACTIVE.
+
+So fix it.
+
+Cc: John Garry <john.garry@huawei.com>
+Cc: Kashyap Desai <kashyap.desai@broadcom.com>
+Fixes: f1b49fdc1c64 ("blk-mq: Record active_queues_shared_sbitmap per tag_set for when using shared sbitmap")
+Signed-off-by: Ming Lei <ming.lei@redhat.com>
+Reviewed-by: John Garry <john.garry@huawei.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ block/blk-mq.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/block/blk-mq.h
++++ b/block/blk-mq.h
+@@ -303,7 +303,7 @@ static inline bool hctx_may_queue(struct
+               struct request_queue *q = hctx->queue;
+               struct blk_mq_tag_set *set = q->tag_set;
+-              if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &q->queue_flags))
++              if (!test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags))
+                       return true;
+               users = atomic_read(&set->active_queues_shared_sbitmap);
+       } else {
diff --git a/queue-5.10/clk-imx-fix-kconfig-warning-for-i.mx-scu-clk.patch b/queue-5.10/clk-imx-fix-kconfig-warning-for-i.mx-scu-clk.patch
new file mode 100644 (file)
index 0000000..28cce28
--- /dev/null
@@ -0,0 +1,42 @@
+From 73f6b7ed9835ad9f953aebd60dd720aabc487b81 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Wed, 30 Dec 2020 16:52:25 +0100
+Subject: clk: imx: fix Kconfig warning for i.MX SCU clk
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 73f6b7ed9835ad9f953aebd60dd720aabc487b81 upstream.
+
+A previous patch introduced a harmless randconfig warning:
+
+WARNING: unmet direct dependencies detected for MXC_CLK_SCU
+  Depends on [n]: COMMON_CLK [=y] && ARCH_MXC [=n] && IMX_SCU [=y] && HAVE_ARM_SMCCC [=y]
+  Selected by [m]:
+  - CLK_IMX8QXP [=m] && COMMON_CLK [=y] && (ARCH_MXC [=n] && ARM64 [=y] || COMPILE_TEST [=y]) && IMX_SCU [=y] && HAVE_ARM_SMCCC [=y]
+
+Since the symbol is now hidden and only selected by other symbols,
+just remove the dependencies and require the other drivers to
+get it right.
+
+Fixes: 6247e31b7530 ("clk: imx: scu: fix MXC_CLK_SCU module build break")
+Reported-by: Anders Roxell <anders.roxell@linaro.org>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Link: https://lore.kernel.org/r/20201230155244.981757-1-arnd@kernel.org
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/clk/imx/Kconfig |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/drivers/clk/imx/Kconfig
++++ b/drivers/clk/imx/Kconfig
+@@ -6,8 +6,6 @@ config MXC_CLK
+ config MXC_CLK_SCU
+       tristate
+-      depends on ARCH_MXC
+-      depends on IMX_SCU && HAVE_ARM_SMCCC
+ config CLK_IMX1
+       def_bool SOC_IMX1
diff --git a/queue-5.10/clk-mmp2-fix-build-without-config_pm.patch b/queue-5.10/clk-mmp2-fix-build-without-config_pm.patch
new file mode 100644 (file)
index 0000000..ec5c55b
--- /dev/null
@@ -0,0 +1,58 @@
+From c361c5a6c559d1e0a2717abe9162a71aa602954f Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Sun, 3 Jan 2021 14:54:53 +0100
+Subject: clk: mmp2: fix build without CONFIG_PM
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit c361c5a6c559d1e0a2717abe9162a71aa602954f upstream.
+
+pm_clk_suspend()/pm_clk_resume() are defined as NULL pointers rather than
+empty inline stubs without CONFIG_PM:
+
+drivers/clk/mmp/clk-audio.c:402:16: error: called object type 'void *' is not a function or function pointer
+        pm_clk_suspend(dev);
+drivers/clk/mmp/clk-audio.c:411:15: error: called object type 'void *' is not a function or function pointer
+        pm_clk_resume(dev);
+
+I tried redefining the helper functions, but that caused additional
+problems. This is the simple solution of replacing the __maybe_unused
+trick with an #ifdef.
+
+Fixes: 725262d29139 ("clk: mmp2: Add audio clock controller driver")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Link: https://lore.kernel.org/r/20210103135503.3668784-1-arnd@kernel.org
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/drivers/clk/mmp/clk-audio.c b/drivers/clk/mmp/clk-audio.c
+index eea69d498bd2..7aa7f4a9564f 100644
+--- a/drivers/clk/mmp/clk-audio.c
++++ b/drivers/clk/mmp/clk-audio.c
+@@ -392,7 +392,8 @@ static int mmp2_audio_clk_remove(struct platform_device *pdev)
+       return 0;
+ }
+-static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
++#ifdef CONFIG_PM
++static int mmp2_audio_clk_suspend(struct device *dev)
+ {
+       struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
+@@ -404,7 +405,7 @@ static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
+       return 0;
+ }
+-static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
++static int mmp2_audio_clk_resume(struct device *dev)
+ {
+       struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
+@@ -415,6 +416,7 @@ static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
+       return 0;
+ }
++#endif
+ static const struct dev_pm_ops mmp2_audio_clk_pm_ops = {
+       SET_RUNTIME_PM_OPS(mmp2_audio_clk_suspend, mmp2_audio_clk_resume, NULL)
diff --git a/queue-5.10/clk-qcom-gcc-sm250-use-floor-ops-for-sdcc-clks.patch b/queue-5.10/clk-qcom-gcc-sm250-use-floor-ops-for-sdcc-clks.patch
new file mode 100644 (file)
index 0000000..6d40228
--- /dev/null
@@ -0,0 +1,41 @@
+From fd2383093593b23f8814a879093b746e502fe3cf Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Date: Sat, 9 Jan 2021 04:33:14 +0300
+Subject: clk: qcom: gcc-sm250: Use floor ops for sdcc clks
+
+From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+
+commit fd2383093593b23f8814a879093b746e502fe3cf upstream.
+
+Followup to the commits 5e4b7e82d497 ("clk: qcom: gcc-sdm845: Use floor
+ops for sdcc clks") and 6d37a8d19283 ("clk: qcom: gcc-sc7180: Use floor ops
+for sdcc clks"). Use floor ops for sdcc clocks on sm8250.
+
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Fixes: 3e5770921a88 ("clk: qcom: gcc: Add global clock controller driver for SM8250")
+Link: https://lore.kernel.org/r/20210109013314.3443134-1-dmitry.baryshkov@linaro.org
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/drivers/clk/qcom/gcc-sm8250.c b/drivers/clk/qcom/gcc-sm8250.c
+index 6cb6617b8d88..ab594a0f0c40 100644
+--- a/drivers/clk/qcom/gcc-sm8250.c
++++ b/drivers/clk/qcom/gcc-sm8250.c
+@@ -722,7 +722,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
+               .name = "gcc_sdcc2_apps_clk_src",
+               .parent_data = gcc_parent_data_4,
+               .num_parents = 5,
+-              .ops = &clk_rcg2_ops,
++              .ops = &clk_rcg2_floor_ops,
+       },
+ };
+@@ -745,7 +745,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
+               .name = "gcc_sdcc4_apps_clk_src",
+               .parent_data = gcc_parent_data_0,
+               .num_parents = 3,
+-              .ops = &clk_rcg2_ops,
++              .ops = &clk_rcg2_floor_ops,
+       },
+ };
diff --git a/queue-5.10/drm-i915-check-for-all-subplatform-bits.patch b/queue-5.10/drm-i915-check-for-all-subplatform-bits.patch
new file mode 100644 (file)
index 0000000..a4fc4d2
--- /dev/null
@@ -0,0 +1,37 @@
+From 8f6d08c9af284d74276da6681348e4673f13caea Mon Sep 17 00:00:00 2001
+From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
+Date: Thu, 21 Jan 2021 16:19:35 +0000
+Subject: drm/i915: Check for all subplatform bits
+
+From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
+
+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 <tvrtko.ursulin@intel.com>
+Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
+Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+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 <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -1347,7 +1347,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.10/drm-i915-selftest-fix-potential-memory-leak.patch b/queue-5.10/drm-i915-selftest-fix-potential-memory-leak.patch
new file mode 100644 (file)
index 0000000..6be8283
--- /dev/null
@@ -0,0 +1,36 @@
+From 3d480fe1befa0ef434f5c25199e7d45c26870555 Mon Sep 17 00:00:00 2001
+From: Pan Bian <bianpan2016@163.com>
+Date: Thu, 21 Jan 2021 17:56:40 -0800
+Subject: drm/i915/selftest: Fix potential memory leak
+
+From: Pan Bian <bianpan2016@163.com>
+
+commit 3d480fe1befa0ef434f5c25199e7d45c26870555 upstream.
+
+Object out is not released on path that no VMA instance found. The root
+cause is jumping to an unexpected label on the error path.
+
+Fixes: a47e788c2310 ("drm/i915/selftests: Exercise CS TLB invalidation")
+Signed-off-by: Pan Bian <bianpan2016@163.com>
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Link: https://patchwork.freedesktop.org/patch/msgid/20210122015640.16002-1-bianpan2016@163.com
+(cherry picked from commit 2b015017d5cb01477a79ca184ac25c247d664568)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
++++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+@@ -1880,7 +1880,7 @@ static int igt_cs_tlb(void *arg)
+       vma = i915_vma_instance(out, vm, NULL);
+       if (IS_ERR(vma)) {
+               err = PTR_ERR(vma);
+-              goto out_put_batch;
++              goto out_put_out;
+       }
+       err = i915_vma_pin(vma, 0, 0,
diff --git a/queue-5.10/drm-nouveau-dispnv50-restore-pushing-of-all-data.patch b/queue-5.10/drm-nouveau-dispnv50-restore-pushing-of-all-data.patch
new file mode 100644 (file)
index 0000000..6cbd177
--- /dev/null
@@ -0,0 +1,64 @@
+From fd55b61ebd31449549e14c33574825d64de2b29b Mon Sep 17 00:00:00 2001
+From: Bastian Beranek <bastian.beischer@rwth-aachen.de>
+Date: Thu, 21 Jan 2021 15:27:36 +0100
+Subject: drm/nouveau/dispnv50: Restore pushing of all data.
+
+From: Bastian Beranek <bastian.beischer@rwth-aachen.de>
+
+commit fd55b61ebd31449549e14c33574825d64de2b29b upstream.
+
+Commit f844eb485eb056ad3b67e49f95cbc6c685a73db4 introduced a regression for
+NV50, which lead to visual artifacts, tearing and eventual crashes.
+
+In the changes of f844eb485eb056ad3b67e49f95cbc6c685a73db4 only the first line
+was correctly translated to the new NVIDIA header macros:
+
+-              PUSH_NVSQ(push, NV827C, 0x0110, 0,
+-                                      0x0114, 0);
++              PUSH_MTHD(push, NV827C, SET_PROCESSING,
++                        NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));
+
+The lower part ("0x0114, 0") was probably omitted by accident.
+
+This patch restores the push of the missing data and fixes the regression.
+
+Signed-off-by: Bastian Beranek <bastian.beischer@rwth-aachen.de>
+Fixes: f844eb485eb05 ("drm/nouveau/kms/nv50-: use NVIDIA's headers for wndw image_set()")
+Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/14
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/base507c.c b/drivers/gpu/drm/nouveau/dispnv50/base507c.c
+index 302d4e6fc52f..788db043a342 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/base507c.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/base507c.c
+@@ -88,7 +88,11 @@ base507c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
+                         NVVAL(NV507C, SET_CONVERSION, OFS, 0x64));
+       } else {
+               PUSH_MTHD(push, NV507C, SET_PROCESSING,
+-                        NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));
++                        NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE),
++
++                                      SET_CONVERSION,
++                        NVVAL(NV507C, SET_CONVERSION, GAIN, 0) |
++                        NVVAL(NV507C, SET_CONVERSION, OFS, 0));
+       }
+       PUSH_MTHD(push, NV507C, SURFACE_SET_OFFSET(0, 0), asyw->image.offset[0] >> 8);
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/base827c.c b/drivers/gpu/drm/nouveau/dispnv50/base827c.c
+index 18d34096f125..093d4ba6910e 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/base827c.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/base827c.c
+@@ -49,7 +49,11 @@ base827c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
+                         NVVAL(NV827C, SET_CONVERSION, OFS, 0x64));
+       } else {
+               PUSH_MTHD(push, NV827C, SET_PROCESSING,
+-                        NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));
++                        NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE),
++
++                                      SET_CONVERSION,
++                        NVVAL(NV827C, SET_CONVERSION, GAIN, 0) |
++                        NVVAL(NV827C, SET_CONVERSION, OFS, 0));
+       }
+       PUSH_MTHD(push, NV827C, SURFACE_SET_OFFSET(0, 0), asyw->image.offset[0] >> 8,
diff --git a/queue-5.10/drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch b/queue-5.10/drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch
new file mode 100644 (file)
index 0000000..178ff52
--- /dev/null
@@ -0,0 +1,34 @@
+From dcd602cc5fe2803bf532d407cde24ba0b7808ff3 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Mon, 18 Jan 2021 18:16:06 +0100
+Subject: drm/nouveau/svm: fail NOUVEAU_SVM_INIT ioctl on unsupported devices
+
+From: Karol Herbst <kherbst@redhat.com>
+
+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 <kherbst@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -315,6 +315,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.10/drm-vc4-correct-lbm-size-and-calculation.patch b/queue-5.10/drm-vc4-correct-lbm-size-and-calculation.patch
new file mode 100644 (file)
index 0000000..cc78d12
--- /dev/null
@@ -0,0 +1,78 @@
+From 78e5330329ee206d6aa4593a90320fd837f7966e Mon Sep 17 00:00:00 2001
+From: Dom Cobley <popcornmix@gmail.com>
+Date: Thu, 21 Jan 2021 11:57:58 +0100
+Subject: drm/vc4: Correct lbm size and calculation
+
+From: Dom Cobley <popcornmix@gmail.com>
+
+commit 78e5330329ee206d6aa4593a90320fd837f7966e upstream.
+
+LBM base address is measured in units of pixels per cycle.
+That is 4 for 2711 (hvs5) and 2 for 2708.
+
+We are wasting 75% of lbm by indexing without the scaling.
+But we were also using too high a size for the lbm resulting
+in partial corruption (right hand side) of vertically
+scaled images, usually at 4K or lower resolutions with more layers.
+
+The physical RAM of LBM on 2711 is 8 * 1920 * 16 * 12-bit
+(pixels are stored 12-bits per component regardless of format).
+
+The LBM address indexes work in units of pixels per clock,
+so for 4 pixels per clock that means we have 32 * 1920 = 60K
+
+Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5")
+Signed-off-by: Dom Cobley <popcornmix@gmail.com>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Tested-By: Lucas Nussbaum <lucas@debian.org>
+Tested-By: Ryutaroh Matsumoto <ryutaroh@ict.e.titech.ac.jp>
+Link: https://patchwork.freedesktop.org/patch/msgid/20210121105759.1262699-1-maxime@cerno.tech
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/vc4/vc4_hvs.c   |    8 ++++----
+ drivers/gpu/drm/vc4/vc4_plane.c |    7 ++++++-
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_hvs.c
++++ b/drivers/gpu/drm/vc4/vc4_hvs.c
+@@ -618,11 +618,11 @@ static int vc4_hvs_bind(struct device *d
+        * for now we just allocate globally.
+        */
+       if (!hvs->hvs5)
+-              /* 96kB */
+-              drm_mm_init(&hvs->lbm_mm, 0, 96 * 1024);
++              /* 48k words of 2x12-bit pixels */
++              drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024);
+       else
+-              /* 70k words */
+-              drm_mm_init(&hvs->lbm_mm, 0, 70 * 2 * 1024);
++              /* 60k words of 4x12-bit pixels */
++              drm_mm_init(&hvs->lbm_mm, 0, 60 * 1024);
+       /* Upload filter kernels.  We only have the one for now, so we
+        * keep it around for the lifetime of the driver.
+--- a/drivers/gpu/drm/vc4/vc4_plane.c
++++ b/drivers/gpu/drm/vc4/vc4_plane.c
+@@ -437,6 +437,7 @@ static void vc4_write_ppf(struct vc4_pla
+ static u32 vc4_lbm_size(struct drm_plane_state *state)
+ {
+       struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
++      struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev);
+       u32 pix_per_line;
+       u32 lbm;
+@@ -472,7 +473,11 @@ static u32 vc4_lbm_size(struct drm_plane
+               lbm = pix_per_line * 16;
+       }
+-      lbm = roundup(lbm, 32);
++      /* Align it to 64 or 128 (hvs5) bytes */
++      lbm = roundup(lbm, vc4->hvs->hvs5 ? 128 : 64);
++
++      /* Each "word" of the LBM memory contains 2 or 4 (hvs5) pixels */
++      lbm /= vc4->hvs->hvs5 ? 4 : 2;
+       return lbm;
+ }
diff --git a/queue-5.10/drm-vc4-correct-pos1_scl-for-hvs5.patch b/queue-5.10/drm-vc4-correct-pos1_scl-for-hvs5.patch
new file mode 100644 (file)
index 0000000..cd58372
--- /dev/null
@@ -0,0 +1,83 @@
+From f6b57101a6b31277a4bde1d8028c46e898bd2ff2 Mon Sep 17 00:00:00 2001
+From: Dom Cobley <popcornmix@gmail.com>
+Date: Thu, 21 Jan 2021 11:57:59 +0100
+Subject: drm/vc4: Correct POS1_SCL for hvs5
+
+From: Dom Cobley <popcornmix@gmail.com>
+
+commit f6b57101a6b31277a4bde1d8028c46e898bd2ff2 upstream.
+
+Fixes failure with 4096x1080 resolutions
+
+[  284.315379] WARNING: CPU: 1 PID: 901 at drivers/gpu/drm/vc4/vc4_plane.c:981 vc4_plane_mode_set+0x1374/0x13c4
+[  284.315385] Modules linked in: ir_rc5_decoder rpivid_hevc(C) bcm2835_codec(C) bcm2835_isp(C) bcm2835_mmal_vchiq(C) bcm2835_gpiomem v4l2_mem2mem videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc cdc_acm xpad ir_rc6_decoder rc_rc6_mce gpio_ir_recv fuse
+[  284.315509] CPU: 1 PID: 901 Comm: kodi.bin Tainted: G         C        5.10.7 #1
+[  284.315514] Hardware name: BCM2711
+[  284.315518] Backtrace:
+[  284.315533] [<c0cc5ca0>] (dump_backtrace) from [<c0cc6014>] (show_stack+0x20/0x24)
+[  284.315540]  r7:ffffffff r6:00000000 r5:68000013 r4:c18ecf1c
+[  284.315549] [<c0cc5ff4>] (show_stack) from [<c0cca638>] (dump_stack+0xc4/0xf0)
+[  284.315558] [<c0cca574>] (dump_stack) from [<c022314c>] (__warn+0xfc/0x158)
+[  284.315564]  r9:00000000 r8:00000009 r7:000003d5 r6:00000009 r5:c08cc7dc r4:c0fd09b8
+[  284.315572] [<c0223050>] (__warn) from [<c0cc67ec>] (warn_slowpath_fmt+0x74/0xe4)
+[  284.315577]  r7:c08cc7dc r6:000003d5 r5:c0fd09b8 r4:00000000
+[  284.315584] [<c0cc677c>] (warn_slowpath_fmt) from [<c08cc7dc>] (vc4_plane_mode_set+0x1374/0x13c4)
+[  284.315589]  r8:00000000 r7:00000000 r6:00001000 r5:c404c600 r4:c2e34600
+[  284.315596] [<c08cb468>] (vc4_plane_mode_set) from [<c08cc984>] (vc4_plane_atomic_check+0x40/0x1c0)
+[  284.315601]  r10:00000001 r9:c2e34600 r8:c0e67068 r7:c0fc44e0 r6:c2ce3640 r5:c3d636c0
+[  284.315605]  r4:c2e34600
+[  284.315614] [<c08cc944>] (vc4_plane_atomic_check) from [<c0860504>] (drm_atomic_helper_check_planes+0xec/0x1ec)
+[  284.315620]  r9:c2e34600 r8:c0e67068 r7:c0fc44e0 r6:c2ce3640 r5:c3d636c0 r4:00000006
+[  284.315627] [<c0860418>] (drm_atomic_helper_check_planes) from [<c0860658>] (drm_atomic_helper_check+0x54/0x9c)
+[  284.315633]  r9:c2e35400 r8:00000006 r7:00000000 r6:c2ba7800 r5:c3d636c0 r4:00000000
+[  284.315641] [<c0860604>] (drm_atomic_helper_check) from [<c08b7ca8>] (vc4_atomic_check+0x25c/0x454)
+[  284.315645]  r7:00000000 r6:c2ba7800 r5:00000001 r4:c3d636c0
+[  284.315652] [<c08b7a4c>] (vc4_atomic_check) from [<c0881278>] (drm_atomic_check_only+0x5cc/0x7e0)
+[  284.315658]  r10:c404c6c8 r9:ffffffff r8:c472c480 r7:00000003 r6:c3d636c0 r5:00000000
+[  284.315662]  r4:0000003c r3:c08b7a4c
+[  284.315670] [<c0880cac>] (drm_atomic_check_only) from [<c089ba60>] (drm_mode_atomic_ioctl+0x758/0xa7c)
+[  284.315675]  r10:c3d46000 r9:c3d636c0 r8:c2ce8a70 r7:027e3a54 r6:00000043 r5:c1fbb800
+[  284.315679]  r4:0281a858
+[  284.315688] [<c089b308>] (drm_mode_atomic_ioctl) from [<c086e9f8>] (drm_ioctl_kernel+0xc4/0x108)
+[  284.315693]  r10:c03864bc r9:c1fbb800 r8:c3d47e64 r7:c089b308 r6:00000002 r5:c2ba7800
+[  284.315697]  r4:00000000
+[  284.315705] [<c086e934>] (drm_ioctl_kernel) from [<c086ee28>] (drm_ioctl+0x1e8/0x3a0)
+[  284.315711]  r9:c1fbb800 r8:000000bc r7:c3d47e64 r6:00000038 r5:c0e59570 r4:00000038
+[  284.315719] [<c086ec40>] (drm_ioctl) from [<c041f354>] (sys_ioctl+0x35c/0x914)
+[  284.315724]  r10:c2d08200 r9:00000000 r8:c36fa300 r7:befdd870 r6:c03864bc r5:c36fa301
+[  284.315728]  r4:c03864bc
+[  284.315735] [<c041eff8>] (sys_ioctl) from [<c0200040>] (ret_fast_syscall+0x0/0x28)
+[  284.315739] Exception stack(0xc3d47fa8 to 0xc3d47ff0)
+[  284.315745] 7fa0:                   027eb750 befdd870 00000000 c03864bc befdd870 00000000
+[  284.315750] 7fc0: 027eb750 befdd870 c03864bc 00000036 027e3948 0281a640 0281a850 027e3a50
+[  284.315756] 7fe0: b4b64100 befdd844 b4b5ba2c b49c994c
+[  284.315762]  r10:00000036 r9:c3d46000 r8:c0200204 r7:00000036 r6:c03864bc r5:befdd870
+[  284.315765]  r4:027eb750
+
+Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5")
+Signed-off-by: Dom Cobley <popcornmix@gmail.com>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Tested-By: Lucas Nussbaum <lucas@debian.org>
+Tested-By: Ryutaroh Matsumoto <ryutaroh@ict.e.titech.ac.jp>
+Link: https://patchwork.freedesktop.org/patch/msgid/20210121105759.1262699-2-maxime@cerno.tech
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/vc4/vc4_plane.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_plane.c
++++ b/drivers/gpu/drm/vc4/vc4_plane.c
+@@ -917,9 +917,9 @@ static int vc4_plane_mode_set(struct drm
+               if (!vc4_state->is_unity) {
+                       vc4_dlist_write(vc4_state,
+                                       VC4_SET_FIELD(vc4_state->crtc_w,
+-                                                    SCALER_POS1_SCL_WIDTH) |
++                                                    SCALER5_POS1_SCL_WIDTH) |
+                                       VC4_SET_FIELD(vc4_state->crtc_h,
+-                                                    SCALER_POS1_SCL_HEIGHT));
++                                                    SCALER5_POS1_SCL_HEIGHT));
+               }
+               /* Position Word 2: Source Image Size */
diff --git a/queue-5.10/kvm-documentation-fix-spec-for-kvm_cap_enable_cap_vm.patch b/queue-5.10/kvm-documentation-fix-spec-for-kvm_cap_enable_cap_vm.patch
new file mode 100644 (file)
index 0000000..c04d33a
--- /dev/null
@@ -0,0 +1,34 @@
+From a10f373ad3c760dd40b41e2f69a800ee7b8da15e Mon Sep 17 00:00:00 2001
+From: Quentin Perret <qperret@google.com>
+Date: Fri, 8 Jan 2021 16:53:49 +0000
+Subject: KVM: Documentation: Fix spec for KVM_CAP_ENABLE_CAP_VM
+
+From: Quentin Perret <qperret@google.com>
+
+commit a10f373ad3c760dd40b41e2f69a800ee7b8da15e upstream.
+
+The documentation classifies KVM_ENABLE_CAP with KVM_CAP_ENABLE_CAP_VM
+as a vcpu ioctl, which is incorrect. Fix it by specifying it as a VM
+ioctl.
+
+Fixes: e5d83c74a580 ("kvm: make KVM_CAP_ENABLE_CAP_VM architecture agnostic")
+Signed-off-by: Quentin Perret <qperret@google.com>
+Message-Id: <20210108165349.747359-1-qperret@google.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/virt/kvm/api.rst |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Documentation/virt/kvm/api.rst
++++ b/Documentation/virt/kvm/api.rst
+@@ -1319,7 +1319,7 @@ documentation when it pops into existenc
+ :Capability: KVM_CAP_ENABLE_CAP_VM
+ :Architectures: all
+-:Type: vcpu ioctl
++:Type: vm ioctl
+ :Parameters: struct kvm_enable_cap (in)
+ :Returns: 0 on success; -1 on error
diff --git a/queue-5.10/net-mlx5e-fix-ipsec-stats.patch b/queue-5.10/net-mlx5e-fix-ipsec-stats.patch
new file mode 100644 (file)
index 0000000..f476430
--- /dev/null
@@ -0,0 +1,44 @@
+From 45c9a30835d84009dfe711f5c8836720767c286e Mon Sep 17 00:00:00 2001
+From: Maxim Mikityanskiy <maximmi@mellanox.com>
+Date: Wed, 25 Nov 2020 13:52:36 +0200
+Subject: net/mlx5e: Fix IPSEC stats
+
+From: Maxim Mikityanskiy <maximmi@mellanox.com>
+
+commit 45c9a30835d84009dfe711f5c8836720767c286e upstream.
+
+When IPSEC offload isn't active, the number of stats is not zero, but
+the strings are not filled, leading to exposing stats with empty names.
+Fix this by using the same condition for NUM_STATS and FILL_STRS.
+
+Fixes: 0aab3e1b04ae ("net/mlx5e: IPSec, Expose IPsec HW stat only for supporting HW")
+Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
+Reviewed-by: Raed Salem <raeds@nvidia.com>
+Reviewed-by: Tariq Toukan <tariqt@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_accel/ipsec_stats.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c
+@@ -76,7 +76,7 @@ static const struct counter_desc mlx5e_i
+ static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_sw)
+ {
+-      return NUM_IPSEC_SW_COUNTERS;
++      return priv->ipsec ? NUM_IPSEC_SW_COUNTERS : 0;
+ }
+ static inline MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_sw) {}
+@@ -105,7 +105,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_S
+ static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_hw)
+ {
+-      return (mlx5_fpga_ipsec_device_caps(priv->mdev)) ? NUM_IPSEC_HW_COUNTERS : 0;
++      return (priv->ipsec && mlx5_fpga_ipsec_device_caps(priv->mdev)) ? NUM_IPSEC_HW_COUNTERS : 0;
+ }
+ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_hw)
diff --git a/queue-5.10/netfilter-nft_dynset-add-timeout-extension-to-template.patch b/queue-5.10/netfilter-nft_dynset-add-timeout-extension-to-template.patch
new file mode 100644 (file)
index 0000000..f77f3d4
--- /dev/null
@@ -0,0 +1,37 @@
+From 0c5b7a501e7400869ee905b4f7af3d6717802bcb Mon Sep 17 00:00:00 2001
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+Date: Sat, 16 Jan 2021 19:20:15 +0100
+Subject: netfilter: nft_dynset: add timeout extension to template
+
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+
+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 <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -204,8 +204,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.10/revert-block-simplify-set_init_blocksize-to-regain-lost-performance.patch b/queue-5.10/revert-block-simplify-set_init_blocksize-to-regain-lost-performance.patch
new file mode 100644 (file)
index 0000000..2466ee3
--- /dev/null
@@ -0,0 +1,70 @@
+From 8dc932d3e8afb65e12eba7495f046c83884c49bf Mon Sep 17 00:00:00 2001
+From: Maxim Mikityanskiy <maxtram95@gmail.com>
+Date: Tue, 26 Jan 2021 21:59:07 +0200
+Subject: Revert "block: simplify set_init_blocksize" to regain lost performance
+
+From: Maxim Mikityanskiy <maxtram95@gmail.com>
+
+commit 8dc932d3e8afb65e12eba7495f046c83884c49bf upstream.
+
+The cited commit introduced a serious regression with SATA write speed,
+as found by bisecting. This patch reverts this commit, which restores
+write speed back to the values observed before this commit.
+
+The performance tests were done on a Helios4 NAS (2nd batch) with 4 HDDs
+(WD8003FFBX) using dd (bs=1M count=2000). "Direct" is a test with a
+single HDD, the rest are different RAID levels built over the first
+partitions of 4 HDDs. Test results are in MB/s, R is read, W is write.
+
+                | Direct | RAID0 | RAID10 f2 | RAID10 n2 | RAID6
+----------------+--------+-------+-----------+-----------+--------
+9011495c9466    | R:256  | R:313 | R:276     | R:313     | R:323
+(before faulty) | W:254  | W:253 | W:195     | W:204     | W:117
+----------------+--------+-------+-----------+-----------+--------
+5ff9f19231a0    | R:257  | R:398 | R:312     | R:344     | R:391
+(faulty commit) | W:154  | W:122 | W:67.7    | W:66.6    | W:67.2
+----------------+--------+-------+-----------+-----------+--------
+5.10.10         | R:256  | R:401 | R:312     | R:356     | R:375
+unpatched       | W:149  | W:123 | W:64      | W:64.1    | W:61.5
+----------------+--------+-------+-----------+-----------+--------
+5.10.10         | R:255  | R:396 | R:312     | R:340     | R:393
+patched         | W:247  | W:274 | W:220     | W:225     | W:121
+
+Applying this patch doesn't hurt read performance, while improves the
+write speed by 1.5x - 3.5x (more impact on RAID tests). The write speed
+is restored back to the state before the faulty commit, and even a bit
+higher in RAID tests (which aren't HDD-bound on this device) - that is
+likely related to other optimizations done between the faulty commit and
+5.10.10 which also improved the read speed.
+
+Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
+Fixes: 5ff9f19231a0 ("block: simplify set_init_blocksize")
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Jens Axboe <axboe@kernel.dk>
+Acked-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/block_dev.c |   10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/fs/block_dev.c
++++ b/fs/block_dev.c
+@@ -134,7 +134,15 @@ EXPORT_SYMBOL(truncate_bdev_range);
+ static void set_init_blocksize(struct block_device *bdev)
+ {
+-      bdev->bd_inode->i_blkbits = blksize_bits(bdev_logical_block_size(bdev));
++      unsigned int bsize = bdev_logical_block_size(bdev);
++      loff_t size = i_size_read(bdev->bd_inode);
++
++      while (bsize < PAGE_SIZE) {
++              if (size & bsize)
++                      break;
++              bsize <<= 1;
++      }
++      bdev->bd_inode->i_blkbits = blksize_bits(bsize);
+ }
+ int set_blocksize(struct block_device *bdev, int size)
diff --git a/queue-5.10/revert-rdma-mlx5-fix-devlink-deadlock-on-net-namespace-deletion.patch b/queue-5.10/revert-rdma-mlx5-fix-devlink-deadlock-on-net-namespace-deletion.patch
new file mode 100644 (file)
index 0000000..c0ffb67
--- /dev/null
@@ -0,0 +1,94 @@
+From de641d74fb00f5b32f054ee154e31fb037e0db88 Mon Sep 17 00:00:00 2001
+From: Parav Pandit <parav@nvidia.com>
+Date: Sun, 17 Jan 2021 11:26:33 +0200
+Subject: Revert "RDMA/mlx5: Fix devlink deadlock on net namespace deletion"
+
+From: Parav Pandit <parav@nvidia.com>
+
+commit de641d74fb00f5b32f054ee154e31fb037e0db88 upstream.
+
+This reverts commit fbdd0049d98d44914fc57d4b91f867f4996c787b.
+
+Due to commit in fixes tag, netdevice events were received only in one net
+namespace of mlx5_core_dev. Due to this when netdevice events arrive in
+net namespace other than net namespace of mlx5_core_dev, they are missed.
+
+This results in empty GID table due to RDMA device being detached from its
+net device.
+
+Hence, revert back to receive netdevice events in all net namespaces to
+restore back RDMA functionality in non init_net net namespace. The
+deadlock will have to be addressed in another patch.
+
+Fixes: fbdd0049d98d ("RDMA/mlx5: Fix devlink deadlock on net namespace deletion")
+Link: https://lore.kernel.org/r/20210117092633.10690-1-leon@kernel.org
+Signed-off-by: Parav Pandit <parav@nvidia.com>
+Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/infiniband/hw/mlx5/main.c                  |    6 ++----
+ drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h |    5 +++++
+ include/linux/mlx5/driver.h                        |   18 ------------------
+ 3 files changed, 7 insertions(+), 22 deletions(-)
+
+--- a/drivers/infiniband/hw/mlx5/main.c
++++ b/drivers/infiniband/hw/mlx5/main.c
+@@ -3305,8 +3305,7 @@ static int mlx5_add_netdev_notifier(stru
+       int err;
+       dev->port[port_num].roce.nb.notifier_call = mlx5_netdev_event;
+-      err = register_netdevice_notifier_net(mlx5_core_net(dev->mdev),
+-                                            &dev->port[port_num].roce.nb);
++      err = register_netdevice_notifier(&dev->port[port_num].roce.nb);
+       if (err) {
+               dev->port[port_num].roce.nb.notifier_call = NULL;
+               return err;
+@@ -3318,8 +3317,7 @@ static int mlx5_add_netdev_notifier(stru
+ static void mlx5_remove_netdev_notifier(struct mlx5_ib_dev *dev, u8 port_num)
+ {
+       if (dev->port[port_num].roce.nb.notifier_call) {
+-              unregister_netdevice_notifier_net(mlx5_core_net(dev->mdev),
+-                                                &dev->port[port_num].roce.nb);
++              unregister_netdevice_notifier(&dev->port[port_num].roce.nb);
+               dev->port[port_num].roce.nb.notifier_call = NULL;
+       }
+ }
+--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
++++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
+@@ -90,4 +90,9 @@ int mlx5_create_encryption_key(struct ml
+                              u32 key_type, u32 *p_key_id);
+ void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id);
++static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev)
++{
++      return devlink_net(priv_to_devlink(dev));
++}
++
+ #endif
+--- a/include/linux/mlx5/driver.h
++++ b/include/linux/mlx5/driver.h
+@@ -1213,22 +1213,4 @@ static inline bool mlx5_is_roce_enabled(
+       return val.vbool;
+ }
+-/**
+- * mlx5_core_net - Provide net namespace of the mlx5_core_dev
+- * @dev: mlx5 core device
+- *
+- * mlx5_core_net() returns the net namespace of mlx5 core device.
+- * This can be called only in below described limited context.
+- * (a) When a devlink instance for mlx5_core is registered and
+- *     when devlink reload operation is disabled.
+- *     or
+- * (b) during devlink reload reload_down() and reload_up callbacks
+- *     where it is ensured that devlink instance's net namespace is
+- *     stable.
+- */
+-static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev)
+-{
+-      return devlink_net(priv_to_devlink(dev));
+-}
+-
+ #endif /* MLX5_DRIVER_H */
index 7a04ad42f728e6376f618822d1f81bfd948e2fe7..67f04bcc0456cfcdd4ccf4fd9a84a52ec196c27c 100644 (file)
@@ -54,3 +54,24 @@ mt7601u-fix-rx-buffer-refcounting.patch
 iwlwifi-fix-iwl_subdevice_no_160-macro-to-use-the-correct-bit.patch
 drm-i915-gt-clear-cache_mode-prior-to-clearing-residuals.patch
 drm-i915-pmu-don-t-grab-wakeref-when-enabling-events.patch
+net-mlx5e-fix-ipsec-stats.patch
+arm-dts-imx6qdl-kontron-samx6i-fix-pwms-for-lcd-backlight.patch
+drm-nouveau-svm-fail-nouveau_svm_init-ioctl-on-unsupported-devices.patch
+drm-vc4-correct-lbm-size-and-calculation.patch
+drm-vc4-correct-pos1_scl-for-hvs5.patch
+drm-nouveau-dispnv50-restore-pushing-of-all-data.patch
+drm-i915-check-for-all-subplatform-bits.patch
+drm-i915-selftest-fix-potential-memory-leak.patch
+uapi-fix-big-endian-definition-of-ipv6_rpl_sr_hdr.patch
+kvm-documentation-fix-spec-for-kvm_cap_enable_cap_vm.patch
+tee-optee-replace-might_sleep-with-cond_resched.patch
+xen-blkfront-allow-discard-nodes-to-be-optional.patch
+blk-mq-test-queue_flag_hctx_active-for-sbitmap_shared-in-hctx_may_queue.patch
+clk-imx-fix-kconfig-warning-for-i.mx-scu-clk.patch
+clk-mmp2-fix-build-without-config_pm.patch
+clk-qcom-gcc-sm250-use-floor-ops-for-sdcc-clks.patch
+arm-imx-build-suspend-imx6.s-with-arm-instruction-set.patch
+arm-zimage-atags_to_fdt-fix-node-names-on-added-root-nodes.patch
+netfilter-nft_dynset-add-timeout-extension-to-template.patch
+revert-rdma-mlx5-fix-devlink-deadlock-on-net-namespace-deletion.patch
+revert-block-simplify-set_init_blocksize-to-regain-lost-performance.patch
diff --git a/queue-5.10/tee-optee-replace-might_sleep-with-cond_resched.patch b/queue-5.10/tee-optee-replace-might_sleep-with-cond_resched.patch
new file mode 100644 (file)
index 0000000..cf14299
--- /dev/null
@@ -0,0 +1,85 @@
+From dcb3b06d9c34f33a249f65c08805461fb0c4325b Mon Sep 17 00:00:00 2001
+From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+Date: Tue, 5 Jan 2021 11:28:44 +0100
+Subject: tee: optee: replace might_sleep with cond_resched
+
+From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+
+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] [<c011163c>] (unwind_backtrace) from [<c010b7f8>] (show_stack+0x10/0x14)
+  [  572.984080] [<c010b7f8>] (show_stack) from [<c0511e4c>] (dump_stack+0xc4/0xd8)
+  [  572.991300] [<c0511e4c>] (dump_stack) from [<c0519abc>] (nmi_cpu_backtrace+0x90/0xc4)
+  [  572.999130] [<c0519abc>] (nmi_cpu_backtrace) from [<c0519bdc>] (nmi_trigger_cpumask_backtrace+0xec/0x130)
+  [  573.008706] [<c0519bdc>] (nmi_trigger_cpumask_backtrace) from [<c01a5184>] (rcu_dump_cpu_stacks+0xe8/0x110)
+  [  573.018453] [<c01a5184>] (rcu_dump_cpu_stacks) from [<c01a4234>] (rcu_sched_clock_irq+0x7fc/0xa88)
+  [  573.027416] [<c01a4234>] (rcu_sched_clock_irq) from [<c01acdd0>] (update_process_times+0x30/0x8c)
+  [  573.036291] [<c01acdd0>] (update_process_times) from [<c01bfb90>] (tick_sched_timer+0x4c/0xa8)
+  [  573.044905] [<c01bfb90>] (tick_sched_timer) from [<c01adcc8>] (__hrtimer_run_queues+0x174/0x358)
+  [  573.053696] [<c01adcc8>] (__hrtimer_run_queues) from [<c01aea2c>] (hrtimer_interrupt+0x118/0x2bc)
+  [  573.062573] [<c01aea2c>] (hrtimer_interrupt) from [<c09ad664>] (arch_timer_handler_virt+0x28/0x30)
+  [  573.071536] [<c09ad664>] (arch_timer_handler_virt) from [<c0190f50>] (handle_percpu_devid_irq+0x8c/0x240)
+  [  573.081109] [<c0190f50>] (handle_percpu_devid_irq) from [<c018ab8c>] (generic_handle_irq+0x34/0x44)
+  [  573.090156] [<c018ab8c>] (generic_handle_irq) from [<c018b194>] (__handle_domain_irq+0x5c/0xb0)
+  [  573.098857] [<c018b194>] (__handle_domain_irq) from [<c052ac50>] (gic_handle_irq+0x4c/0x90)
+  [  573.107209] [<c052ac50>] (gic_handle_irq) from [<c0100b0c>] (__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] [<c0100b0c>] (__irq_svc) from [<c01151f0>] (__arm_smccc_smc+0x10/0x20)
+  [  573.151854] [<c01151f0>] (__arm_smccc_smc) from [<c09f3384>] (optee_smccc_smc+0x3c/0x44)
+  [  573.159948] [<c09f3384>] (optee_smccc_smc) from [<c09f4170>] (optee_do_call_with_arg+0xb8/0x154)
+  [  573.168735] [<c09f4170>] (optee_do_call_with_arg) from [<c09f4638>] (optee_invoke_func+0x110/0x190)
+  [  573.177786] [<c09f4638>] (optee_invoke_func) from [<c09f1ebc>] (tee_ioctl+0x10b8/0x11c0)
+  [  573.185879] [<c09f1ebc>] (tee_ioctl) from [<c029f62c>] (ksys_ioctl+0xe0/0xa4c)
+  [  573.193101] [<c029f62c>] (ksys_ioctl) from [<c0100060>] (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 <r.czerwinski@pengutronix.de>
+Tested-by: Sumit Garg <sumit.garg@linaro.org>
+[jw: added fixes tag + small adjustments in the code]
+Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 <linux/err.h>
+ #include <linux/errno.h>
+ #include <linux/mm.h>
++#include <linux/sched.h>
+ #include <linux/slab.h>
+ #include <linux/tee_drv.h>
+ #include <linux/types.h>
+@@ -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.10/uapi-fix-big-endian-definition-of-ipv6_rpl_sr_hdr.patch b/queue-5.10/uapi-fix-big-endian-definition-of-ipv6_rpl_sr_hdr.patch
new file mode 100644 (file)
index 0000000..9f5ec06
--- /dev/null
@@ -0,0 +1,47 @@
+From 07d46d93c9acdfe0614071d73c415dd5f745cc6e Mon Sep 17 00:00:00 2001
+From: Justin Iurman <justin.iurman@uliege.be>
+Date: Thu, 21 Jan 2021 23:00:44 +0100
+Subject: uapi: fix big endian definition of ipv6_rpl_sr_hdr
+
+From: Justin Iurman <justin.iurman@uliege.be>
+
+commit 07d46d93c9acdfe0614071d73c415dd5f745cc6e upstream.
+
+Following RFC 6554 [1], the current order of fields is wrong for big
+endian definition. Indeed, here is how the header looks like:
+
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+|  Next Header  |  Hdr Ext Len  | Routing Type  | Segments Left |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| CmprI | CmprE |  Pad  |               Reserved                |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+This patch reorders fields so that big endian definition is now correct.
+
+  [1] https://tools.ietf.org/html/rfc6554#section-3
+
+Fixes: cfa933d938d8 ("include: uapi: linux: add rpl sr header definition")
+Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/uapi/linux/rpl.h |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/include/uapi/linux/rpl.h
++++ b/include/uapi/linux/rpl.h
+@@ -28,10 +28,10 @@ struct ipv6_rpl_sr_hdr {
+               pad:4,
+               reserved1:16;
+ #elif defined(__BIG_ENDIAN_BITFIELD)
+-      __u32   reserved:20,
++      __u32   cmpri:4,
++              cmpre:4,
+               pad:4,
+-              cmpri:4,
+-              cmpre:4;
++              reserved:20;
+ #else
+ #error  "Please fix <asm/byteorder.h>"
+ #endif
diff --git a/queue-5.10/xen-blkfront-allow-discard-nodes-to-be-optional.patch b/queue-5.10/xen-blkfront-allow-discard-nodes-to-be-optional.patch
new file mode 100644 (file)
index 0000000..639dfa8
--- /dev/null
@@ -0,0 +1,77 @@
+From 0549cd67b01016b579047bce045b386202a8bcfc Mon Sep 17 00:00:00 2001
+From: Roger Pau Monne <roger.pau@citrix.com>
+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 <roger.pau@citrix.com>
+
+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 <arthurborsboom@gmail.com>
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+Reviewed-by: Juergen Gross <jgross@suse.com>
+Tested-By: Arthur Borsboom <arthurborsboom@gmail.com>
+Link: https://lore.kernel.org/r/20210119105727.95173-1-roger.pau@citrix.com
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -945,7 +945,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);
+@@ -2179,19 +2180,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);