From: sashiko-bot@kernel.org
To: "Chaoyi Chen" <kernel@airkyi.com>
Cc: dri-devel@lists.freedesktop.org, linux-phy@lists.infradead.org,
vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v8 6/7] drm/rockchip: cdn-dp: Support handle lane info without extcon
Date: Tue, 20 Oct 2026 08:52:10 +0000 [thread overview]
Message-ID: <sashiko-outbox-178640@kernel.org> (raw)
In-Reply-To: <20261020072816.180-7-kernel@airkyi.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/rockchip: cdn-dp: unguarded PTR_ERR() in cdn_dp_probe() breaks extcon
--
commit 1cf3e3cfbcc79fdbf3996fd0993b72d987bbcf59
Author: Chaoyi Chen <chaoyi.chen@rock-chips.com>
drm/rockchip: cdn-dp: Support handle lane info without extcon
This patch updates the Rockchip cdn-dp driver to allow operating without an
extcon device by retrieving lane count information directly from the PHY
while preserving existing extcon support.
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 68aa66915e8ac..1c1c1116b5ebe 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
[ ... ]
> @@ -1122,14 +1131,14 @@ static int cdn_dp_probe(struct platform_device *pdev)
> PTR_ERR(phy) == -EPROBE_DEFER)
> return -EPROBE_DEFER;
>
> - if (IS_ERR(extcon) || IS_ERR(phy))
> + if (IS_ERR(phy) || PTR_ERR(extcon) != -ENODEV)
> continue;
>
> port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
> if (!port)
> return -ENOMEM;
>
> - port->extcon = extcon;
> + port->extcon = IS_ERR(extcon) ? NULL : extcon;
> port->phy = phy;
> port->dp = dp;
> port->id = i;
[Severity: High]
When an extcon phandle is present in Device Tree and resolved,
extcon_get_edev_by_phandle() returns a valid struct extcon_dev pointer
rather than an error pointer.
Because PTR_ERR(extcon) != -ENODEV is evaluated in cdn_dp_probe() without
first checking IS_ERR(extcon), any valid extcon pointer will satisfy
PTR_ERR(extcon) != -ENODEV and hit the continue statement.
Doesn't this skip every port that has a valid extcon device, making the
non-NULL branch of IS_ERR(extcon) ? NULL : extcon unreachable and causing
cdn_dp_probe() to fail with -EINVAL on boards that use extcon? Should the
check in cdn_dp_probe() be:
if (IS_ERR(phy) || (IS_ERR(extcon) && PTR_ERR(extcon) != -ENODEV))
continue;
instead?
титься
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261020072816.180-1-kernel@airkyi.com?part=6
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Chaoyi Chen" <kernel@airkyi.com>
Cc: dri-devel@lists.freedesktop.org, linux-phy@lists.infradead.org,
vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v8 6/7] drm/rockchip: cdn-dp: Support handle lane info without extcon
Date: Tue, 20 Oct 2026 08:52:10 +0000 [thread overview]
Message-ID: <sashiko-outbox-178640@kernel.org> (raw)
In-Reply-To: <20261020072816.180-7-kernel@airkyi.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/rockchip: cdn-dp: unguarded PTR_ERR() in cdn_dp_probe() breaks extcon
--
commit 1cf3e3cfbcc79fdbf3996fd0993b72d987bbcf59
Author: Chaoyi Chen <chaoyi.chen@rock-chips.com>
drm/rockchip: cdn-dp: Support handle lane info without extcon
This patch updates the Rockchip cdn-dp driver to allow operating without an
extcon device by retrieving lane count information directly from the PHY
while preserving existing extcon support.
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 68aa66915e8ac..1c1c1116b5ebe 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
[ ... ]
> @@ -1122,14 +1131,14 @@ static int cdn_dp_probe(struct platform_device *pdev)
> PTR_ERR(phy) == -EPROBE_DEFER)
> return -EPROBE_DEFER;
>
> - if (IS_ERR(extcon) || IS_ERR(phy))
> + if (IS_ERR(phy) || PTR_ERR(extcon) != -ENODEV)
> continue;
>
> port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
> if (!port)
> return -ENOMEM;
>
> - port->extcon = extcon;
> + port->extcon = IS_ERR(extcon) ? NULL : extcon;
> port->phy = phy;
> port->dp = dp;
> port->id = i;
[Severity: High]
When an extcon phandle is present in Device Tree and resolved,
extcon_get_edev_by_phandle() returns a valid struct extcon_dev pointer
rather than an error pointer.
Because PTR_ERR(extcon) != -ENODEV is evaluated in cdn_dp_probe() without
first checking IS_ERR(extcon), any valid extcon pointer will satisfy
PTR_ERR(extcon) != -ENODEV and hit the continue statement.
Doesn't this skip every port that has a valid extcon device, making the
non-NULL branch of IS_ERR(extcon) ? NULL : extcon unreachable and causing
cdn_dp_probe() to fail with -EINVAL on boards that use extcon? Should the
check in cdn_dp_probe() be:
if (IS_ERR(phy) || (IS_ERR(extcon) && PTR_ERR(extcon) != -ENODEV))
continue;
instead?
титься
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261020072816.180-1-kernel@airkyi.com?part=6
next prev parent reply other threads:[~2026-10-20 8:52 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 7:28 [PATCH v8 0/7] drm/bridge: Implement generic USB Type-C DP HPD bridge Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` [PATCH v8 1/7] drm/bridge: aux-hpd-bridge: Add drm_dev_has_dp_hpd_bridge() Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` [PATCH v8 2/7] drm/bridge: Implement generic USB Type-C DP HPD bridge Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 8:17 ` sashiko-bot
2026-10-20 8:17 ` sashiko-bot
2026-10-20 7:28 ` [PATCH v8 3/7] drm/display: Add soft depend for aux-hpd-typec-dp-bridge module Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` [PATCH v8 4/7] drm/bridge: aux: Add drm_aux_bridge_register_from_node() Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 8:35 ` sashiko-bot
2026-10-20 8:35 ` sashiko-bot
2026-10-20 7:28 ` [PATCH v8 5/7] phy: rockchip: phy-rockchip-typec: Add DRM AUX bridge Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 8:44 ` sashiko-bot
2026-10-20 8:44 ` sashiko-bot
2026-10-20 7:28 ` [PATCH v8 6/7] drm/rockchip: cdn-dp: Support handle lane info without extcon Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 8:52 ` sashiko-bot [this message]
2026-10-20 8:52 ` sashiko-bot
2026-10-20 7:28 ` [PATCH v8 7/7] drm/rockchip: cdn-dp: Add multiple bridges to support PHY port selection Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 7:28 ` Chaoyi Chen
2026-10-20 9:19 ` sashiko-bot
2026-10-20 9:19 ` sashiko-bot
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=sashiko-outbox-178640@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@airkyi.com \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.