]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/mediatek: ovl_adaptor: balance component registrations
authorMyeonghun Pak <mhun512@gmail.com>
Tue, 21 Jul 2026 15:22:42 +0000 (00:22 +0900)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 29 Jul 2026 12:52:16 +0000 (12:52 +0000)
commit533e3469a57996905cdb95f178e7efe38c21aeb2
tree6ba07d81a11c545fa15aa79bee65f86b5748dd93
parent3e191eddbdcb8bf7beb1e9b58209073bd5450719
drm/mediatek: ovl_adaptor: balance component registrations

The OVL adaptor registers both an aggregate driver for its child devices
and a component for the main DRM aggregate. Probe currently ignores an
error from registering the child aggregate and leaves that aggregate
registered if registering the DRM component fails. The remove callback
also leaves the DRM component registered.

These imbalances can leave component framework entries referring to a
device whose probe failed or whose driver has been detached. The aggregate
unbind callback also fails to undo component_bind_all(), leaving its child
components marked as bound when the aggregate is removed.

Check the aggregate registration result, unwind it when the component
registration fails, and unregister the component before the aggregate on
remove. Keep runtime PM enabled until both framework registrations have
been removed, and unbind all child components from the aggregate unbind
callback.

Fixes: 453c3364632a ("drm/mediatek: Add ovl_adaptor support for MT8195")
Cc: stable@vger.kernel.org # 6.4+
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20260721152242.47138-1-mhun512@gmail.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c