linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Lypak <vladimir.lypak@gmail.com>
To: "Rob Clark" <robin.clark@oss.qualcomm.com>,
	"Dmitry Baryshkov" <lumag@kernel.org>,
	"Abhinav Kumar" <abhinav.kumar@linux.dev>,
	"Jessica Zhang" <jessica.zhang@oss.qualcomm.com>,
	"Sean Paul" <sean@poorly.run>,
	"Marijn Suijten" <marijn.suijten@somainline.org>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>,
	"Kalyan Thota" <quic_kalyant@quicinc.com>,
	"Vinod Polimera" <quic_vpolimer@quicinc.com>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Barnabás Czémán" <barnabas.czeman@mainlining.org>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Vladimir Lypak <vladimir.lypak@gmail.com>
Subject: [PATCH 2/6] drm/msm/dpu: Propagate error from dpu_assign_plane_resources
Date: Fri, 17 Oct 2025 19:58:36 +0000	[thread overview]
Message-ID: <20251017-b4-dpu-fixes-v1-2-40ce5993eeb6@gmail.com> (raw)
In-Reply-To: <20251017-b4-dpu-fixes-v1-0-40ce5993eeb6@gmail.com>

The dpu_plane_virtual_assign_resources function might fail if there is
no suitable SSPP(s) for the plane. This leaves sspp field in plane
state uninitialized and later leads to NULL dereference during commit:

Call trace:
 _dpu_crtc_blend_setup+0x194/0x620 [msm] (P)
 dpu_crtc_atomic_begin+0xe4/0x240 [msm]
 drm_atomic_helper_commit_planes+0x88/0x358
 msm_atomic_commit_tail+0x1b4/0x8b8 [msm]
 commit_tail+0xa8/0x1b0
 drm_atomic_helper_commit+0x180/0x1a0
 drm_atomic_commit+0x94/0xe0
 drm_mode_atomic_ioctl+0xa88/0xd60
 drm_ioctl_kernel+0xc4/0x138
 drm_ioctl+0x364/0x4f0
 __arm64_sys_ioctl+0xac/0x108
 invoke_syscall.constprop.0+0x48/0x100
 el0_svc_common.constprop.0+0x40/0xe8
 do_el0_svc+0x24/0x38
 el0_svc+0x30/0xe0
 el0t_64_sync_handler+0xa0/0xe8
 el0t_64_sync+0x198/0x1a0

Fixes: 3ed12a3664b3 ("drm/msm/dpu: allow sharing SSPP between planes")
Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index f54cf0faa1c7c8c00eb68b8b45ca2fc776f7f62f..d198a65a2c5fef5fbdebc9c383a4b08bc71b8bf3 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1278,7 +1278,7 @@ int dpu_assign_plane_resources(struct dpu_global_state *global_state,
 							     state, plane_state,
 							     prev_adjacent_plane_state);
 		if (ret)
-			break;
+			return ret;
 
 		prev_adjacent_plane_state = plane_state;
 	}

-- 
2.51.0


  parent reply	other threads:[~2025-10-17 20:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 19:58 [PATCH 0/6] drm/msm/dpu: Fixes for virtual planes and 1.x features Vladimir Lypak
2025-10-17 19:58 ` [PATCH 1/6] drm/msm/dpu: Fix allocation of RGB SSPPs without scaling Vladimir Lypak
2025-10-28 21:24   ` Dmitry Baryshkov
2025-10-17 19:58 ` Vladimir Lypak [this message]
2025-10-28 21:24   ` [PATCH 2/6] drm/msm/dpu: Propagate error from dpu_assign_plane_resources Dmitry Baryshkov
2025-10-17 19:58 ` [PATCH 3/6] drm/msm/dpu: Disable scaling for unsupported scaler types Vladimir Lypak
2025-10-28 21:25   ` Dmitry Baryshkov
2025-10-17 19:58 ` [PATCH 4/6] drm/msm/dpu: Fix pixel extension sub-sampling Vladimir Lypak
2025-10-28 21:26   ` Dmitry Baryshkov
2025-10-17 19:58 ` [PATCH 5/6] drm/msm/dpu: Require linear modifier for writeback framebuffers Vladimir Lypak
2025-10-28 21:26   ` Dmitry Baryshkov
2025-10-18 14:33 ` [PATCH 6/6] drm/msm/dpu: Disable broken YUV on QSEED2 hardware Vladimir Lypak
2025-10-28 21:27   ` Dmitry Baryshkov
2025-10-28 22:14   ` Dmitry Baryshkov
2025-10-29  0:30 ` [PATCH 0/6] drm/msm/dpu: Fixes for virtual planes and 1.x features Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251017-b4-dpu-fixes-v1-2-40ce5993eeb6@gmail.com \
    --to=vladimir.lypak@gmail.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=barnabas.czeman@mainlining.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_kalyant@quicinc.com \
    --cc=quic_vpolimer@quicinc.com \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).