From: Sasha Levin Date: Mon, 13 Nov 2023 04:28:52 +0000 (-0500) Subject: Fixes for 5.15 X-Git-Tag: v4.14.330~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1510a4b8ad623190764c08f780dc2e381e4e4f61;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/asoc-hdmi-codec-register-hpd-callback-on-component-p.patch b/queue-5.15/asoc-hdmi-codec-register-hpd-callback-on-component-p.patch new file mode 100644 index 00000000000..183b058c152 --- /dev/null +++ b/queue-5.15/asoc-hdmi-codec-register-hpd-callback-on-component-p.patch @@ -0,0 +1,85 @@ +From 967b91a3323ae0dd3da9a513b5069c7dfecff49a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 6 Nov 2023 11:40:11 +0100 +Subject: ASoC: hdmi-codec: register hpd callback on component probe + +From: Jerome Brunet + +[ Upstream commit 15be353d55f9e12e34f9a819f51eb41fdef5eda8 ] + +The HDMI hotplug callback to the hdmi-codec is currently registered when +jack is set. + +The hotplug not only serves to report the ASoC jack state but also to get +the ELD. It should be registered when the component probes instead, so it +does not depend on the card driver registering a jack for the HDMI to +properly report the ELD. + +Fixes: 25ce4f2b3593 ("ASoC: hdmi-codec: Get ELD in before reporting plugged event") +Signed-off-by: Jerome Brunet +Link: https://lore.kernel.org/r/20231106104013.704356-1-jbrunet@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/hdmi-codec.c | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c +index b07607a9ecea4..0a7e2f8ca71af 100644 +--- a/sound/soc/codecs/hdmi-codec.c ++++ b/sound/soc/codecs/hdmi-codec.c +@@ -870,18 +870,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component, + void *data) + { + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); +- int ret = -ENOTSUPP; + + if (hcp->hcd.ops->hook_plugged_cb) { + hcp->jack = jack; +- ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, +- hcp->hcd.data, +- plugged_cb, +- component->dev); +- if (ret) +- hcp->jack = NULL; ++ return 0; + } +- return ret; ++ ++ return -ENOTSUPP; + } + + static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) +@@ -965,6 +960,21 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component, + return ret; + } + ++static int hdmi_probe(struct snd_soc_component *component) ++{ ++ struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); ++ int ret = 0; ++ ++ if (hcp->hcd.ops->hook_plugged_cb) { ++ ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, ++ hcp->hcd.data, ++ plugged_cb, ++ component->dev); ++ } ++ ++ return ret; ++} ++ + static void hdmi_remove(struct snd_soc_component *component) + { + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); +@@ -975,6 +985,7 @@ static void hdmi_remove(struct snd_soc_component *component) + } + + static const struct snd_soc_component_driver hdmi_driver = { ++ .probe = hdmi_probe, + .remove = hdmi_remove, + .dapm_widgets = hdmi_widgets, + .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), +-- +2.42.0 + diff --git a/queue-5.15/drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.patch b/queue-5.15/drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.patch new file mode 100644 index 00000000000..1c3ac1f4238 --- /dev/null +++ b/queue-5.15/drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.patch @@ -0,0 +1,66 @@ +From 51d1f0dfff5dfd8ecd18b2c9415e282457367a0a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Aug 2023 09:26:05 -0700 +Subject: drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE + +From: Erik Kurzinger + +[ Upstream commit 101c9f637efa1655f55876644d4439e552267527 ] + +If DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT is invoked with the +DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE flag set but no fence has yet been +submitted for the given timeline point the call will fail immediately +with EINVAL. This does not match the intended behavior where the call +should wait until the fence has been submitted (or the timeout expires). + +The following small example program illustrates the issue. It should +wait for 5 seconds and then print ETIME, but instead it terminates right +away after printing EINVAL. + + #include + #include + #include + #include + #include + int main(void) + { + int fd = open("/dev/dri/card0", O_RDWR); + uint32_t syncobj; + drmSyncobjCreate(fd, 0, &syncobj); + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + uint64_t point = 1; + if (drmSyncobjTimelineWait(fd, &syncobj, &point, 1, + ts.tv_sec * 1000000000 + ts.tv_nsec + 5000000000, // 5s + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE, NULL)) { + printf("drmSyncobjTimelineWait failed %d\n", errno); + } + } + +Fixes: 01d6c3578379 ("drm/syncobj: add support for timeline point wait v8") +Signed-off-by: Erik Kurzinger +Reviewed by: Simon Ser +Signed-off-by: Simon Ser +Link: https://patchwork.freedesktop.org/patch/msgid/1fac96f1-2f3f-f9f9-4eb0-340f27a8f6c0@nvidia.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_syncobj.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c +index 7e48dcd1bee4d..c26f916996352 100644 +--- a/drivers/gpu/drm/drm_syncobj.c ++++ b/drivers/gpu/drm/drm_syncobj.c +@@ -1056,7 +1056,8 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, + fence = drm_syncobj_fence_get(syncobjs[i]); + if (!fence || dma_fence_chain_find_seqno(&fence, points[i])) { + dma_fence_put(fence); +- if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) { ++ if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT | ++ DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE)) { + continue; + } else { + timeout = -EINVAL; +-- +2.42.0 + diff --git a/queue-5.15/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch b/queue-5.15/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch new file mode 100644 index 00000000000..3ee00de7035 --- /dev/null +++ b/queue-5.15/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch @@ -0,0 +1,38 @@ +From b95466a8a687da1f95c8815123fca4c69274fe92 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 8 Nov 2023 13:58:42 +0100 +Subject: fbdev: fsl-diu-fb: mark wr_reg_wa() static + +From: Arnd Bergmann + +[ Upstream commit a5035c81847430dfa3482807b07325f29e9e8c09 ] + +wr_reg_wa() is not an appropriate name for a global function, and doesn't need +to be global anyway, so mark it static and avoid the warning: + +drivers/video/fbdev/fsl-diu-fb.c:493:6: error: no previous prototype for 'wr_reg_wa' [-Werror=missing-prototypes] + +Fixes: 0d9dab39fbbe ("powerpc/5121: fsl-diu-fb: fix issue with re-enabling DIU area descriptor") +Signed-off-by: Arnd Bergmann +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/fsl-diu-fb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c +index e332017c6af62..ce3c5b0b8f4ef 100644 +--- a/drivers/video/fbdev/fsl-diu-fb.c ++++ b/drivers/video/fbdev/fsl-diu-fb.c +@@ -490,7 +490,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s) + * Workaround for failed writing desc register of planes. + * Needed with MPC5121 DIU rev 2.0 silicon. + */ +-void wr_reg_wa(u32 *reg, u32 val) ++static void wr_reg_wa(u32 *reg, u32 val) + { + do { + out_be32(reg, val); +-- +2.42.0 + diff --git a/queue-5.15/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch b/queue-5.15/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch new file mode 100644 index 00000000000..b73d7d1b7c5 --- /dev/null +++ b/queue-5.15/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch @@ -0,0 +1,89 @@ +From bde5b2739ea250d786b7f660c15d832e5bbb0ccd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Oct 2023 15:05:44 +0300 +Subject: fbdev: imsttfb: fix a resource leak in probe + +From: Dan Carpenter + +[ Upstream commit aba6ab57a910ad4b940c2024d15f2cdbf5b7f76b ] + +I've re-written the error handling but the bug is that if init_imstt() +fails we need to call iounmap(par->cmap_regs). + +Fixes: c75f5a550610 ("fbdev: imsttfb: Fix use after free bug in imsttfb_probe") +Signed-off-by: Dan Carpenter +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/imsttfb.c | 29 ++++++++++++++++------------- + 1 file changed, 16 insertions(+), 13 deletions(-) + +diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c +index 876ddf05e133a..e559c844436bd 100644 +--- a/drivers/video/fbdev/imsttfb.c ++++ b/drivers/video/fbdev/imsttfb.c +@@ -1489,8 +1489,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + + if (!request_mem_region(addr, size, "imsttfb")) { + printk(KERN_ERR "imsttfb: Can't reserve memory region\n"); +- framebuffer_release(info); +- return -ENODEV; ++ ret = -ENODEV; ++ goto release_info; + } + + switch (pdev->device) { +@@ -1507,36 +1507,39 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + printk(KERN_INFO "imsttfb: Device 0x%x unknown, " + "contact maintainer.\n", pdev->device); + ret = -ENODEV; +- goto error; ++ goto release_mem_region; + } + + info->fix.smem_start = addr; + info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ? + 0x400000 : 0x800000); + if (!info->screen_base) +- goto error; ++ goto release_mem_region; + info->fix.mmio_start = addr + 0x800000; + par->dc_regs = ioremap(addr + 0x800000, 0x1000); + if (!par->dc_regs) +- goto error; ++ goto unmap_screen_base; + par->cmap_regs_phys = addr + 0x840000; + par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000); + if (!par->cmap_regs) +- goto error; ++ goto unmap_dc_regs; + info->pseudo_palette = par->palette; + ret = init_imstt(info); + if (ret) +- goto error; ++ goto unmap_cmap_regs; + + pci_set_drvdata(pdev, info); +- return ret; ++ return 0; + +-error: +- if (par->dc_regs) +- iounmap(par->dc_regs); +- if (info->screen_base) +- iounmap(info->screen_base); ++unmap_cmap_regs: ++ iounmap(par->cmap_regs); ++unmap_dc_regs: ++ iounmap(par->dc_regs); ++unmap_screen_base: ++ iounmap(info->screen_base); ++release_mem_region: + release_mem_region(addr, size); ++release_info: + framebuffer_release(info); + return ret; + } +-- +2.42.0 + diff --git a/queue-5.15/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch b/queue-5.15/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch new file mode 100644 index 00000000000..c6a38137076 --- /dev/null +++ b/queue-5.15/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch @@ -0,0 +1,38 @@ +From e9f4b021dd2160fb5c655af7f47d62e013ee507f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 27 May 2023 11:37:29 +0200 +Subject: fbdev: imsttfb: Fix error path of imsttfb_probe() + +From: Helge Deller + +[ Upstream commit 518ecb6a209f6ff678aeadf9f2bf870c0982ca85 ] + +Release ressources when init_imstt() returns failure. + +Signed-off-by: Helge Deller +Stable-dep-of: aba6ab57a910 ("fbdev: imsttfb: fix a resource leak in probe") +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/imsttfb.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c +index 1b2fb8ed76237..876ddf05e133a 100644 +--- a/drivers/video/fbdev/imsttfb.c ++++ b/drivers/video/fbdev/imsttfb.c +@@ -1525,8 +1525,10 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + goto error; + info->pseudo_palette = par->palette; + ret = init_imstt(info); +- if (!ret) +- pci_set_drvdata(pdev, info); ++ if (ret) ++ goto error; ++ ++ pci_set_drvdata(pdev, info); + return ret; + + error: +-- +2.42.0 + diff --git a/queue-5.15/fbdev-omapfb-drop-unused-remove-function.patch b/queue-5.15/fbdev-omapfb-drop-unused-remove-function.patch new file mode 100644 index 00000000000..cc8a75d948a --- /dev/null +++ b/queue-5.15/fbdev-omapfb-drop-unused-remove-function.patch @@ -0,0 +1,54 @@ +From 1ed043c5b67c52ed8dadf61ef38c6710f0b15feb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 3 Nov 2023 18:35:58 +0100 +Subject: fbdev: omapfb: Drop unused remove function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit fc6699d62f5f4facc3e934efd25892fc36050b70 ] + +OMAP2_VRFB is a bool, so the vrfb driver can never be compiled as a +module. With that __exit_p(vrfb_remove) always evaluates to NULL and +vrfb_remove() is unused. + +If the driver was compilable as a module, it would fail to build because +the type of vrfb_remove() isn't compatible with struct +platform_driver::remove(). (The former returns void, the latter int.) + +Fixes: aa1e49a3752f ("OMAPDSS: VRFB: add omap_vrfb_supported()") +Signed-off-by: Uwe Kleine-König +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/omap2/omapfb/vrfb.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/drivers/video/fbdev/omap2/omapfb/vrfb.c b/drivers/video/fbdev/omap2/omapfb/vrfb.c +index ee0dd4c6a6466..568e6e1eca628 100644 +--- a/drivers/video/fbdev/omap2/omapfb/vrfb.c ++++ b/drivers/video/fbdev/omap2/omapfb/vrfb.c +@@ -368,17 +368,10 @@ static int __init vrfb_probe(struct platform_device *pdev) + return 0; + } + +-static void __exit vrfb_remove(struct platform_device *pdev) +-{ +- vrfb_loaded = false; +-} +- + static struct platform_driver vrfb_driver = { + .driver.name = "omapvrfb", +- .remove = __exit_p(vrfb_remove), + }; +- +-module_platform_driver_probe(vrfb_driver, vrfb_probe); ++builtin_platform_driver_probe(vrfb_driver, vrfb_probe); + + MODULE_AUTHOR("Tomi Valkeinen "); + MODULE_DESCRIPTION("OMAP VRFB"); +-- +2.42.0 + diff --git a/queue-5.15/series b/queue-5.15/series index ab90ac51c75..54eb6538d0c 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -256,3 +256,11 @@ i2c-iproc-handle-invalid-slave-state.patch netfilter-xt_recent-fix-increase-ipv6-literal-buffer.patch netfilter-nft_redir-use-struct-nf_nat_range2-through.patch netfilter-nat-fix-ipv6-nat-redirect-with-mapped-and-.patch +drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.patch +asoc-hdmi-codec-register-hpd-callback-on-component-p.patch +spi-spi-zynq-qspi-add-spi-mem-to-driver-kconfig-depe.patch +fbdev-omapfb-drop-unused-remove-function.patch +fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch +fbdev-imsttfb-fix-a-resource-leak-in-probe.patch +fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch +tracing-kprobes-fix-the-order-of-argument-descriptio.patch diff --git a/queue-5.15/spi-spi-zynq-qspi-add-spi-mem-to-driver-kconfig-depe.patch b/queue-5.15/spi-spi-zynq-qspi-add-spi-mem-to-driver-kconfig-depe.patch new file mode 100644 index 00000000000..e2b77b73e5b --- /dev/null +++ b/queue-5.15/spi-spi-zynq-qspi-add-spi-mem-to-driver-kconfig-depe.patch @@ -0,0 +1,37 @@ +From 4d7c921745eb93eeb44b2fbaba0961947fd4557f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 4 Nov 2023 00:13:51 +0530 +Subject: spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies + +From: Amit Kumar Mahapatra + +[ Upstream commit c2ded280a4b1b7bd93e53670528504be08d24967 ] + +Zynq QSPI driver has been converted to use spi-mem framework so +add spi-mem to driver kconfig dependencies. + +Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller") +Signed-off-by: Amit Kumar Mahapatra +Signed-off-by: Radhey Shyam Pandey +Link: https://lore.kernel.org/r/1699037031-702858-1-git-send-email-radhey.shyam.pandey@amd.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig +index 4fc23236d3bd2..123689e457d12 100644 +--- a/drivers/spi/Kconfig ++++ b/drivers/spi/Kconfig +@@ -976,6 +976,7 @@ config SPI_XTENSA_XTFPGA + config SPI_ZYNQ_QSPI + tristate "Xilinx Zynq QSPI controller" + depends on ARCH_ZYNQ || COMPILE_TEST ++ depends on SPI_MEM + help + This enables support for the Zynq Quad SPI controller + in master mode. +-- +2.42.0 + diff --git a/queue-5.15/tracing-kprobes-fix-the-order-of-argument-descriptio.patch b/queue-5.15/tracing-kprobes-fix-the-order-of-argument-descriptio.patch new file mode 100644 index 00000000000..776630d09c4 --- /dev/null +++ b/queue-5.15/tracing-kprobes-fix-the-order-of-argument-descriptio.patch @@ -0,0 +1,45 @@ +From 6d9b215e680ece8f10767fd80bfe0066e1f1b4fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 31 Oct 2023 12:13:05 +0800 +Subject: tracing/kprobes: Fix the order of argument descriptions + +From: Yujie Liu + +[ Upstream commit f032c53bea6d2057c14553832d846be2f151cfb2 ] + +The order of descriptions should be consistent with the argument list of +the function, so "kretprobe" should be the second one. + +int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe, + const char *name, const char *loc, ...) + +Link: https://lore.kernel.org/all/20231031041305.3363712-1-yujie.liu@intel.com/ + +Fixes: 2a588dd1d5d6 ("tracing: Add kprobe event command generation functions") +Suggested-by: Mukesh Ojha +Signed-off-by: Yujie Liu +Reviewed-by: Mukesh Ojha +Signed-off-by: Masami Hiramatsu (Google) +Signed-off-by: Sasha Levin +--- + kernel/trace/trace_kprobe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c +index a015ed3f823b7..0b3ee4eea51bf 100644 +--- a/kernel/trace/trace_kprobe.c ++++ b/kernel/trace/trace_kprobe.c +@@ -942,9 +942,9 @@ EXPORT_SYMBOL_GPL(kprobe_event_cmd_init); + /** + * __kprobe_event_gen_cmd_start - Generate a kprobe event command from arg list + * @cmd: A pointer to the dynevent_cmd struct representing the new event ++ * @kretprobe: Is this a return probe? + * @name: The name of the kprobe event + * @loc: The location of the kprobe event +- * @kretprobe: Is this a return probe? + * @...: Variable number of arg (pairs), one pair for each field + * + * NOTE: Users normally won't want to call this function directly, but +-- +2.42.0 +