From: sashiko-bot@kernel.org
To: "Damon Ding" <damon.ding@rock-chips.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org,
dri-devel@lists.freedesktop.org, robh@kernel.org
Subject: Re: [PATCH v8 5/5] drm/bridge: analogix_dp: Add support for optional data-lanes mapping
Date: Fri, 28 Aug 2026 07:02:45 +0000 [thread overview]
Message-ID: <20260828070245.849DA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828065153.590802-6-damon.ding@rock-chips.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect hardware lane mapping due to logic-to-physical vs physical-to-logic mismatch, effectively programming the inverse of the intended mapping.
--
commit 83b65668f019b59b41d7d71bc5a8a34dd644922a
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Add support for optional data-lanes mapping
This commit parses the optional 'data-lanes' device tree property to support
custom physical lane mapping configurations. If no valid configuration is
found, it automatically falls back to a default lane map.
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index ea8401293a23a..c1344a3f013ab 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
[ ... ]
> @@ -48,16 +48,15 @@ void analogix_dp_stop_video(struct analogix_dp_device *dp)
> writel(reg, dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> }
>
> -void analogix_dp_lane_swap(struct analogix_dp_device *dp, bool enable)
> +void analogix_dp_lane_mapping(struct analogix_dp_device *dp)
> {
> + u32 *lane_map = dp->video_info.lane_map;
> u32 reg;
>
> - if (enable)
> - reg = LANE3_MAP_LOGIC_LANE_0 | LANE2_MAP_LOGIC_LANE_1 |
> - LANE1_MAP_LOGIC_LANE_2 | LANE0_MAP_LOGIC_LANE_3;
> - else
> - reg = LANE3_MAP_LOGIC_LANE_3 | LANE2_MAP_LOGIC_LANE_2 |
> - LANE1_MAP_LOGIC_LANE_1 | LANE0_MAP_LOGIC_LANE_0;
> + reg = lane_map[0] << LANE0_MAP_SHIFT;
> + reg |= lane_map[1] << LANE1_MAP_SHIFT;
> + reg |= lane_map[2] << LANE2_MAP_SHIFT;
> + reg |= lane_map[3] << LANE3_MAP_SHIFT;
[Severity: High]
Does this logic unintentionally program the inverse of the intended lane
mapping?
The data-lanes device tree property specifies the physical lane for each
logical lane, where lane_map[logical_index] = physical_index. However, the
ANALOGIX_DP_LANE_MAP register is structured to select a logical lane for each
physical lane.
In analogix_dp_lane_mapping(), the code uses the logical lane index to
select the shift mask (e.g., LANE0_MAP_SHIFT) and assigns the physical lane
index (lane_map[0]) as the value. This configures physical lane 0 to output
logical lane lane_map[0], which results in the inverse of the intended mapping
when an asymmetric configuration is used.
Would it be more appropriate to write the logical lane index into the shift
corresponding to the physical lane? For example, by doing something like:
reg |= logical_index << (lane_map[logical_index] * 2);
>
> writel(reg, dp->reg_base + ANALOGIX_DP_LANE_MAP);
> }
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828065153.590802-1-damon.ding@rock-chips.com?part=5
prev parent reply other threads:[~2026-08-28 7:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 6:51 [PATCH v8 0/5] Add eDP lane mapping support Damon Ding
2026-08-28 6:51 ` [PATCH v8 1/5] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint Damon Ding
2026-08-28 6:51 ` [PATCH v8 2/5] drm/dp: Add helper to validate DP lane counts Damon Ding
2026-08-28 6:51 ` [PATCH v8 3/5] drm/bridge: analogix_dp: Restore mandatory samsung DP DT properties Damon Ding
2026-08-28 6:51 ` [PATCH v8 4/5] drm/bridge: analogix_dp: Add validation for samsung, lane-count property Damon Ding
2026-08-28 7:02 ` [PATCH v8 4/5] drm/bridge: analogix_dp: Add validation for samsung,lane-count property sashiko-bot
2026-08-28 6:51 ` [PATCH v8 5/5] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding
2026-08-28 7:02 ` sashiko-bot [this message]
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=20260828070245.849DA1F000E9@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=dri-devel@lists.freedesktop.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