From: Alexandre Mergnat <amergnat@baylibre.com>
To: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
Cc: "maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"mripard@kernel.org" <mripard@kernel.org>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
"simona.vetter@ffwll.ch" <simona.vetter@ffwll.ch>,
"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
"airlied@gmail.com" <airlied@gmail.com>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"will@kernel.org" <will@kernel.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
"simona@ffwll.ch" <simona@ffwll.ch>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Jitao Shi (石记涛)" <jitao.shi@mediatek.com>,
"robh@kernel.org" <robh@kernel.org>
Subject: Re: [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
Date: Mon, 17 Feb 2025 16:03:20 +0100 [thread overview]
Message-ID: <79477810-00a9-47f1-8282-f8077ea082bb@baylibre.com> (raw)
In-Reply-To: <ab3bd050c873bb6cecc00b615b938eabc157cb49.camel@mediatek.com>
Hi CK.
On 17/02/2025 08:56, CK Hu (胡俊光) wrote:
> On Fri, 2025-01-10 at 14:31 +0100, Alexandre Mergnat wrote:
>> External email : Please do not click links or open attachments until you have verified the sender or the content.
>>
>>
>> Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
>> before mtk_dsi_poweron. lanes_ready flag toggle to true during
>> mtk_dsi_lane_ready function, and the DSI module is set up during
>> mtk_dsi_poweron.
>>
>> Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
>> nothing because lanes are considered ready. Unfortunately, when the panel
>> driver try to communicate, the DSI returns a timeout.
>>
>> The solution found here is to put lanes_ready flag to false after the DSI
>> module setup into mtk_dsi_poweron to init the DSI lanes after the power /
>> setup of the DSI module.
>
> I'm not clear about what happen.
> I think this DSI flow has worked for a long time.
> So only some panel has problem?
I don't know if it's related to a specific panel or not.
>
> And another question.
> Do you mean mtk_dsi_lane_ready() do some setting to hardware, but lane is not actually ready?
The workflow should be:
... | dsi->lanes_ready = false | Power-on | setup dsi lanes | dsi->lanes_ready = true (to avoid
re-do dsi lanes setup) | ...
I observe (print function name called + dsi->lanes_ready value):
[ 9.086030] mtk_dsi_probe 0
[ 9.662319] mtk_dsi_host_attach 0
[ 9.662941] mtk_dsi_encoder_init
[ 9.984685] mtk_dsi_poweron 0
[ 10.043755] mtk_dsi_host_transfer 0
[ 10.043769] mtk_dsi_lane_ready 0
[ 10.055837] mtk_dsi_host_transfer 1
[ 10.055853] mtk_dsi_lane_ready 1
[ 10.179788] mtk_dsi_host_transfer 1
[ 10.179803] mtk_dsi_lane_ready 1
[ 10.179880] mtk_dsi_host_transfer 1
[ 10.179885] mtk_dsi_lane_ready 1
[ 10.179920] mtk_dsi_host_transfer 1
[ 10.179923] mtk_dsi_lane_ready 1
[ 10.179986] mtk_dsi_host_transfer 1
[ 10.179993] mtk_dsi_lane_ready 1
[ 10.180134] mtk_dsi_host_transfer 1
[ 10.180143] mtk_dsi_lane_ready 1
[ 10.180175] mtk_dsi_host_transfer 1
[ 10.180178] mtk_dsi_lane_ready 1
[ 10.180223] mtk_dsi_host_transfer 1
[ 10.180226] mtk_dsi_lane_ready 1
[ 10.180245] mtk_dsi_host_transfer 1
[ 10.180248] mtk_dsi_lane_ready 1
[ 10.180278] mtk_dsi_host_transfer 1
[ 10.180280] mtk_dsi_lane_ready 1
[ 10.180312] mtk_dsi_host_transfer 1
[ 10.180314] mtk_dsi_lane_ready 1
[ 10.203774] mtk_dsi_bridge_atomic_pre_enable
[ 10.203787] mtk_dsi_poweron 1
[ 10.203793] mtk_output_dsi_enable
[ 10.203795] mtk_dsi_lane_ready 1
[ 10.471517] mtk_dsi_host_transfer 1
[ 10.486962] mtk_dsi_lane_ready 1
[ 10.487244] mtk_dsi_host_transfer 1
[ 10.503733] mtk_dsi_lane_ready 1
Here the mtk_dsi_lane_ready function:
static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
{
if (!dsi->lanes_ready) {
dsi->lanes_ready = true;
mtk_dsi_rxtx_control(dsi);
usleep_range(30, 100);
mtk_dsi_reset_dphy(dsi);
mtk_dsi_clk_ulp_mode_leave(dsi);
mtk_dsi_lane0_ulp_mode_leave(dsi);
mtk_dsi_clk_hs_mode(dsi, 0);
usleep_range(1000, 3000);
/* The reaction time after pulling up the mipi signal for dsi_rx */
}
}
As you can see, something call "mtk_dsi_bridge_atomic_pre_enable" then mtk_dsi_poweron is called a
second time. This issue is probably due to the probe order (race condition).
After all, IMHO, after a poweron, the registers status should be consider as unknown (or at least HW
default value), so, lanes setup has to be done. This solution improve the driver's robustness.
> Or mtk_dsi_lane_ready() configure the hardware and lane is is actually ready,
> but something make it not ready again, what's the thing which break lane ready?
>
> If this is a bug fix, add Fixes tag.
>
> Regards,
> CK
>
>>
>> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
>> ---
>> drivers/gpu/drm/mediatek/mtk_dsi.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
>> index e61b9bc68e9a..dcf0d93881b5 100644
>> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
>> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
>> @@ -724,6 +724,8 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
>> mtk_dsi_config_vdo_timing(dsi);
>> mtk_dsi_set_interrupt_enable(dsi);
>>
>> + dsi->lanes_ready = false;
>> +
>> return 0;
>> err_disable_engine_clk:
>> clk_disable_unprepare(dsi->engine_clk);
>>
>> --
>> 2.25.1
>>
>
>
> ************* MEDIATEK Confidentiality Notice
> ********************
> The information contained in this e-mail message (including any
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be
> conveyed only to the designated recipient(s). Any use, dissemination,
> distribution, printing, retaining or copying of this e-mail (including its
> attachments) by unintended recipient(s) is strictly prohibited and may
> be unlawful. If you are not an intended recipient of this e-mail, or believe
>
> that you have received this e-mail in error, please notify the sender
> immediately (by replying to this e-mail), delete any and all copies of
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!
>
--
Regards,
Alexandre
next prev parent reply other threads:[~2025-02-17 15:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
2025-01-10 13:31 ` [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example amergnat
2025-03-03 13:22 ` Chun-Kuang Hu
2025-01-10 13:31 ` [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness Alexandre Mergnat
2025-02-17 7:56 ` CK Hu (胡俊光)
2025-02-17 15:03 ` Alexandre Mergnat [this message]
2025-02-18 8:52 ` AngeloGioacchino Del Regno
2025-02-26 11:35 ` Alexandre Mergnat
2025-02-26 11:45 ` AngeloGioacchino Del Regno
2025-02-26 13:16 ` Alexandre Mergnat
2025-01-10 13:31 ` [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support amergnat
2025-02-17 7:36 ` CK Hu (胡俊光)
2025-03-03 13:15 ` Chun-Kuang Hu
2025-01-10 13:31 ` [PATCH v7 4/6] arm64: defconfig: enable display support for mt8365-evk Alexandre Mergnat
2025-01-10 14:10 ` Krzysztof Kozlowski
2025-01-10 13:31 ` [PATCH v7 5/6] arm64: dts: mediatek: add display blocks support for the MT8365 SoC Alexandre Mergnat
2025-01-10 13:31 ` [PATCH v7 6/6] arm64: dts: mediatek: add display support for mt8365-evk Alexandre Mergnat
2025-02-06 11:08 ` (subset) [PATCH v7 0/6] Add display support for the MT8365-EVK board AngeloGioacchino Del Regno
2025-02-07 13:37 ` Alexandre Mergnat
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=79477810-00a9-47f1-8282-f8077ea082bb@baylibre.com \
--to=amergnat@baylibre.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=catalin.marinas@arm.com \
--cc=chunkuang.hu@kernel.org \
--cc=ck.hu@mediatek.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jitao.shi@mediatek.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthias.bgg@gmail.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=simona.vetter@ffwll.ch \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=will@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