[PATCH v7 09/23] drm: bridge: dw_hdmi: Unregister CEC notifier during connector cleanup
Hans Verkuil
hverkuil+cisco at kernel.org
Mon May 18 23:22:34 PDT 2026
On 18/05/2026 20:01, Jonas Karlman wrote:
> The CEC notifier is being unregistered when the bridge detach,
> something that happens earlier than normal connector cleanup.
>
> Change to unregister the CEC notifier at connector cleanup, in the
> connector .destroy() func, to align the lifetime of the connector and
> the CEC notifier and closer match a drmres handled generic CEC notifier.
>
> Tested-by: Diederik de Haas <diederik at cknow-tech.com> # Rock64, RockPro64, Quartz64-B
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
Acked-by: Hans Verkuil <hverkuil+cisco at kernel.org>
Regards,
Hans
> ---
> v7: No change
> v6: Collect t-b tag
> v5: New patch
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index cbbd15578042..5fd26ff8f55b 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2532,6 +2532,11 @@ static void dw_hdmi_connector_destroy(struct drm_connector *connector)
> {
> struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector);
>
> + mutex_lock(&hdmi->cec_notifier_mutex);
> + cec_notifier_conn_unregister(hdmi->cec_notifier);
> + hdmi->cec_notifier = NULL;
> + mutex_unlock(&hdmi->cec_notifier_mutex);
> +
> drm_connector_cleanup(connector);
> drm_bridge_put(&hdmi->bridge);
> }
> @@ -2909,16 +2914,6 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
> return dw_hdmi_connector_create(hdmi);
> }
>
> -static void dw_hdmi_bridge_detach(struct drm_bridge *bridge)
> -{
> - struct dw_hdmi *hdmi = bridge->driver_private;
> -
> - mutex_lock(&hdmi->cec_notifier_mutex);
> - cec_notifier_conn_unregister(hdmi->cec_notifier);
> - hdmi->cec_notifier = NULL;
> - mutex_unlock(&hdmi->cec_notifier_mutex);
> -}
> -
> static enum drm_mode_status
> dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
> const struct drm_display_info *info,
> @@ -2996,7 +2991,6 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
> .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> .atomic_reset = drm_atomic_helper_bridge_reset,
> .attach = dw_hdmi_bridge_attach,
> - .detach = dw_hdmi_bridge_detach,
> .atomic_check = dw_hdmi_bridge_atomic_check,
> .atomic_get_output_bus_fmts = dw_hdmi_bridge_atomic_get_output_bus_fmts,
> .atomic_get_input_bus_fmts = dw_hdmi_bridge_atomic_get_input_bus_fmts,
More information about the Linux-rockchip
mailing list