This is a note to let you know that I've just added the patch titled drm/mxsfb: Disable overlay plane in mxsfb_plane_overlay_atomic_disable() to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-mxsfb-disable-overlay-plane-in-mxsfb_plane_overlay_atomic_disable.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From aa656d48e871a1b062e1bbf9474d8b831c35074c Mon Sep 17 00:00:00 2001 From: Liu Ying <victor.liu@xxxxxxx> Date: Mon, 12 Jun 2023 17:23:59 +0800 Subject: drm/mxsfb: Disable overlay plane in mxsfb_plane_overlay_atomic_disable() From: Liu Ying <victor.liu@xxxxxxx> commit aa656d48e871a1b062e1bbf9474d8b831c35074c upstream. When disabling overlay plane in mxsfb_plane_overlay_atomic_update(), overlay plane's framebuffer pointer is NULL. So, dereferencing it would cause a kernel Oops(NULL pointer dereferencing). Fix the issue by disabling overlay plane in mxsfb_plane_overlay_atomic_disable() instead. Fixes: cb285a5348e7 ("drm: mxsfb: Replace mxsfb_get_fb_paddr() with drm_fb_cma_get_gem_addr()") Cc: stable@xxxxxxxxxxxxxxx # 5.19+ Signed-off-by: Liu Ying <victor.liu@xxxxxxx> Reviewed-by: Marek Vasut <marex@xxxxxxx> Signed-off-by: Marek Vasut <marex@xxxxxxx> Link: https://patchwork.freedesktop.org/patch/msgid/20230612092359.784115-1-victor.liu@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -611,6 +611,14 @@ static void mxsfb_plane_overlay_atomic_u writel(ctrl, mxsfb->base + LCDC_AS_CTRL); } +static void mxsfb_plane_overlay_atomic_disable(struct drm_plane *plane, + struct drm_atomic_state *state) +{ + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); + + writel(0, mxsfb->base + LCDC_AS_CTRL); +} + static bool mxsfb_format_mod_supported(struct drm_plane *plane, uint32_t format, uint64_t modifier) @@ -626,6 +634,7 @@ static const struct drm_plane_helper_fun static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs = { .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_overlay_atomic_update, + .atomic_disable = mxsfb_plane_overlay_atomic_disable, }; static const struct drm_plane_funcs mxsfb_plane_funcs = { Patches currently in stable-queue which might be from victor.liu@xxxxxxx are queue-6.5/drm-mxsfb-disable-overlay-plane-in-mxsfb_plane_overlay_atomic_disable.patch queue-6.5/backlight-gpio_backlight-drop-output-gpio-direction-.patch