From: sashiko-bot@kernel.org
To: "Damon Ding" <damon.ding@rock-chips.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v6 08/10] drm/bridge: analogix_dp: Rename and simplify is_rockchip()
Date: Thu, 21 May 2026 08:27:32 +0000 [thread overview]
Message-ID: <20260521082733.2D5681F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260521080835.1362416-9-damon.ding@rock-chips.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Modifying global connector state in atomic_check callback.
- [High] Calling sleeping functions from atomic commit callbacks.
--
commit c77fcbd07b0455b2897dddc1d458e692b59b3b2f
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Rename and simplify is_rockchip()
This commit renames the inline helper is_rockchip() to
analogix_dp_is_rockchip() and replaces its chained equality
comparisons with a switch-case layout for better readability.
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index 8cf6b73bceac0..116de3bd83a30 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -870,7 +870,7 @@ static int analogix_dp_bridge_atomic_check(struct drm_bridge *bridge,
> struct drm_display_info *di = &conn_state->connector->display_info;
> u32 mask = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
>
> - if (is_rockchip(dp->plat_data->dev_type)) {
> + if (analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
> if ((di->color_formats & mask)) {
> DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
> di->color_formats &= ~mask;
> di->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
> di->bpc = 8;
> }
[Severity: High]
This isn't a bug introduced by this patch, but does this correctly adhere to
DRM atomic KMS principles?
Mutating the global connector state (di->color_formats and di->bpc) inside
the atomic_check callback can cause unintended side effects.
Since atomic_check may be invoked for test-only commits or in parallel,
modifying persistent properties here means these changes will remain even if
the commit fails or is rejected, potentially leading to incorrect functional
behavior in subsequent commits.
[ ... ]
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index 38fd8d5014d29..6207ded7ffd5e 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
[ ... ]
> @@ -329,7 +329,7 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
> reg &= ~mask;
>
> writel(reg, dp->reg_base + phy_pd_addr);
> - if (dp->plat_data && is_rockchip(dp->plat_data->dev_type))
> + if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type))
> usleep_range(10, 15);
> break;
[Severity: High]
This is a pre-existing issue, but is it safe to call usleep_range() here?
According to subsystem guidelines, atomic callbacks (like bridge enable and
disable routines) run in atomic context during non-blocking commits, where
sleeping functions are forbidden.
If analogix_dp_bridge_atomic_disable() invokes this function (for example,
via analogix_dp_disable_psr()), the sleep could cause kernel warnings,
system instability, or deadlocks. Should this be replaced with a non-sleeping
delay like udelay()?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260521080835.1362416-1-damon.ding@rock-chips.com?part=8
next prev parent reply other threads:[~2026-05-21 8:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 8:08 [PATCH v6 00/10] Add eDP support for RK3576 Damon Ding
2026-05-21 8:08 ` [PATCH v6 01/10] dt-bindings: display: rockchip: analogix-dp: Fix hclk as third clock for RK3588 Damon Ding
2026-05-21 19:54 ` Conor Dooley
2026-05-22 3:02 ` Damon Ding
2026-05-22 6:11 ` Krzysztof Kozlowski
2026-05-22 6:29 ` Damon Ding
2026-05-21 8:08 ` [PATCH v6 02/10] dt-bindings: display: rockchip: analogix-dp: Add per-clock descriptions Damon Ding
2026-05-21 8:08 ` [PATCH v6 03/10] arm64: dts: rockchip: Add missing hclk for RK3588 eDP0 Damon Ding
2026-05-21 8:08 ` [PATCH v6 04/10] arm64: dts: rockchip: Add missing hclk for RK3588 eDP1 Damon Ding
2026-05-21 8:08 ` [PATCH v6 05/10] drm/rockchip: analogix_dp: Enable hclk for RK3588 Damon Ding
2026-05-21 8:08 ` [PATCH v6 06/10] dt-bindings: display: rockchip: analogix-dp: Add support for RK3576 Damon Ding
2026-05-21 8:08 ` [PATCH v6 07/10] arm64: dts: rockchip: Add eDP node " Damon Ding
2026-05-21 8:08 ` [PATCH v6 08/10] drm/bridge: analogix_dp: Rename and simplify is_rockchip() Damon Ding
2026-05-21 8:27 ` sashiko-bot [this message]
2026-05-21 8:08 ` [PATCH v6 09/10] drm/bridge: analogix_dp: Add support for RK3576 Damon Ding
2026-05-21 8:08 ` [PATCH v6 10/10] drm/rockchip: " 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=20260521082733.2D5681F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=damon.ding@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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