From: sashiko-bot@kernel.org
To: "Abhash Kumar Jha" <a-kumar2@ti.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove
Date: Tue, 24 Nov 2026 10:28:31 +0000 [thread overview]
Message-ID: <sashiko-outbox-230963@kernel.org> (raw)
In-Reply-To: <20261124101747.2432344-1-a-kumar2@ti.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] drm/bridge: cdns-mhdp8546: use-after-free in
cdns_mhdp_fw_cb() [1]
--
commit 23a21b2ed969a0e335bad1cc0a8b7a4ecba91485
Author: Abhash Kumar Jha <a-kumar2@ti.com>
drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove
This commit adds phy_power_on() and phy_power_off() calls alongside
phy_init() and phy_exit() in cdns_mhdp_probe() and cdns_mhdp_remove().
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> index f47717bd10798..86e850a4752dc 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
[ ... ]
> @@ -2424,6 +2432,7 @@ static void cdns_mhdp_remove(struct platform_device *pdev)
> ERR_PTR(ret));
> }
>
> + phy_power_off(mhdp->phy);
> phy_exit(mhdp->phy);
>
> if (mhdp->info && mhdp->info->ops && mhdp->info->ops->exit)
[Severity: Critical]
This problem wasn't introduced by this patch, but can cdns_mhdp_fw_cb()
trigger a use-after-free on mhdp [1] if firmware loading takes longer
than the 100ms timeout in cdns_mhdp_remove()?
cdns_mhdp_load_firmware() starts an asynchronous request with
request_firmware_nowait(), passing the devres-managed mhdp as the callback
context. If wait_event_timeout() in cdns_mhdp_remove() expires before the
firmware finishes loading, cdns_mhdp_remove() logs an error and returns
without cancelling or waiting for the request:
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:cdns_mhdp_remove() {
...
ret = wait_event_timeout(mhdp->fw_load_wq,
mhdp->hw_state == MHDP_HW_READY,
timeout);
spin_lock(&mhdp->start_lock);
mhdp->hw_state = MHDP_HW_STOPPED;
spin_unlock(&mhdp->start_lock);
if (ret == 0) {
dev_err(mhdp->dev, "%s: Timeout waiting for fw loading\n",
__func__);
} else {
...
}
After cdns_mhdp_remove() returns, devres cleanup frees mhdp, and when the
pending request completes later, cdns_mhdp_fw_cb() dereferences the freed
mhdp pointer.
[1] https://sashiko.dev/#/bug/linux-745c94fb-512f-4afa-95f5-092458e19f3a
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124101747.2432344-1-a-kumar2@ti.com?part=1
next prev parent reply other threads:[~2026-11-24 10:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 10:17 [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove Abhash Kumar Jha
2026-11-24 10:28 ` sashiko-bot [this message]
2026-11-24 12:53 ` Tomi Valkeinen
2026-11-24 13:00 ` Benjamin Robin
2026-11-24 13:26 ` Tomi Valkeinen
2026-11-24 14:18 ` Benjamin Robin
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-230963@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=a-kumar2@ti.com \
--cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.