--- /dev/null
+From 7381076809586528e2a812a709e2758916318a99 Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Wed, 11 May 2022 09:40:51 +0400
+Subject: drm/meson: Fix refcount leak in meson_encoder_hdmi_init
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit 7381076809586528e2a812a709e2758916318a99 upstream.
+
+of_find_device_by_node() takes reference, we should use put_device()
+to release it when not need anymore.
+Add missing put_device() in error path to avoid refcount
+leak.
+
+Fixes: 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
+Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20220511054052.51981-1-linmq006@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
++++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
+@@ -438,8 +438,10 @@ int meson_encoder_hdmi_init(struct meson
+ cec_fill_conn_info_from_drm(&conn_info, meson_encoder_hdmi->connector);
+
+ notifier = cec_notifier_conn_register(&pdev->dev, NULL, &conn_info);
+- if (!notifier)
++ if (!notifier) {
++ put_device(&pdev->dev);
+ return -ENOMEM;
++ }
+
+ meson_encoder_hdmi->cec_notifier = notifier;
+ }
--- /dev/null
+From 9225b337072a10bf9b09df8bf281437488dd8a26 Mon Sep 17 00:00:00 2001
+From: Rob Clark <robdclark@chromium.org>
+Date: Fri, 4 Mar 2022 12:21:45 -0800
+Subject: drm/msm: Fix dirtyfb refcounting
+
+From: Rob Clark <robdclark@chromium.org>
+
+commit 9225b337072a10bf9b09df8bf281437488dd8a26 upstream.
+
+refcount_t complains about 0->1 transitions, which isn't *quite* what we
+wanted. So use dirtyfb==1 to mean that the fb is not connected to any
+output that requires dirtyfb flushing, so that we can keep the underflow
+and overflow checking.
+
+Fixes: 9e4dde28e9cd ("drm/msm: Avoid dirtyfb stalls on video mode displays (v2)")
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Link: https://lore.kernel.org/r/20220304202146.845566-1-robdclark@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/msm/msm_fb.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/msm/msm_fb.c
++++ b/drivers/gpu/drm/msm/msm_fb.c
+@@ -37,7 +37,7 @@ static int msm_framebuffer_dirtyfb(struc
+ /* If this fb is not used on any display requiring pixel data to be
+ * flushed, then skip dirtyfb
+ */
+- if (refcount_read(&msm_fb->dirtyfb) == 0)
++ if (refcount_read(&msm_fb->dirtyfb) == 1)
+ return 0;
+
+ return drm_atomic_helper_dirtyfb(fb, file_priv, flags, color,
+@@ -221,6 +221,8 @@ static struct drm_framebuffer *msm_frame
+ goto fail;
+ }
+
++ refcount_set(&msm_fb->dirtyfb, 1);
++
+ drm_dbg_state(dev, "create: FB ID: %d (%p)", fb->base.id, fb);
+
+ return fb;
drm-bridge-tc358767-fix-e-dp-bridge-endpoint-parsing-in-dedicated-function.patch
net-phy-smsc-disable-energy-detect-power-down-in-interrupt-mode.patch
drm-vc4-change-vc4_dma_range_matches-from-a-global-to-static.patch
+tracing-perf-avoid-warray-bounds-warning-for-__rel_loc-macro.patch
+drm-msm-fix-dirtyfb-refcounting.patch
+drm-meson-fix-refcount-leak-in-meson_encoder_hdmi_init.patch
--- /dev/null
+From c6d777acdf8f62d4ebaef0e5c6cd8fedbd6e8546 Mon Sep 17 00:00:00 2001
+From: Kees Cook <keescook@chromium.org>
+Date: Tue, 25 Jan 2022 14:00:37 -0800
+Subject: tracing/perf: Avoid -Warray-bounds warning for __rel_loc macro
+
+From: Kees Cook <keescook@chromium.org>
+
+commit c6d777acdf8f62d4ebaef0e5c6cd8fedbd6e8546 upstream.
+
+As done for trace_events.h, also fix the __rel_loc macro in perf.h,
+which silences the -Warray-bounds warning:
+
+In file included from ./include/linux/string.h:253,
+ from ./include/linux/bitmap.h:11,
+ from ./include/linux/cpumask.h:12,
+ from ./include/linux/mm_types_task.h:14,
+ from ./include/linux/mm_types.h:5,
+ from ./include/linux/buildid.h:5,
+ from ./include/linux/module.h:14,
+ from samples/trace_events/trace-events-sample.c:2:
+In function '__fortify_strcpy',
+ inlined from 'perf_trace_foo_rel_loc' at samples/trace_events/./trace-events-sample.h:519:1:
+./include/linux/fortify-string.h:47:33: warning: '__builtin_strcpy' offset 12 is out of the bounds [
+0, 4] [-Warray-bounds]
+ 47 | #define __underlying_strcpy __builtin_strcpy
+ | ^
+./include/linux/fortify-string.h:445:24: note: in expansion of macro '__underlying_strcpy'
+ 445 | return __underlying_strcpy(p, q);
+ | ^~~~~~~~~~~~~~~~~~~
+
+Also make __data struct member a proper flexible array to avoid future
+problems.
+
+Link: https://lkml.kernel.org/r/20220125220037.2738923-1-keescook@chromium.org
+
+Cc: Steven Rostedt <rostedt@goodmis.org>
+Cc: Masami Hiramatsu <mhiramat@kernel.org>
+Fixes: 55de2c0b5610c ("tracing: Add '__rel_loc' using trace event macros")
+Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/trace/perf.h | 5 +++--
+ include/trace/trace_events.h | 2 +-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+--- a/include/trace/perf.h
++++ b/include/trace/perf.h
+@@ -23,8 +23,9 @@
+
+ #undef __get_rel_dynamic_array
+ #define __get_rel_dynamic_array(field) \
+- ((void *)(&__entry->__rel_loc_##field) + \
+- sizeof(__entry->__rel_loc_##field) + \
++ ((void *)__entry + \
++ offsetof(typeof(*__entry), __rel_loc_##field) + \
++ sizeof(__entry->__rel_loc_##field) + \
+ (__entry->__rel_loc_##field & 0xffff))
+
+ #undef __get_rel_dynamic_array_len
+--- a/include/trace/trace_events.h
++++ b/include/trace/trace_events.h
+@@ -128,7 +128,7 @@ TRACE_MAKE_SYSTEM_STR();
+ struct trace_event_raw_##name { \
+ struct trace_entry ent; \
+ tstruct \
+- char __data[0]; \
++ char __data[]; \
+ }; \
+ \
+ static struct trace_event_class event_class_##name;