drm/etnaviv: Use drm_dev_unref, not drm_put_dev
Subsystems (7)
PATCH 1/4 drm/etnaviv: Use drm_dev_unref, not drm_put_dev
drm_put_dev is the old midlayer-broken device cleanup function, but etnaviv has a proper unbind function which first unregisters and then drops the final reference. No functional change since drm_dev_unregister happens to be idempotent.
--- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_drv.c +1 -1
@@ -592,7 +592,7 @@ static void etnaviv_unbind(struct device *dev) drm->dev_private =NULL ;kfree (priv); -drm_put_dev (drm); +drm_dev_unref (drm); }static const struct component_master_ops etnaviv_master_ops = {
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 drm/fsl: don't use drm_put_dev
fsl is already fully demidlayered in the probe function, but for convenience stuck with drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +2 -1
@@ -426,7 +426,8 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)clk_disable_unprepare (fsl_dev->clk);clk_unregister (fsl_dev->pix_clk); -drm_put_dev (fsl_dev->drm); +drm_dev_unregister (fsl_dev->drm); +drm_dev_unref (fsl_dev->drm);return 0 ; }
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Lucas Stach
maintainerRe: [PATCH 2/4] drm/fsl: don't use drm_put_dev
Am Donnerstag, den 08.12.2016, 12:07 +0100 schrieb Daniel Vetter:
Quoted 15 lines
fsl is already fully demidlayered in the probe function, but for convenience stuck with
drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.Cc Stefan Agner <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0
-0
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_remove(struct platform_device *pdev) · line 430
Quoted 6 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +2
-1@@ -426,7 +426,8 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)clk_disable_unprepare (fsl_dev->clk);clk_unregister (fsl_dev->pix_clk); -drm_put_dev (fsl_dev->drm); +drm_dev_unregister (fsl_dev->drm); +drm_dev_unref (fsl_dev->drm);
Why not make it work correctly instead of the mechanical change? I.e. move the drm_dev_unregister() up 2 lines.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/4] drm/fsl: don't use drm_put_dev
Quoted 17 lines · Lucas Stach
Am Donnerstag, den 08.12.2016, 12:07 +0100 schrieb Daniel Vetter:
Quoted 16 lines
fsl is already fully demidlayered in the probe function, but for convenience stuck with
drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.Cc Stefan Agner <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0
-0@@ -426,7 +426,8 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)
Quoted 8 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_remove(struct platform_device *pdev) · line 430
Quoted 5 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +2
-1clk_disable_unprepare (fsl_dev->clk);clk_unregister (fsl_dev->pix_clk); -drm_put_dev (fsl_dev->drm); +drm_dev_unregister (fsl_dev->drm); +drm_dev_unref (fsl_dev->drm);Why not make it work correctly instead of the mechanical change? I.e. move the
drm_dev_unregister()up 2 lines.
I have a rebased v2 here which does that, because upstream fsl changed that. Will resend.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/1 drm/fsl: don't use drm_put_dev
In reply to Daniel Vetterfsl is already fully demidlayered in the probe function, but for convenience stuck with drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.
v2: Rebase.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +2 -1
@@ -434,7 +434,8 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev) {struct fsl_dcu_drm_device *fsl_dev =platform_get_drvdata (pdev); -drm_put_dev (fsl_dev->drm); +drm_dev_unregister (fsl_dev->drm); +drm_dev_unref (fsl_dev->drm);clk_disable_unprepare (fsl_dev->clk);clk_unregister (fsl_dev->pix_clk);
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/fsl: don't use drm_put_dev
Am Dienstag, den 13.12.2016, 18:54 +0100 schrieb Daniel Vetter:
Quoted 9 lines
fsl is already fully demidlayered in the probe function, but for convenience stuck with
drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.v2: Rebase.
Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0
-0
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_remove(struct platform_device *pdev) · line 441
Quoted 9 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +2
-1@@ -434,7 +434,8 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev) {struct fsl_dcu_drm_device *fsl_dev =platform_get_drvdata (pdev); -drm_put_dev (fsl_dev->drm); +drm_dev_unregister (fsl_dev->drm); +drm_dev_unref (fsl_dev->drm);clk_disable_unprepare (fsl_dev->clk);clk_unregister (fsl_dev->pix_clk);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/fsl: don't use drm_put_dev
Quoted 5 lines · Lucas Stach
Am Dienstag, den 13.12.2016, 18:54 +0100 schrieb Daniel Vetter:
Quoted 4 lines
fsl is already fully demidlayered in the probe function, but for convenience stuck with
drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.
Quoted 7 lines
Quoted 5 lines
v2: Rebase.
Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>Signed-off-by Daniel Vetter <[email protected]>Reviewed-by Lucas Stach <[email protected]>
Ok, applied this one now too, thanks for your review. -Daniel
Quoted 21 lines
Quoted 19 lines
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +2
-1@@ -434,7 +434,8 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev) {struct fsl_dcu_drm_device *fsl_dev =platform_get_drvdata (pdev); -drm_put_dev (fsl_dev->drm); +drm_dev_unregister (fsl_dev->drm); +drm_dev_unref (fsl_dev->drm);clk_disable_unprepare (fsl_dev->clk);clk_unregister (fsl_dev->pix_clk);
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/fsl: don't use drm_put_dev
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Lucas Stach
Am Dienstag, den 13.12.2016, 18:54 +0100 schrieb Daniel Vetter:
Quoted 4 lines
fsl is already fully demidlayered in the probe function, but for convenience stuck with
drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
v2: Rebase.
Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>Signed-off-by Daniel Vetter <[email protected]>Reviewed-by Lucas Stach <[email protected]>
Sorry for the delay.
Quoted 2 lines
Ok, applied this one now too, thanks for your review. -Daniel
FWIW, just tested it now and looks good to me
--
Stefan
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0
-0@@ -434,7 +434,8 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev) {struct fsl_dcu_drm_device *fsl_dev =platform_get_drvdata (pdev);
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_remove(struct platform_device *pdev) · line 441
Quoted 6 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +2
-1-drm_put_dev (fsl_dev->drm); +drm_dev_unregister (fsl_dev->drm); +drm_dev_unref (fsl_dev->drm);clk_disable_unprepare (fsl_dev->clk);clk_unregister (fsl_dev->pix_clk);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/4 drm/mediatek: don't use drm_put_dev
In reply to Daniel Vetterfsl is already fully demidlayered in the probe function, but for convenience stuck with drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +2 -1
@@ -321,7 +321,8 @@ static void mtk_drm_unbind(struct device *dev) {struct mtk_drm_private *private =dev_get_drvdata (dev); -drm_put_dev (private->drm); +drm_dev_unregister (private->drm); +drm_dev_unref (private->drm); private->drm =NULL ; }
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/4] drm/mediatek: don't use drm_put_dev
Am Donnerstag, den 08.12.2016, 12:07 +0100 schrieb Daniel Vetter:
Quoted 1 line
fsl is already fully demidlayered in the probe function, but for
^ mediatek not fsl-dcu
Quoted 3 lines
convenience stuck with
drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.
I don't really see the benefit here, except you want to get rid of drm_dev_put() completely from the core. But whatever:
Quoted 12 lines
Cc Philipp Zabel <[email protected]>Cc CK Hu <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/mediatek/mtk_drm_drv.c +0
-0
drivers/gpu/drm/mediatek/mtk_drm_drv.c static void mtk_drm_unbind(struct device *dev) · line 328
Quoted 9 lines
drivers/gpu/drm/mediatek/mtk_drm_drv.c +2
-1@@ -321,7 +321,8 @@ static void mtk_drm_unbind(struct device *dev) {struct mtk_drm_private *private =dev_get_drvdata (dev); -drm_put_dev (private->drm); +drm_dev_unregister (private->drm); +drm_dev_unref (private->drm); private->drm =NULL ; }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/4] drm/mediatek: don't use drm_put_dev
Quoted 9 lines · Lucas Stach
Am Donnerstag, den 08.12.2016, 12:07 +0100 schrieb Daniel Vetter:
Quoted 1 line
fsl is already fully demidlayered in the probe function, but for
^ mediatek not fsl-dcu
Quoted 3 lines
convenience stuck with
drm_put_dev. Call the unregister/unref parts separately, to make sure this driver works correct.I don't really see the benefit here, except you want to get rid of
drm_dev_put()completely from the core. But whatever:
Yeah, that's the idea. Also I like probe/remove paths to be symmetric, this achieves this.
Quoted 1 line
Reviewed-by Lucas Stach <[email protected]>
Merged this and the etnaviv patch to drm-misc, thanks for your review. -Daniel
Quoted 24 lines
Quoted 22 lines
Cc Philipp Zabel <[email protected]>Cc CK Hu <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/mediatek/mtk_drm_drv.c +2
-1@@ -321,7 +321,8 @@ static void mtk_drm_unbind(struct device *dev) {struct mtk_drm_private *private =dev_get_drvdata (dev); -drm_put_dev (private->drm); +drm_dev_unregister (private->drm); +drm_dev_unref (private->drm); private->drm =NULL ; }
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/4 drm/vc4: Don't use drm_put_dev
In reply to Daniel Vettervc4 already has a proper load sequence, but the unload one needed some
fixups: First unregister, and last drop the final ref.
--- drivers/gpu/drm/vc4/vc4_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/vc4/vc4_drv.c +3 -1
@@ -277,12 +277,14 @@ static void vc4_drm_unbind(struct device *dev)struct drm_device *drm =platform_get_drvdata (pdev);struct vc4_dev *vc4 =to_vc4_dev (drm); +drm_dev_unregister (drm); +if (vc4->fbdev)drm_fbdev_cma_fini (vc4->fbdev);drm_mode_config_cleanup (drm); -drm_put_dev (drm); +drm_dev_unref (drm); }static const struct component_master_ops vc4_drm_ops = {
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 4/4] drm/vc4: Don't use drm_put_dev
Quoted 5 lines · Daniel Vetter
vc4 already has a proper load sequence, but the unload one needed some
fixups: First unregister, and last drop the final ref.Cc Eric Anholt <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Pulled this one. Thanks!
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am Donnerstag, den 08.12.2016, 12:07 +0100 schrieb Daniel Vetter:
Quoted 9 lines
drm_put_devis the old midlayer-broken device cleanup function, but etnaviv has a proper unbind function which first unregisters and then drops the final reference. No functional change sincedrm_dev_unregisterhappens to be idempotent.Cc Lucas Stach <[email protected]>Cc Russell King <[email protected]>Cc Christian Gmeiner <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/etnaviv/etnaviv_drv.c +0
-0
drivers/gpu/drm/etnaviv/etnaviv_drv.c static void etnaviv_unbind(struct device *dev) · line 598
Quoted 8 lines
drivers/gpu/drm/etnaviv/etnaviv_drv.c +1
-1@@ -592,7 +592,7 @@ static void etnaviv_unbind(struct device *dev) drm->dev_private =NULL ;kfree (priv); -drm_put_dev (drm); +drm_dev_unref (drm); }static const struct component_master_ops etnaviv_master_ops = {
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel