From: sashiko-bot@kernel.org
To: "AngeloGioacchino Del Regno" <angelogioacchino.delregno@collabora.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org,
dri-devel@lists.freedesktop.org, conor+dt@kernel.org
Subject: Re: [PATCH v6 09/11] drm/mediatek: mtk_dsi: Enable PM Runtime on probe
Date: Wed, 15 Jul 2026 15:24:57 +0000 [thread overview]
Message-ID: <20260715152458.1A5B11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260715135703.46540-10-angelogioacchino.delregno@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] Enabling PM runtime for the DSI device causes its power domain to be turned off, but it is never properly resumed, and multiple hardware access paths lack PM runtime checks. This leads to bus faults, system crashes, or hard lockups on register access.
--
--- Patch [9]: [PATCH v6 09/11] drm/mediatek: mtk_dsi: Enable PM Runtime on probe ---
commit 7ae5fcbe79f5f5488a2a9688fd56572adf6bd2e9
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
drm/mediatek: mtk_dsi: Enable PM Runtime on probe
This commit enables PM Runtime at the end of mtk_dsi_probe() to allow the DSI
device's power domain to be managed dynamically.
> Enable PM Runtime at the end of mtk_dsi_probe() so that the
> mediatek-drm mtk_ddp_comp_power_on() function is able to do
> pm_runtime_resume_and_get() and, analogously, the function
> mtk_ddp_comp_power_off() to pm_runtime_put() for the DSI
> device.
[Severity: High]
Does mtk_ddp_comp_power_on() actually get called for the DSI device?
Looking at mtk_crtc_atomic_enable(), it appears to only call
mtk_ddp_comp_power_on() for the first component in the display pipeline:
drivers/gpu/drm/mediatek/mtk_crtc.c:mtk_crtc_atomic_enable() {
...
struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0];
...
ret = mtk_ddp_comp_power_on(comp);
...
}
If the DSI device is at the end of the pipeline and bypassed here, wouldn't it
remain powered off?
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index d2fdeaeb97bea..9f69b237c9116 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -1733,6 +1733,10 @@ static int mtk_dsi_probe(struct platform_device *pdev)
> if (ret)
> return dev_err_probe(&pdev->dev, ret, "Failed to request DSI irq\n");
>
> + ret = devm_pm_runtime_enable(dev);
> + if (ret)
> + return ret;
> +
[Severity: Critical]
Once PM runtime is enabled and the device can be powered off, does this
introduce bus faults in paths that access hardware without PM runtime checks?
For example, mtk_dsi_host_transfer() accesses registers directly without a
preceding pm_runtime_resume_and_get():
drivers/gpu/drm/mediatek/mtk_dsi.c:mtk_dsi_host_transfer() {
...
dsi_mode = readl(dsi->regs + dsi->driver_data->reg_main[DSI_MODE_CTRL]);
...
}
If downstream panel drivers invoke this asynchronously during probe, could
this access unpowered registers and trigger a bus fault?
Similarly, if the interrupt handler triggers while the device is powered off,
could it read ~0u from DSI_INTSTA and enter an infinite loop?
drivers/gpu/drm/mediatek/mtk_dsi.c:mtk_dsi_irq() {
...
status = readl(dsi->regs + dsi->driver_data->reg_main[DSI_INTSTA]) & flag;
...
}
Would it be necessary to use pm_runtime_get_if_active() in the interrupt
handler and ensure other hardware access paths resume the device first?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260715135703.46540-1-angelogioacchino.delregno@collabora.com?part=9
next prev parent reply other threads:[~2026-07-15 15:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 13:56 [PATCH v6 00/11] drm/mediatek: Add DSC, WDMA, MT8189/96 DSI support AngeloGioacchino Del Regno
2026-07-15 13:56 ` [PATCH v6 01/11] dt-bindings: display: mediatek: dsc: Add MT8196 compatible AngeloGioacchino Del Regno
2026-07-15 13:56 ` [PATCH v6 02/11] drm/mediatek: Implement Display Stream Compression support AngeloGioacchino Del Regno
2026-07-15 14:09 ` sashiko-bot
2026-07-15 13:56 ` [PATCH v6 03/11] dt-bindings: display: mediatek: dsi: Document MT8189 and MT8196 AngeloGioacchino Del Regno
2026-07-15 13:56 ` [PATCH v6 04/11] drm/mediatek: mtk_dsi: Cleanup encoder if reset fails during bind AngeloGioacchino Del Regno
2026-07-15 14:25 ` sashiko-bot
2026-07-15 13:56 ` [PATCH v6 05/11] drm/mediatek: mtk_dsi: Enable interrupt at component bind time AngeloGioacchino Del Regno
2026-07-15 14:29 ` sashiko-bot
2026-07-15 13:56 ` [PATCH v6 06/11] drm/mediatek: mtk_dsi: Transfer register offsets to per-SoC const AngeloGioacchino Del Regno
2026-07-15 13:56 ` [PATCH v6 07/11] drm/mediatek: mtk_dsi: Add support for MT8189 AngeloGioacchino Del Regno
2026-07-15 14:40 ` sashiko-bot
2026-07-15 13:57 ` [PATCH v6 08/11] drm/mediatek: mtk_dsi: Add support for MT8196 AngeloGioacchino Del Regno
2026-07-15 14:51 ` sashiko-bot
2026-07-15 13:57 ` [PATCH v6 09/11] drm/mediatek: mtk_dsi: Enable PM Runtime on probe AngeloGioacchino Del Regno
2026-07-15 15:24 ` sashiko-bot [this message]
2026-07-15 13:57 ` [PATCH v6 10/11] dt-bindings: display: mediatek: wdma: Add compatibles for more SoCs AngeloGioacchino Del Regno
2026-07-15 13:57 ` [PATCH v6 11/11] drm/mediatek: Add Write DMA (WDMA) Engine for Writeback support AngeloGioacchino Del Regno
2026-07-15 15:24 ` sashiko-bot
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=20260715152458.1A5B11F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=angelogioacchino.delregno@collabora.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