intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Vincent Abriou <vincent.abriou@st.com>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 12/18] drm/sti: Use drm_atomic_helper_shutdown
Date: Wed, 3 Oct 2018 16:07:26 +0300	[thread overview]
Message-ID: <20181003130726.GM9144@intel.com> (raw)
In-Reply-To: <20181003091732.25164-1-daniel.vetter@ffwll.ch>

On Wed, Oct 03, 2018 at 11:17:26AM +0200, Daniel Vetter wrote:
> drm_plane_helper_disable is a non-atomic drivers only function, and
> will blow up (since no one passes the locking context it needs).
> 
> Atomic drivers which want to quiescent their hw on unload should
> use drm_atomic_helper_shutdown() instead.
> 
> The sti cleanup code seems supremely confused:
> - In the load error path it calls drm_mode_config_cleanup before it
>   stops various kms services like poll worker or fbdev emulation.
>   That's going to oops.
> - The actual unload code doesn't even bother with the cleanup and just
>   leaks.
> 
> Try to fix this while at it.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> Cc: Vincent Abriou <vincent.abriou@st.com>
> ---
>  drivers/gpu/drm/sti/sti_cursor.c | 1 -
>  drivers/gpu/drm/sti/sti_drv.c    | 6 +++---
>  drivers/gpu/drm/sti/sti_gdp.c    | 1 -
>  drivers/gpu/drm/sti/sti_hqvdp.c  | 1 -
>  4 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
> index 57b870e1e696..bc908453ffb3 100644
> --- a/drivers/gpu/drm/sti/sti_cursor.c
> +++ b/drivers/gpu/drm/sti/sti_cursor.c
> @@ -332,7 +332,6 @@ static void sti_cursor_destroy(struct drm_plane *drm_plane)
>  {
>  	DRM_DEBUG_DRIVER("\n");
>  
> -	drm_plane_helper_disable(drm_plane, NULL);
>  	drm_plane_cleanup(drm_plane);
>  }
>  
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 6dced8abcf16..ac54e0f9caea 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -206,6 +206,8 @@ static void sti_cleanup(struct drm_device *ddev)
>  	struct sti_private *private = ddev->dev_private;
>  
>  	drm_kms_helper_poll_fini(ddev);
> +	drm_atomic_helper_shutdown(ddev);
> +	drm_mode_config_cleanup(ddev);

