]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/bridge: cadence: cdns-mhdp8546-core: Set the mhdp connector earlier in atomic_ena...
authorJayesh Choudhary <j-choudhary@ti.com>
Tue, 9 Dec 2025 12:03:27 +0000 (17:33 +0530)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Mon, 9 Mar 2026 17:57:19 +0000 (18:57 +0100)
commit43d6508ddbf9fb974fbc359a033154f78c9d4c8b
treea012dcdbfbb1acbeac4e6eefe0bfa4c2b40e3172
parentfc6aa072bdbd26dfc94269fa87ca40ab4f867236
drm/bridge: cadence: cdns-mhdp8546-core: Set the mhdp connector earlier in atomic_enable()

In case if we get errors in cdns_mhdp_link_up() or cdns_mhdp_reg_read()
in atomic_enable, we will go to cdns_mhdp_modeset_retry_fn() and will hit
NULL pointer while trying to access the mutex. We need the connector to
be set before that. Unlike in legacy cases with flag
!DRM_BRIDGE_ATTACH_NO_CONNECTOR, we do not have connector initialised
in bridge_attach(), so add the mhdp->connector_ptr in device structure
to handle both cases with DRM_BRIDGE_ATTACH_NO_CONNECTOR and
!DRM_BRIDGE_ATTACH_NO_CONNECTOR, set it in atomic_enable() earlier to
avoid possible NULL pointer dereference in recovery paths like
modeset_retry_fn() with the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag set.

Fixes: c932ced6b585 ("drm/tidss: Update encoder/bridge chain connect model")
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Signed-off-by: Harikrishna Shenoy <h-shenoy@ti.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patch.msgid.link/20251209120332.3559893-2-h-shenoy@ti.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c