[v2,03/49] drm/omap: dsi: Fix OF platform depopulate

Message ID 20190111035120.20668-4-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • Untitled series #17726
Related show

Commit Message

Laurent Pinchart Jan. 11, 2019, 3:50 a.m.
From: Tomi Valkeinen <tomi.valkeinen@ti.com>

Commit edb715dffdee ("drm/omap: dss: dsi: Move initialization code from
bind to probe") moved the of_platform_populate() call from dsi_bind() to
dsi_probe(), but failed to move the corresponding
of_platform_depopulate() from dsi_unbind() to dsi_remove(). This results
in OF child devices being potentially removed multiple times. Fix it by
placing the of_platform_depopulate() call where it belongs.

Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tomi Valkeinen Jan. 14, 2019, 11:40 a.m. | #1
On 11/01/19 05:50, Laurent Pinchart wrote:
> From: Tomi Valkeinen <tomi.valkeinen@ti.com>
> 
> Commit edb715dffdee ("drm/omap: dss: dsi: Move initialization code from
> bind to probe") moved the of_platform_populate() call from dsi_bind() to
> dsi_probe(), but failed to move the corresponding
> of_platform_depopulate() from dsi_unbind() to dsi_remove(). This results
> in OF child devices being potentially removed multiple times. Fix it by
> placing the of_platform_depopulate() call where it belongs.
> 
> Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

I'm not sure if you want my signed-off-by or reviewed-by for this and
the next, but you've got it.

 Tomi
Laurent Pinchart Jan. 14, 2019, 2:32 p.m. | #2
Hi Tomi,

On Monday, 14 January 2019 13:40:36 EET Tomi Valkeinen wrote:
> On 11/01/19 05:50, Laurent Pinchart wrote:
> > From: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > 
> > Commit edb715dffdee ("drm/omap: dss: dsi: Move initialization code from
> > bind to probe") moved the of_platform_populate() call from dsi_bind() to
> > dsi_probe(), but failed to move the corresponding
> > of_platform_depopulate() from dsi_unbind() to dsi_remove(). This results
> > in OF child devices being potentially removed multiple times. Fix it by
> > placing the of_platform_depopulate() call where it belongs.
> > 
> > Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from
> > bind to probe") Signed-off-by: Laurent Pinchart
> > <laurent.pinchart@ideasonboard.com> ---
> > 
> >  drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> I'm not sure if you want my signed-off-by or reviewed-by for this and
> the next, but you've got it.

Author SoB is always nice to have :-) Thanks.
Sebastian Reichel Feb. 9, 2019, 2:03 a.m. | #3
Hi,

On Fri, Jan 11, 2019 at 05:50:34AM +0200, Laurent Pinchart wrote:
> From: Tomi Valkeinen <tomi.valkeinen@ti.com>

> 

> Commit edb715dffdee ("drm/omap: dss: dsi: Move initialization code from

> bind to probe") moved the of_platform_populate() call from dsi_bind() to

> dsi_probe(), but failed to move the corresponding

> of_platform_depopulate() from dsi_unbind() to dsi_remove(). This results

> in OF child devices being potentially removed multiple times. Fix it by

> placing the of_platform_depopulate() call where it belongs.

> 

> Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe")

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---


Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>


-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c

> index 277f9dd2ec8c..b5685018d830 100644

> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c

> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c

> @@ -5104,8 +5104,6 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data)

>  	dss_debugfs_remove_file(dsi->debugfs.irqs);

>  	dss_debugfs_remove_file(dsi->debugfs.regs);

>  

> -	of_platform_depopulate(dev);

> -

>  	WARN_ON(dsi->scp_clk_refcount > 0);

>  

>  	dss_pll_unregister(&dsi->pll);

> @@ -5457,6 +5455,8 @@ static int dsi_remove(struct platform_device *pdev)

>  

>  	dsi_uninit_output(dsi);

>  

> +	of_platform_depopulate(&pdev->dev);

> +

>  	pm_runtime_disable(&pdev->dev);

>  

>  	if (dsi->vdds_dsi_reg != NULL && dsi->vdds_dsi_enabled) {

> -- 

> Regards,

> 

> Laurent Pinchart

> 

> _______________________________________________

> dri-devel mailing list

> dri-devel@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 277f9dd2ec8c..b5685018d830 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -5104,8 +5104,6 @@  static void dsi_unbind(struct device *dev, struct device *master, void *data)
 	dss_debugfs_remove_file(dsi->debugfs.irqs);
 	dss_debugfs_remove_file(dsi->debugfs.regs);
 
-	of_platform_depopulate(dev);
-
 	WARN_ON(dsi->scp_clk_refcount > 0);
 
 	dss_pll_unregister(&dsi->pll);
@@ -5457,6 +5455,8 @@  static int dsi_remove(struct platform_device *pdev)
 
 	dsi_uninit_output(dsi);
 
+	of_platform_depopulate(&pdev->dev);
+
 	pm_runtime_disable(&pdev->dev);
 
 	if (dsi->vdds_dsi_reg != NULL && dsi->vdds_dsi_enabled) {