Looks like a more sane ordering. Not really sure how these component
based drivers work so probably not the best person to judge this,
but based on my weak understanding
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  	component_unbind_all(ddev->dev, ddev);
>  	kfree(private);
>  	ddev->dev_private = NULL;
> @@ -230,7 +232,7 @@ static int sti_bind(struct device *dev)
>  
>  	ret = drm_dev_register(ddev, 0);
>  	if (ret)
> -		goto err_register;
> +		goto err_cleanup;
>  
>  	drm_mode_config_reset(ddev);
>  
> @@ -238,8 +240,6 @@ static int sti_bind(struct device *dev)
>  
>  	return 0;
>  
> -err_register:
> -	drm_mode_config_cleanup(ddev);
>  err_cleanup:
>  	sti_cleanup(ddev);
>  err_drm_dev_put:
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index c32de6cbf061..3c19614d3f75 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -883,7 +883,6 @@ static void sti_gdp_destroy(struct drm_plane *drm_plane)
>  {
>  	DRM_DEBUG_DRIVER("\n");
>  
> -	drm_plane_helper_disable(drm_plane, NULL);
>  	drm_plane_cleanup(drm_plane);
>  }
>  
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 03ac3b4a4469..23565f52dd71 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -1260,7 +1260,6 @@ static void sti_hqvdp_destroy(struct drm_plane *drm_plane)
>  {
>  	DRM_DEBUG_DRIVER("\n");
>  
> -	drm_plane_helper_disable(drm_plane, NULL);
>  	drm_plane_cleanup(drm_plane);
>  }
>  
> -- 
> 2.19.0.rc2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-03 13:07 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 13:35 [PATCH 00/18] atomic helper cleanups Daniel Vetter
2018-10-02 13:35 ` [PATCH 01/18] drm/amdgpu: Remove default best_encoder hook from DC Daniel Vetter
2018-10-02 13:35 ` [PATCH 02/18] drm/atomic-helper: Unexport drm_atomic_helper_best_encoder Daniel Vetter
2018-10-02 13:53   ` Laurent Pinchart
2018-10-03  9:08     ` Daniel Vetter
2018-10-04 17:13       ` Laurent Pinchart
2018-10-04 18:33   ` Sean Paul
2018-10-04 19:33     ` [Intel-gfx] " Daniel Vetter
2018-10-02 13:35 ` [PATCH 03/18] drm: Extract drm_atomic_state_helper.[hc] Daniel Vetter
2018-10-02 15:40   ` Ville Syrjälä
2018-10-03  9:10     ` Daniel Vetter
2018-10-02 13:35 ` [PATCH 04/18] drm/vmwgfx: Remove confused comment from vmw_du_connector_atomic_set_property Daniel Vetter
2018-10-02 15:15   ` Ville Syrjälä
2018-10-02 16:36     ` [Intel-gfx] " Thomas Hellstrom
2018-10-02 17:02       ` Ville Syrjälä
2018-10-04 20:03       ` [Intel-gfx] " Daniel Vetter
2018-10-02 13:35 ` [PATCH 05/18] drm/vmwgfx: Don't look at state->allow_modeset Daniel Vetter
2018-10-02 13:35 ` [PATCH 06/18] drm/atomic: Improve docs for drm_atomic_state->allow_modeset Daniel Vetter
2018-10-02 15:40   ` Ville Syrjälä
2018-10-02 13:35 ` [PATCH 07/18] drm/vmwgfx: Add FIXME comments for customer page_flip handlers Daniel Vetter
2018-10-02 16:49   ` Thomas Hellstrom
2018-10-03  9:11     ` Daniel Vetter
2018-10-02 13:35 ` [PATCH 08/18] drm/arcpgu: Drop transitional hooks Daniel Vetter
2018-10-02 15:34   ` Ville Syrjälä
2018-10-03  9:20     ` [Intel-gfx] " Daniel Vetter
2018-10-02 13:35 ` [PATCH 09/18] drm/atmel: " Daniel Vetter
2018-10-02 15:34   ` [Intel-gfx] " Ville Syrjälä
2018-10-02 13:35 ` [PATCH 10/18] drm/arcpgu: Use drm_atomic_helper_shutdown Daniel Vetter
2018-10-02 15:39   ` Ville Syrjälä
2018-10-03  9:16 ` [PATCH 11/18] drm/msm: " Daniel Vetter
2018-10-03 13:01   ` Ville Syrjälä
2018-10-03  9:17 ` [PATCH 12/18] drm/sti: " Daniel Vetter
2018-10-03 13:07   ` Ville Syrjälä [this message]
2018-10-03  9:18 ` [PATCH 13/18] drm/vc4: " Daniel Vetter
2018-10-03  9:18   ` [PATCH 14/18] drm/zte: " Daniel Vetter
2018-10-03 13:08     ` Ville Syrjälä
2018-10-03  9:18   ` [PATCH 15/18] drm: Remove transitional helpers Daniel Vetter
2018-10-03 13:11     ` [Intel-gfx] " Ville Syrjälä
2018-10-03  9:18   ` [PATCH 16/18] drm/vmwgfx: Fix vmw_du_cursor_plane_atomic_check Daniel Vetter
2018-10-03 13:12     ` Ville Syrjälä
2018-10-03  9:18   ` [PATCH 17/18] drm: Unexport drm_plane_helper_check_update Daniel Vetter
2018-10-04 20:30     ` Ville Syrjälä
2018-10-03  9:18   ` [PATCH 18/18] drm: Unexport primary plane helpers Daniel Vetter
2018-10-03 13:15     ` Ville Syrjälä
2018-10-03 13:08   ` [PATCH 13/18] drm/vc4: Use drm_atomic_helper_shutdown Ville Syrjälä
2018-10-03 20:31   ` Eric Anholt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181003130726.GM9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vincent.abriou@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).