Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617954 > unrolled thread

[PATCH v5 04/12] drm: bridge: analogix: Destroy connector & encoder when unbinding

Started byJeffy Chen <jeffy.chen@rock-chips.com>
First post2017-04-06 14:40 +0200
Last post2017-04-07 14:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v5 04/12] drm: bridge: analogix: Destroy connector & encoder when unbinding Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-04-06 14:40 +0200
    Re: [PATCH v5 04/12] drm: bridge: analogix: Destroy connector &  encoder when unbinding Andrzej Hajda <a.hajda@samsung.com> - 2017-04-07 14:10 +0200

#1617954 — [PATCH v5 04/12] drm: bridge: analogix: Destroy connector & encoder when unbinding

FromJeffy Chen <jeffy.chen@rock-chips.com>
Date2017-04-06 14:40 +0200
Subject[PATCH v5 04/12] drm: bridge: analogix: Destroy connector & encoder when unbinding
Message-ID<tteRH-5K-17@gated-at.bofh.it>
Normally we do this in drm_mode_config_cleanup. But:
1/ analogix dp's connector is allocated in bind, and freed after unbind.
So we need to destroy it in unbind to avoid further access.
2/ the drm bridge is attached in bind, and detached in encoder cleanup.
So we need to destroy encoder in unbind.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v5: None
Changes in v4:
Address Andrzej Hajda <a.hajda@samsung.com>'s comments.

Changes in v3: None
Changes in v2: None

 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index d05ade4..4c758ed 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1439,6 +1439,8 @@ void analogix_dp_unbind(struct device *dev, struct device *master,
 	struct analogix_dp_device *dp = dev_get_drvdata(dev);
 
 	analogix_dp_bridge_disable(dp->bridge);
+	dp->connector.funcs->destroy(&dp->connector);
+	dp->encoder->funcs->destroy(dp->encoder);
 
 	if (dp->plat_data->panel) {
 		if (drm_panel_unprepare(dp->plat_data->panel))
-- 
2.1.4

[toc] | [next] | [standalone]


#1618716 — Re: [PATCH v5 04/12] drm: bridge: analogix: Destroy connector & encoder when unbinding

FromAndrzej Hajda <a.hajda@samsung.com>
Date2017-04-07 14:10 +0200
SubjectRe: [PATCH v5 04/12] drm: bridge: analogix: Destroy connector & encoder when unbinding
Message-ID<ttASd-6SI-15@gated-at.bofh.it>
In reply to#1617954
On 06.04.2017 14:31, Jeffy Chen wrote:
> Normally we do this in drm_mode_config_cleanup. But:
> 1/ analogix dp's connector is allocated in bind, and freed after unbind.
> So we need to destroy it in unbind to avoid further access.
> 2/ the drm bridge is attached in bind, and detached in encoder cleanup.
> So we need to destroy encoder in unbind.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

In general drm core should free drm resources, doing it in component can
hurt some day. Maybe it would be good to move some stuff from
bind/unbind to probe/remove if necessary, to allow connector and encoder
to live little bit longer, and be destroyed by drm core. This is just
suggestion, I am not familiar enough with the driver to make stronger
statements :)

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej


> ---
>
> Changes in v5: None
> Changes in v4:
> Address Andrzej Hajda <a.hajda@samsung.com>'s comments.
>
> Changes in v3: None
> Changes in v2: None
>
>  drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index d05ade4..4c758ed 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -1439,6 +1439,8 @@ void analogix_dp_unbind(struct device *dev, struct device *master,
>  	struct analogix_dp_device *dp = dev_get_drvdata(dev);
>  
>  	analogix_dp_bridge_disable(dp->bridge);
> +	dp->connector.funcs->destroy(&dp->connector);
> +	dp->encoder->funcs->destroy(dp->encoder);
>  
>  	if (dp->plat_data->panel) {
>  		if (drm_panel_unprepare(dp->plat_data->panel))

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web