From: sashiko-bot@kernel.org
To: "Luo Liu" <Luo.Liu@cixtech.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 2/5] drm/bridge: trilinear: add the DPTX hardware layer
Date: Tue, 24 Nov 2026 12:22:03 +0000 [thread overview]
Message-ID: <sashiko-outbox-231126@kernel.org> (raw)
In-Reply-To: <20261124120114.3273161-3-Luo.Liu@cixtech.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] drm/bridge: trilinear: unmasked interrupt cause dispatch in
dptx_hw_irq()
- [Medium] drm/bridge: trilinear: stale enhanced framing state in
dptx_hw_link_setup()
- [Low] drm/bridge: trilinear: open-coded drm_dp_vsc_sdp_supported() in
sink caps
--
commit 4fa26124ea587953f5e3c4b3e14b850c7ab4e1d9
Author: Luo Liu <Luo.Liu@cixtech.com>
drm/bridge: trilinear: add the DPTX hardware layer
This commit adds the DisplayPort transmitter hardware layer for the
Trilinear bridge driver, covering PHY and clock control, AUX transfers,
DPCD capability parsing, link training, and SST stream configuration.
> diff --git a/drivers/gpu/drm/bridge/trilinear/dptx_hw.c b/drivers/gpu/drm/bridge/trilinear/dptx_hw.c
> new file mode 100644
> index 0000000000000..6f3011ab65413
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/trilinear/dptx_hw.c
[ ... ]
> +static void dptx_hw_link_setup(struct dp_hw *hw, u8 lane_cnt,
> + bool enhanced, bool downspread)
> +{
> + dptx_hw_write(hw, DPTX_LANE_COUNT_SET, lane_cnt);
> +
> + if (enhanced)
> + dptx_hw_write(hw, DPTX_ENHANCED_FRAMING_ENABLE, 1);
> +
> + dptx_hw_write(hw, DPTX_DOWNSPREAD_CONTROL, downspread);
> +}
[Severity: Medium]
Should DPTX_ENHANCED_FRAMING_ENABLE be written unconditionally with
enhanced? When enhanced is false, dptx_hw_link_configure() clears
DP_LANE_COUNT_ENHANCED_FRAME_EN in the sink's DP_LANE_COUNT_SET register,
so leaving DPTX_ENHANCED_FRAMING_ENABLE set from a previously connected
sink causes a framing mismatch between the transmitter and the sink.
[ ... ]
> +static int dptx_hw_dpcd_sink_caps(struct dp_hw *hw)
> +{
> + u8 value = 0;
> + int ret;
> +
> + memset(&hw->caps, 0, sizeof(hw->caps));
> +
> + ret = drm_dp_read_dpcd_caps(&hw->aux, hw->dpcd);
> + if (ret)
> + return ret;
> +
> + ret = drm_dp_read_downstream_info(&hw->aux, hw->dpcd,
> + hw->downstream_ports);
> + if (ret)
> + return ret;
> +
> + hw->caps.enhanced_framing = drm_dp_enhanced_frame_cap(hw->dpcd);
> + hw->caps.tps3_supported = drm_dp_tps3_supported(hw->dpcd);
> + hw->caps.tps4_supported = drm_dp_tps4_supported(hw->dpcd);
> +
> + /*
> + * DP_DPRX_FEATURE_ENUMERATION_LIST is DP 1.3+. A NACK here just means
> + * an older sink, so degrade to "unsupported" instead of failing.
> + */
> + if (hw->dpcd[DP_DPCD_REV] >= DP_DPCD_REV_13 &&
> + drm_dp_dpcd_readb(&hw->aux, DP_DPRX_FEATURE_ENUMERATION_LIST,
> + &value) == 1)
> + hw->caps.vsc_supported =
> + !!(value & DP_VSC_SDP_EXT_FOR_COLORIMETRY_SUPPORTED);
[Severity: Low]
This isn't a bug, but drm_dp_vsc_sdp_supported(&hw->aux, hw->dpcd) already
performs this exact check and can be used here instead of open-coding it.
[ ... ]
> +static irqreturn_t dptx_hw_irq(struct dp_hw *hw)
> +{
> + u32 value;
> + u32 mask;
> +
> + value = dptx_hw_read(hw, DPTX_INTERRUPT_CAUSE);
> + mask = dptx_hw_read(hw, DPTX_INTERRUPT_MASK);
> + if (!(value & ~mask))
> + return IRQ_NONE;
> +
> + if (value & DPTX_INTERRUPT_GP_TIMER_IRQ)
> + dev_dbg_ratelimited(hw->dev, "gp tmr\n");
> +
> + if (value & DPTX_INTERRUPT_REPLY_TIMEOUT)
> + dev_dbg_ratelimited(hw->dev, "reply timeout\n");
> +
> + if (value & DPTX_INTERRUPT_REPLY_RECEIVED)
> + dev_dbg_ratelimited(hw->dev, "reply received\n");
> +
> + if (value & DPTX_INTERRUPT_HPD_EVENT)
> + hw->hpd_event_callback(hw->data);
> +
> + if (value & DPTX_INTERRUPT_HPD_IRQ)
> + hw->hpd_irq_callback(hw->data);
> +
> + return IRQ_HANDLED;
> +}
[Severity: Medium]
Should value be masked with ~mask before testing individual interrupt
cause bits? Because dptx_hw_aux_submit() polls DPTX_AUX_STATUS without
reading DPTX_INTERRUPT_CAUSE, masked bits such as
DPTX_INTERRUPT_REPLY_RECEIVED remain latched in DPTX_INTERRUPT_CAUSE and
will be evaluated whenever an unmasked HPD interrupt fires.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124120114.3273161-1-Luo.Liu@cixtech.com?part=2
next prev parent reply other threads:[~2026-11-24 12:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 12:01 [PATCH v3 0/5] drm/bridge: trilinear: add the Sky1 DisplayPort transmitter Luo Liu
2026-11-24 12:01 ` [PATCH v3 1/5] dt-bindings: display: add CIX " Luo Liu
2026-11-24 12:12 ` sashiko-bot
2026-11-24 12:01 ` [PATCH v3 2/5] drm/bridge: trilinear: add the DPTX hardware layer Luo Liu
2026-11-24 12:22 ` sashiko-bot [this message]
2026-11-24 12:01 ` [PATCH v3 3/5] drm/bridge: trilinear: add the DPTX DRM bridge Luo Liu
2026-11-24 12:28 ` sashiko-bot
2026-11-24 12:01 ` [PATCH v3 4/5] drm/bridge: trilinear: add the DPTX core and build glue Luo Liu
2026-11-24 12:25 ` sashiko-bot
2026-11-24 12:01 ` [PATCH v3 5/5] drm/cix: add the Sky1 DisplayPort platform glue Luo Liu
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-231126@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Luo.Liu@cixtech.com \
--cc=conor+dt@kernel.org \
--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