All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: adv7511: clean up CEC adapter when probe fails
@ 2022-03-21 10:47 Lucas Stach
  2022-03-31 12:10 ` Robert Foss
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2022-03-21 10:47 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec
  Cc: kernel, dri-devel

When the probe routine fails we also need to clean up the
CEC adapter registered in adv7511_cec_init().

Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
The "fixed" commit is not the one introducing the issue, it had been
there as long as the driver supported CEC, but is the earliest commit
that allows conflict free backporting.
864c49a31d6b ("drm/bridge: adv7511: Register and attach our DSI
device at probe") made the issue much more likely to be hit, as the
DSI attach may return -EPROBE_DEFER, so the cleanup path is exercised
a lot more.
---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index f8e5da148599..370eb8d5d39b 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -1298,6 +1298,7 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
 	adv7511_audio_exit(adv7511);
 	drm_bridge_remove(&adv7511->bridge);
 err_unregister_cec:
+	cec_unregister_adapter(adv7511->cec_adap);
 	i2c_unregister_device(adv7511->i2c_cec);
 	clk_disable_unprepare(adv7511->cec_clk);
 err_i2c_unregister_packet:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/bridge: adv7511: clean up CEC adapter when probe fails
  2022-03-21 10:47 [PATCH] drm/bridge: adv7511: clean up CEC adapter when probe fails Lucas Stach
@ 2022-03-31 12:10 ` Robert Foss
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Foss @ 2022-03-31 12:10 UTC (permalink / raw)
  To: Lucas Stach
  Cc: kernel, Jonas Karlman, Neil Armstrong, dri-devel, Jernej Skrabec,
	Andrzej Hajda, Laurent Pinchart

On Mon, 21 Mar 2022 at 11:47, Lucas Stach <l.stach@pengutronix.de> wrote:
>
> When the probe routine fails we also need to clean up the
> CEC adapter registered in adv7511_cec_init().
>
> Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support")
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
> The "fixed" commit is not the one introducing the issue, it had been
> there as long as the driver supported CEC, but is the earliest commit
> that allows conflict free backporting.
> 864c49a31d6b ("drm/bridge: adv7511: Register and attach our DSI
> device at probe") made the issue much more likely to be hit, as the
> DSI attach may return -EPROBE_DEFER, so the cleanup path is exercised
> a lot more.
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index f8e5da148599..370eb8d5d39b 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -1298,6 +1298,7 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
>         adv7511_audio_exit(adv7511);
>         drm_bridge_remove(&adv7511->bridge);
>  err_unregister_cec:
> +       cec_unregister_adapter(adv7511->cec_adap);
>         i2c_unregister_device(adv7511->i2c_cec);
>         clk_disable_unprepare(adv7511->cec_clk);
>  err_i2c_unregister_packet:
> --
> 2.34.1
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

Applied to drm-misc-next.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-31 12:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-21 10:47 [PATCH] drm/bridge: adv7511: clean up CEC adapter when probe fails Lucas Stach
2022-03-31 12:10 ` Robert Foss

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.