From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: sashiko-reviews@lists.linux.dev
Cc: conor+dt@kernel.org, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, neil.armstrong@linaro.org,
linux-phy@lists.infradead.org, vkoul@kernel.org, robh@kernel.org,
olteanv@gmail.com
Subject: Re: [PATCH v3 2/2] phy: mediatek: Add support for MT8196 MIPI DSI PHY
Date: Tue, 14 Jul 2026 10:29:52 +0200 [thread overview]
Message-ID: <cd633f0b-7f6b-42cf-b1e5-79ca56d62716@collabora.com> (raw)
In-Reply-To: <20260713104835.B14401F000E9@smtp.kernel.org>
On 7/13/26 12:48, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] Signaling voltage boost is exclusively tied to the absolute maximum clamped frequency, preventing high data rates from receiving the boost.
> --
>
> --- Patch [2]: [PATCH v3 2/2] phy: mediatek: Add support for MT8196 MIPI DSI PHY ---
> commit a6b40caad1ac266a0481ef7b26baffceb672008c
> Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>
> phy: mediatek: Add support for MT8196 MIPI DSI PHY
>
> This commit adds support for the MIPI DSI PHY found in the MediaTek MT8196
> SoC and its variants. It introduces a new register layout and basic D-PHY
> functionality needed to drive MIPI DSI displays.
>
>> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c
>> new file mode 100644
>> index 0000000000000..eac3db9922dba
>> --- /dev/null
>> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c
>
> [ ... ]
>
>> +static int mtk_mipi_tx_pll_enable(struct clk_hw *hw)
>> +{
>> + struct mtk_mipi_tx *mipi_tx = mtk_mipi_tx_from_clk_hw(hw);
>> + void __iomem *base = mipi_tx->regs;
>> + u32 voltage = RG_DSI_PRD_REF_MINI;
>> + u32 pres = MIPITX_PRESERVED_MINI;
>> + unsigned long long pcw_calc;
>> + unsigned int txdiv, txdiv0;
>> + u32 pcw;
>> +
>> + dev_dbg(mipi_tx->dev, "enable: %u bps\n", mipi_tx->data_rate);
>> +
>> + if (mipi_tx->data_rate >= DSI_PHY_PLL_MAX_RATE_HZ) {
>> + /* Select higher signaling voltage for fast data rates */
>> + voltage = RG_DSI_PRD_REF_DEF;
>> + pres = MIPITX_PRESERVED_DEF;
>> + txdiv = 1;
>> + txdiv0 = 0;
>> + } else if (mipi_tx->data_rate >= 1000000000) {
>
> [Severity: Medium]
> Does this logic unintentionally restrict the higher signaling voltage to only
> exact matches of the maximum PLL rate?
>
Yes, it does. It's fine. This is on purpose.
There's a way to scale voltages a bit differently (for 4 different freq ranges)
but it's a bit messy to implement, needs me to have different displays to test
all different frequencies (which I don't have), and a bit more code.
The only frequencies that really need the higher signaling voltage are the ones
from 2GHz (which is currently the max frequency, but can be expanded later, as
there will be new HW supporting higher freqs, with the same signaling voltage
increase and the same code for it) onwards.
> Since mtk_mipi_tx_pll_determine_rate() clamps the clock rate to
> DSI_PHY_PLL_MAX_RATE_HZ (2.0 GHz), mipi_tx->data_rate can never exceed this
> value. Consequently, panels requesting data rates slightly below 2.0 GHz
> (for example, 1.99 GHz) will fall through to the 1.0 GHz branch instead of
> receiving the voltage boost and correct PLL dividers intended for fast data
> rates.
>
> Could this conflation between the PLL octave band threshold and the maximum
> frequency clamp macro also break the PLL divider logic if the maximum
> supported rate limit is increased in the future?
>
next prev parent reply other threads:[~2026-07-14 8:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 10:38 [PATCH v3 0/2] PHY: Add support for MT8196 DSI PHY AngeloGioacchino Del Regno
2026-07-13 10:38 ` [PATCH v3 1/2] dt-bindings: phy: mediatek,dsi-phy: Add support for MT8196 AngeloGioacchino Del Regno
2026-07-13 10:38 ` [PATCH v3 2/2] phy: mediatek: Add support for MT8196 MIPI DSI PHY AngeloGioacchino Del Regno
2026-07-13 10:48 ` sashiko-bot
2026-07-14 8:29 ` AngeloGioacchino Del Regno [this message]
2026-07-14 16:42 ` Vinod Koul
2026-07-15 11:57 ` AngeloGioacchino Del Regno
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=cd633f0b-7f6b-42cf-b1e5-79ca56d62716@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox