From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: chunkuang.hu@kernel.org, p.zabel@pengutronix.de,
airlied@gmail.com, simona@ffwll.ch, matthias.bgg@gmail.com,
dmitry.osipenko@collabora.com, granquet@baylibre.com,
rex-bc.chen@mediatek.com, ck.hu@mediatek.com,
amergnat@baylibre.com, djkurtz@chromium.org,
littlecvr@chromium.org, bibby.hsieh@mediatek.com,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH 1/3] drm/mediatek: mtk_dp: Fix hdmi codec and phy driver unregistration
Date: Thu, 25 Sep 2025 15:57:01 +0200 [thread overview]
Message-ID: <719dcef6-a360-41cc-a5c5-fdbe53ec99d3@collabora.com> (raw)
In-Reply-To: <72pgsr4birfy5wtf5umsfkahr7tplnih5wxoj4x33igapaspmg@7iafkarq4hzg>
Il 25/09/25 03:09, Dmitry Baryshkov ha scritto:
> On Wed, Sep 24, 2025 at 12:37:06PM +0200, AngeloGioacchino Del Regno wrote:
>> During probe, this driver is registering two platform devices: one
>> for the HDMI Codec driver and one for the DisplayPort PHY driver.
>>
>> In the probe function, none of the error cases are unregistering
>> any of the two platform devices and this may cause registration
>> of multiple instances of those in case this driver returns one or
>> more probe deferral(s) in the "wrong" spots.
>>
>> In order to fix this, add devm actions to unregister those and
>> remove the manual calls to platform_device_unregister in the
>> mtk_dp_remove() function, as those would otherwise be redundant.
>>
>> Fixes: e71a8ebbe086 ("drm/mediatek: dp: Audio support for MT8195")
>> Fixes: caf2ae486742 ("drm/mediatek: dp: Add support for embedded DisplayPort aux-bus")
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>> drivers/gpu/drm/mediatek/mtk_dp.c | 30 ++++++++++++++++++++++++++----
>> 1 file changed, 26 insertions(+), 4 deletions(-)
>>
>
> You can save yourself from all these troubles if you store the
> registered device at connector->hdmi_audio.codec_pdev (see
> drm_connector_cleanup()).
>
> And of course, you might use DRM_BRIDGE_OP_DP_AUDIO in order to reduce
> code duplication.
>
Fair point. Noted! Thanks! :-D
next prev parent reply other threads:[~2025-09-25 13:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 10:37 [PATCH 0/3] drm/mediatek: Fixes: Stale pointer usage and device leak AngeloGioacchino Del Regno
2025-09-24 10:37 ` [PATCH 1/3] drm/mediatek: mtk_dp: Fix hdmi codec and phy driver unregistration AngeloGioacchino Del Regno
2025-09-25 1:09 ` Dmitry Baryshkov
2025-09-25 13:57 ` AngeloGioacchino Del Regno [this message]
2025-09-24 10:37 ` [PATCH 2/3] drm/mediatek: mtk_disp_ovl: Enable/disable interrupt on bind/unbind AngeloGioacchino Del Regno
2025-10-28 9:55 ` CK Hu (胡俊光)
2025-10-28 15:51 ` AngeloGioacchino Del Regno
2025-09-24 10:37 ` [PATCH 3/3] drm/mediatek: mtk_disp_rdma: " AngeloGioacchino Del Regno
2025-10-28 9:49 ` CK Hu (胡俊光)
2025-10-28 15:49 ` AngeloGioacchino Del Regno
2025-12-30 15:05 ` Chun-Kuang Hu
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=719dcef6-a360-41cc-a5c5-fdbe53ec99d3@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=airlied@gmail.com \
--cc=amergnat@baylibre.com \
--cc=bibby.hsieh@mediatek.com \
--cc=chunkuang.hu@kernel.org \
--cc=ck.hu@mediatek.com \
--cc=djkurtz@chromium.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=granquet@baylibre.com \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=littlecvr@chromium.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=rex-bc.chen@mediatek.com \
--cc=simona@ffwll.ch \
/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
all inboxes | Powered by JetHome®