From: Sasha Levin Date: Mon, 13 Nov 2023 04:28:53 +0000 (-0500) Subject: Fixes for 5.10 X-Git-Tag: v4.14.330~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c3f298dadf1e48fa4c47199b84c9faa6d6b2742b;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.patch b/queue-5.10/drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.patch new file mode 100644 index 00000000000..9d7f1ac8a94 --- /dev/null +++ b/queue-5.10/drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.patch @@ -0,0 +1,66 @@ +From 296d6a8c116f9497f3cb028b1427f46c50580754 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 993898a2c7791..738e60139db90 100644 +--- a/drivers/gpu/drm/drm_syncobj.c ++++ b/drivers/gpu/drm/drm_syncobj.c +@@ -983,7 +983,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.10/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch b/queue-5.10/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch new file mode 100644 index 00000000000..2a5648ccd1f --- /dev/null +++ b/queue-5.10/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch @@ -0,0 +1,38 @@ +From 95d78e9f80557c98d8daa0a73be8017b01f0259e 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 a547c21c7e928..5d564e8670c52 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.10/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch b/queue-5.10/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch new file mode 100644 index 00000000000..0210fe46210 --- /dev/null +++ b/queue-5.10/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch @@ -0,0 +1,89 @@ +From 40caa5e2b778f83e1abae96e900ac9edeaa04c63 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.10/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch b/queue-5.10/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch new file mode 100644 index 00000000000..504da56a012 --- /dev/null +++ b/queue-5.10/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch @@ -0,0 +1,38 @@ +From 6aa0601371658655cd6e751c24ccc3a6af30b246 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.10/fbdev-omapfb-drop-unused-remove-function.patch b/queue-5.10/fbdev-omapfb-drop-unused-remove-function.patch new file mode 100644 index 00000000000..6a028362533 --- /dev/null +++ b/queue-5.10/fbdev-omapfb-drop-unused-remove-function.patch @@ -0,0 +1,54 @@ +From ce360ca006dbc0bf742a3c507c038315b350dcbe 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.10/series b/queue-5.10/series index 3c5cfb6b3b8..2ab9b969350 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -197,3 +197,10 @@ netfilter-nft_redir-use-struct-nf_nat_range2-through.patch netfilter-nat-fix-ipv6-nat-redirect-with-mapped-and-.patch x86-share-definition-of-__is_canonical_address.patch x86-sev-es-allow-copy_from_kernel_nofault-in-earlier.patch +drm-syncobj-fix-drm_syncobj_wait_flags_wait_availabl.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.10/spi-spi-zynq-qspi-add-spi-mem-to-driver-kconfig-depe.patch b/queue-5.10/spi-spi-zynq-qspi-add-spi-mem-to-driver-kconfig-depe.patch new file mode 100644 index 00000000000..20c2defbbe3 --- /dev/null +++ b/queue-5.10/spi-spi-zynq-qspi-add-spi-mem-to-driver-kconfig-depe.patch @@ -0,0 +1,37 @@ +From ef5ab912872a76dd0dc8446eb09ca57938703a46 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 4d98ce7571df0..5fd9b515f6f14 100644 +--- a/drivers/spi/Kconfig ++++ b/drivers/spi/Kconfig +@@ -949,6 +949,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.10/tracing-kprobes-fix-the-order-of-argument-descriptio.patch b/queue-5.10/tracing-kprobes-fix-the-order-of-argument-descriptio.patch new file mode 100644 index 00000000000..ca5e010c6ce --- /dev/null +++ b/queue-5.10/tracing-kprobes-fix-the-order-of-argument-descriptio.patch @@ -0,0 +1,45 @@ +From 70e6c240a7fd27e067a4ec286fbf07e30644dc80 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 37e1ec1d3ee54..7183572898998 100644 +--- a/kernel/trace/trace_kprobe.c ++++ b/kernel/trace/trace_kprobe.c +@@ -949,9 +949,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 +