From: Damon Ding <damon.ding@rock-chips.com>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>
Cc: hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
andrzej.hajda@intel.com, neil.armstrong@linaro.org,
rfoss@kernel.org, Laurent.pinchart@ideasonboard.com,
jonas@kwiboo.se, jernej.skrabec@gmail.com,
nicolas.frattaroli@collabora.com,
cristian.ciocaltea@collabora.com,
sebastian.reichel@collabora.com,
dmitry.baryshkov@oss.qualcomm.com, dianders@chromium.org,
m.szyprowski@samsung.com, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/4] drm/bridge: analogix_dp: Add validation for samsung,lane-count property
Date: Mon, 29 Jun 2026 09:53:02 +0800 [thread overview]
Message-ID: <cb533b04-e550-4eb4-8a8f-6d17c3d43a48@rock-chips.com> (raw)
In-Reply-To: <178249136513.1374898.11400378046460567437.b4-review@b4>
Hi Luca,
On 6/27/2026 12:29 AM, Luca Ceresoli wrote:
> On Thu, 04 Jun 2026 16:52:19 +0800, Damon Ding <damon.ding@rock-chips.com> wrote:
>
> Hello Damon,
>
>>
>> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
>> index 7a85774aaac1..e120ef3320c1 100644
>> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
>> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
>> @@ -1261,8 +1262,11 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
>> */
>> of_property_read_u32(dp_node, "samsung,link-rate",
>> &video_info->max_link_rate);
>> - of_property_read_u32(dp_node, "samsung,lane-count",
>> - &video_info->max_lane_count);
>> + ret = of_property_read_u32(dp_node, "samsung,lane-count",
>> + &video_info->max_lane_count);
>> + if (ret || !drm_dp_lane_count_is_valid(video_info->max_lane_count))
>> + return dev_err_probe(dp->dev, ret ? ret : -EINVAL,
>> + "failed to parse samsung,lane-count\n");
>
> I think this report by sashiko makes sense:
>
> > sashiko-bot@kernel.org <sashiko-bot@kernel.org>:
> >
> > [Severity: High]
> > Does this make the optional and deprecated samsung,lane-count property a
> > strict requirement?
> >
> > If samsung,lane-count is absent from the device tree, of_property_read_u32()
> > returns -EINVAL. This causes the condition to evaluate to true, aborting the
> > probe with an error.
> >
> > According to the device tree bindings
> > (Documentation/devicetree/bindings/display/samsung/samsung,exynos5-dp.yaml),
> > this property is marked as deprecated and explicitly optional because the
> > lane count can be read from the monitor. Does this patch break compatibility
> > with device trees that rightfully omit this deprecated property?
>
> (via: https://patch.msgid.link/20260604090935.7FC051F00898@smtp.kernel.org)
>
> Can you comment on this?
>
>
I was also confused about this handling at first. From commit
0d0abd894ead ("drm: bridge: analogix/dp: add max link rate and lane
count limit for RK3288"), its commit message does not explain why
samsung,lane-count was changed from a mandatory to optional property.
After digging into the code flow, I found that
analogix_dp_full_link_train() picks the smaller value between the
platform-supported lane count and the lane count retrieved from sink
DPCD for link training. If the samsung,lane-count property is
missing/invalid here, link training will end up using an unexpected lane
count configuration.
Additionally, I checked Samsung’s upstream device trees that utilize
this DP controller, and all of them carry the lane-count property. Based
on this observation, I believe restoring the strict mandatory
requirement for this property makes sense.
Should I create an independent fix patch to revert these two properties
to mandatory, instead of bundling the fix in this series?
Best regards,
Damon
next prev parent reply other threads:[~2026-06-29 3:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 8:52 [PATCH v5 0/4] Add eDP lane mapping support Damon Ding
2026-06-04 8:52 ` [PATCH v5 1/4] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint Damon Ding
2026-06-04 9:06 ` sashiko-bot
2026-06-04 18:43 ` Rob Herring
2026-06-04 8:52 ` [PATCH v5 2/4] drm/dp: Add helper to validate DP lane counts Damon Ding
2026-06-26 16:29 ` Luca Ceresoli
2026-06-04 8:52 ` [PATCH v5 3/4] drm/bridge: analogix_dp: Add validation for samsung,lane-count property Damon Ding
2026-06-04 9:09 ` sashiko-bot
2026-06-26 16:29 ` Luca Ceresoli
2026-06-29 1:53 ` Damon Ding [this message]
2026-06-04 8:52 ` [PATCH v5 4/4] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding
2026-06-04 9:04 ` sashiko-bot
2026-06-15 12:34 ` [PATCH v5 0/4] Add eDP lane mapping support Damon Ding
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=cb533b04-e550-4eb4-8a8f-6d17c3d43a48@rock-chips.com \
--to=damon.ding@rock-chips.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=andy.yan@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=cristian.ciocaltea@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=luca.ceresoli@bootlin.com \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=nicolas.frattaroli@collabora.com \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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