From: Greg Kroah-Hartman Date: Mon, 9 Mar 2020 20:36:09 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.4.216~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90709aad7a14e6937926f1b484929a79901bae07;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: arm-dts-ls1021a-restore-mdio-compatible-to-gianfar.patch arm64-dts-meson-sm1-sei610-add-missing-interrupt-names.patch asoc-topology-fix-memleak-in-soc_tplg_link_elems_load.patch asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch drm-virtio-fix-resource-id-creation-race.patch drm-virtio-make-resource-id-workaround-runtime-switchable.patch spi-bcm63xx-hsspi-really-keep-pll-clk-enabled.patch --- diff --git a/queue-5.4/arm-dts-ls1021a-restore-mdio-compatible-to-gianfar.patch b/queue-5.4/arm-dts-ls1021a-restore-mdio-compatible-to-gianfar.patch new file mode 100644 index 00000000000..4dbdac8fa41 --- /dev/null +++ b/queue-5.4/arm-dts-ls1021a-restore-mdio-compatible-to-gianfar.patch @@ -0,0 +1,54 @@ +From 7155c44624d061692b4c13aa8343f119c67d4fc0 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Sun, 26 Jan 2020 21:49:50 +0200 +Subject: ARM: dts: ls1021a: Restore MDIO compatible to gianfar + +From: Vladimir Oltean + +commit 7155c44624d061692b4c13aa8343f119c67d4fc0 upstream. + +The difference between "fsl,etsec2-mdio" and "gianfar" has to do with +the .get_tbipa function, which calculates the address of the TBIPA +register automatically, if not explicitly specified. [ see +drivers/net/ethernet/freescale/fsl_pq_mdio.c ]. On LS1021A, the TBIPA +register is at offset 0x30 within the port register block, which is what +the "gianfar" method of calculating addresses actually does. + +Luckily, the bad "compatible" is inconsequential for ls1021a.dtsi, +because the TBIPA register is explicitly specified via the second "reg" +(<0x0 0x2d10030 0x0 0x4>), so the "get_tbipa" function is dead code. +Nonetheless it's good to restore it to its correct value. + +Background discussion: +https://www.spinics.net/lists/stable/msg361156.html + +Fixes: c7861adbe37f ("ARM: dts: ls1021: Fix SGMII PCS link remaining down after PHY disconnect") +Reported-by: Pavel Machek +Signed-off-by: Vladimir Oltean +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/ls1021a.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/ls1021a.dtsi ++++ b/arch/arm/boot/dts/ls1021a.dtsi +@@ -728,7 +728,7 @@ + }; + + mdio0: mdio@2d24000 { +- compatible = "fsl,etsec2-mdio"; ++ compatible = "gianfar"; + device_type = "mdio"; + #address-cells = <1>; + #size-cells = <0>; +@@ -737,7 +737,7 @@ + }; + + mdio1: mdio@2d64000 { +- compatible = "fsl,etsec2-mdio"; ++ compatible = "gianfar"; + device_type = "mdio"; + #address-cells = <1>; + #size-cells = <0>; diff --git a/queue-5.4/arm64-dts-meson-sm1-sei610-add-missing-interrupt-names.patch b/queue-5.4/arm64-dts-meson-sm1-sei610-add-missing-interrupt-names.patch new file mode 100644 index 00000000000..aa974937d02 --- /dev/null +++ b/queue-5.4/arm64-dts-meson-sm1-sei610-add-missing-interrupt-names.patch @@ -0,0 +1,33 @@ +From 5bea1336ed2c939328999c64de28792e8dc0699b Mon Sep 17 00:00:00 2001 +From: Guillaume La Roque +Date: Fri, 17 Jan 2020 14:34:23 +0100 +Subject: arm64: dts: meson-sm1-sei610: add missing interrupt-names + +From: Guillaume La Roque + +commit 5bea1336ed2c939328999c64de28792e8dc0699b upstream. + +add missing "host-wakeup interrupt names + +Fixes: 30388cc07572 ("arm64: dts: meson-sm1-sei610: add gpio bluetooth interrupt") + +Signed-off-by: Guillaume La Roque +Acked-by: Neil Armstrong +Link: https://lore.kernel.org/r/20200117133423.22602-1-glaroque@baylibre.com +Signed-off-by: Kevin Hilman +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +@@ -363,6 +363,7 @@ + compatible = "brcm,bcm43438-bt"; + interrupt-parent = <&gpio_intc>; + interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; ++ interrupt-names = "host-wakeup"; + shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; + max-speed = <2000000>; + clocks = <&wifi32k>; diff --git a/queue-5.4/asoc-topology-fix-memleak-in-soc_tplg_link_elems_load.patch b/queue-5.4/asoc-topology-fix-memleak-in-soc_tplg_link_elems_load.patch new file mode 100644 index 00000000000..ca84205017b --- /dev/null +++ b/queue-5.4/asoc-topology-fix-memleak-in-soc_tplg_link_elems_load.patch @@ -0,0 +1,39 @@ +From 2b2d5c4db732c027a14987cfccf767dac1b45170 Mon Sep 17 00:00:00 2001 +From: Dragos Tarcatu +Date: Fri, 7 Feb 2020 20:53:24 +0200 +Subject: ASoC: topology: Fix memleak in soc_tplg_link_elems_load() + +From: Dragos Tarcatu + +commit 2b2d5c4db732c027a14987cfccf767dac1b45170 upstream. + +If soc_tplg_link_config() fails, _link needs to be freed in case of +topology ABI version mismatch. However the current code is returning +directly and ends up leaking memory in this case. +This patch fixes that. + +Fixes: 593d9e52f9bb ("ASoC: topology: Add support to configure existing physical DAI links") +Signed-off-by: Dragos Tarcatu +Link: https://lore.kernel.org/r/20200207185325.22320-2-dragos_tarcatu@mentor.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/soc-topology.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/sound/soc/soc-topology.c ++++ b/sound/soc/soc-topology.c +@@ -2320,8 +2320,11 @@ static int soc_tplg_link_elems_load(stru + } + + ret = soc_tplg_link_config(tplg, _link); +- if (ret < 0) ++ if (ret < 0) { ++ if (!abi_match) ++ kfree(_link); + return ret; ++ } + + /* offset by version-specific struct size and + * real priv data size diff --git a/queue-5.4/asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch b/queue-5.4/asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch new file mode 100644 index 00000000000..9add8038aa9 --- /dev/null +++ b/queue-5.4/asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch @@ -0,0 +1,61 @@ +From 242c46c023610dbc0213fc8fb6b71eb836bc5d95 Mon Sep 17 00:00:00 2001 +From: Dragos Tarcatu +Date: Fri, 7 Feb 2020 20:53:25 +0200 +Subject: ASoC: topology: Fix memleak in soc_tplg_manifest_load() + +From: Dragos Tarcatu + +commit 242c46c023610dbc0213fc8fb6b71eb836bc5d95 upstream. + +In case of ABI version mismatch, _manifest needs to be freed as +it is just a copy of the original topology manifest. However, if +a driver manifest handler is defined, that would get executed and +the cleanup is never reached. Fix that by getting the return status +of manifest() instead of returning directly. + +Fixes: 583958fa2e52 ("ASoC: topology: Make manifest backward compatible from ABI v4") +Signed-off-by: Dragos Tarcatu +Link: https://lore.kernel.org/r/20200207185325.22320-3-dragos_tarcatu@mentor.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/soc-topology.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/sound/soc/soc-topology.c ++++ b/sound/soc/soc-topology.c +@@ -2488,7 +2488,7 @@ static int soc_tplg_manifest_load(struct + { + struct snd_soc_tplg_manifest *manifest, *_manifest; + bool abi_match; +- int err; ++ int ret = 0; + + if (tplg->pass != SOC_TPLG_PASS_MANIFEST) + return 0; +@@ -2501,19 +2501,19 @@ static int soc_tplg_manifest_load(struct + _manifest = manifest; + } else { + abi_match = false; +- err = manifest_new_ver(tplg, manifest, &_manifest); +- if (err < 0) +- return err; ++ ret = manifest_new_ver(tplg, manifest, &_manifest); ++ if (ret < 0) ++ return ret; + } + + /* pass control to component driver for optional further init */ + if (tplg->comp && tplg->ops && tplg->ops->manifest) +- return tplg->ops->manifest(tplg->comp, tplg->index, _manifest); ++ ret = tplg->ops->manifest(tplg->comp, tplg->index, _manifest); + + if (!abi_match) /* free the duplicated one */ + kfree(_manifest); + +- return 0; ++ return ret; + } + + /* validate header magic, size and type */ diff --git a/queue-5.4/drm-virtio-fix-resource-id-creation-race.patch b/queue-5.4/drm-virtio-fix-resource-id-creation-race.patch new file mode 100644 index 00000000000..057ed1b9774 --- /dev/null +++ b/queue-5.4/drm-virtio-fix-resource-id-creation-race.patch @@ -0,0 +1,38 @@ +From fbb30168c7395b9cfeb9e6f7b0c0bca854a6552d Mon Sep 17 00:00:00 2001 +From: John Bates +Date: Thu, 20 Feb 2020 14:53:19 -0800 +Subject: drm/virtio: fix resource id creation race + +From: John Bates + +commit fbb30168c7395b9cfeb9e6f7b0c0bca854a6552d upstream. + +The previous code was not thread safe and caused +undefined behavior from spurious duplicate resource IDs. +In this patch, an atomic_t is used instead. We no longer +see any duplicate IDs in tests with this change. + +Fixes: 16065fcdd19d ("drm/virtio: do NOT reuse resource ids") +Signed-off-by: John Bates +Reviewed-by: Chia-I Wu +Link: http://patchwork.freedesktop.org/patch/msgid/20200220225319.45621-1-jbates@chromium.org +Signed-off-by: Gerd Hoffmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/virtio/virtgpu_object.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/virtio/virtgpu_object.c ++++ b/drivers/gpu/drm/virtio/virtgpu_object.c +@@ -42,8 +42,8 @@ static int virtio_gpu_resource_id_get(st + * "f91a9dd35715 Fix unlinking resources from hash + * table." (Feb 2019) fixes the bug. + */ +- static int handle; +- handle++; ++ static atomic_t seqno = ATOMIC_INIT(0); ++ int handle = atomic_inc_return(&seqno); + *resid = handle + 1; + } else { + int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL); diff --git a/queue-5.4/drm-virtio-make-resource-id-workaround-runtime-switchable.patch b/queue-5.4/drm-virtio-make-resource-id-workaround-runtime-switchable.patch new file mode 100644 index 00000000000..37d7004f470 --- /dev/null +++ b/queue-5.4/drm-virtio-make-resource-id-workaround-runtime-switchable.patch @@ -0,0 +1,81 @@ +From 3e93bc2a58aa241081e043ef9e6e86c42808499a Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Thu, 22 Aug 2019 12:26:14 +0200 +Subject: drm/virtio: make resource id workaround runtime switchable. + +From: Gerd Hoffmann + +commit 3e93bc2a58aa241081e043ef9e6e86c42808499a upstream. + +Also update the comment with a reference to the virglrenderer fix. + +Signed-off-by: Gerd Hoffmann +Reviewed-by: Chia-I Wu +Link: http://patchwork.freedesktop.org/patch/msgid/20190822102614.18164-1-kraxel@redhat.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/virtio/virtgpu_object.c | 44 +++++++++++++++++--------------- + 1 file changed, 24 insertions(+), 20 deletions(-) + +--- a/drivers/gpu/drm/virtio/virtgpu_object.c ++++ b/drivers/gpu/drm/virtio/virtgpu_object.c +@@ -27,34 +27,38 @@ + + #include "virtgpu_drv.h" + ++static int virtio_gpu_virglrenderer_workaround = 1; ++module_param_named(virglhack, virtio_gpu_virglrenderer_workaround, int, 0400); ++ + static int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, + uint32_t *resid) + { +-#if 0 +- int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL); +- +- if (handle < 0) +- return handle; +-#else +- static int handle; +- +- /* +- * FIXME: dirty hack to avoid re-using IDs, virglrenderer +- * can't deal with that. Needs fixing in virglrenderer, also +- * should figure a better way to handle that in the guest. +- */ +- handle++; +-#endif +- +- *resid = handle + 1; ++ if (virtio_gpu_virglrenderer_workaround) { ++ /* ++ * Hack to avoid re-using resource IDs. ++ * ++ * virglrenderer versions up to (and including) 0.7.0 ++ * can't deal with that. virglrenderer commit ++ * "f91a9dd35715 Fix unlinking resources from hash ++ * table." (Feb 2019) fixes the bug. ++ */ ++ static int handle; ++ handle++; ++ *resid = handle + 1; ++ } else { ++ int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL); ++ if (handle < 0) ++ return handle; ++ *resid = handle + 1; ++ } + return 0; + } + + static void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id) + { +-#if 0 +- ida_free(&vgdev->resource_ida, id - 1); +-#endif ++ if (!virtio_gpu_virglrenderer_workaround) { ++ ida_free(&vgdev->resource_ida, id - 1); ++ } + } + + static void virtio_gpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) diff --git a/queue-5.4/series b/queue-5.4/series index 65d5ce0b437..b331a5449bc 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -110,3 +110,10 @@ dm-report-suspended-device-during-destroy.patch dm-writecache-verify-watermark-during-resume.patch dm-zoned-fix-reference-counter-initial-value-of-chunk-works.patch dm-fix-congested_fn-for-request-based-device.patch +arm64-dts-meson-sm1-sei610-add-missing-interrupt-names.patch +arm-dts-ls1021a-restore-mdio-compatible-to-gianfar.patch +spi-bcm63xx-hsspi-really-keep-pll-clk-enabled.patch +drm-virtio-make-resource-id-workaround-runtime-switchable.patch +drm-virtio-fix-resource-id-creation-race.patch +asoc-topology-fix-memleak-in-soc_tplg_link_elems_load.patch +asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch diff --git a/queue-5.4/spi-bcm63xx-hsspi-really-keep-pll-clk-enabled.patch b/queue-5.4/spi-bcm63xx-hsspi-really-keep-pll-clk-enabled.patch new file mode 100644 index 00000000000..8ea29be904c --- /dev/null +++ b/queue-5.4/spi-bcm63xx-hsspi-really-keep-pll-clk-enabled.patch @@ -0,0 +1,43 @@ +From 51bddd4501bc414b8b1e8f4d096b4a5304068169 Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Fri, 28 Feb 2020 22:38:38 +0100 +Subject: spi: bcm63xx-hsspi: Really keep pll clk enabled + +From: Christophe JAILLET + +commit 51bddd4501bc414b8b1e8f4d096b4a5304068169 upstream. + +The purpose of commit 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled") +was to keep the pll clk enabled through the lifetime of the device. + +In order to do that, some 'clk_prepare_enable()'/'clk_disable_unprepare()' +calls have been added in the error handling path of the probe function, in +the remove function and in the suspend and resume functions. + +However, a 'clk_disable_unprepare()' call has been unfortunately left in +the probe function. So the commit seems to be more or less a no-op. + +Axe it now, so that the pll clk is left enabled through the lifetime of +the device, as described in the commit. + +Fixes: 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled") +Signed-off-by: Christophe JAILLET +Acked-by: Jonas Gorski +Link: https://lore.kernel.org/r/20200228213838.7124-1-christophe.jaillet@wanadoo.fr +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-bcm63xx-hsspi.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/spi/spi-bcm63xx-hsspi.c ++++ b/drivers/spi/spi-bcm63xx-hsspi.c +@@ -367,7 +367,6 @@ static int bcm63xx_hsspi_probe(struct pl + goto out_disable_clk; + + rate = clk_get_rate(pll_clk); +- clk_disable_unprepare(pll_clk); + if (!rate) { + ret = -EINVAL; + goto out_disable_pll_clk;