From: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
To: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH v2 1/5] drm/msm: destroy msm threads after config cleanup
Date: Wed, 7 Nov 2018 10:42:48 -0500 [thread overview]
Message-ID: <20181107154248.GY154160@art_vandelay> (raw)
In-Reply-To: <1541543790-748-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
On Tue, Nov 06, 2018 at 02:36:26PM -0800, Jeykumar Sankaran wrote:
> To avoid any possible work queues to msm threads, clean up
> the threads after the CRTC objects are released in
> config cleanup.
>
> changes in v2:
> - fix race condition before kthread flush and stop (Sean Paul)
> - use kthread_destroy_worker for cleaning up kthread (Sean Paul)
>
> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
> ---
> drivers/gpu/drm/msm/msm_drv.c | 36 +++++++++++++++++-------------------
> 1 file changed, 17 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 9c9f7ff..e913059 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -278,6 +278,21 @@ static int msm_drm_uninit(struct device *dev)
> * work before drm_irq_uninstall() to avoid work re-enabling an
> * irq after uninstall has disabled it.
> */
> + msm_gem_shrinker_cleanup(ddev);
> +
> + drm_kms_helper_poll_fini(ddev);
> +
> + drm_dev_unregister(ddev);
> +
> + msm_perf_debugfs_cleanup(priv);
> + msm_rd_debugfs_cleanup(priv);
> +
> +#ifdef CONFIG_DRM_FBDEV_EMULATION
> + if (fbdev && priv->fbdev)
> + msm_fbdev_free(ddev);
> +#endif
> + drm_mode_config_cleanup(ddev);
> +
> kthread_flush_work(&vbl_ctrl->work);
What happens in the vbl_ctrl thread when it runs with drm resources cleaned up?
Sean
> list_for_each_entry_safe(vbl_ev, tmp, &vbl_ctrl->event_list, node) {
> list_del(&vbl_ev->node);
> @@ -287,33 +302,16 @@ static int msm_drm_uninit(struct device *dev)
> /* clean up display commit/event worker threads */
> for (i = 0; i < priv->num_crtcs; i++) {
> if (priv->disp_thread[i].thread) {
> - kthread_flush_worker(&priv->disp_thread[i].worker);
> - kthread_stop(priv->disp_thread[i].thread);
> + kthread_destroy_worker(&priv->disp_thread[i].worker);
> priv->disp_thread[i].thread = NULL;
> }
>
> if (priv->event_thread[i].thread) {
> - kthread_flush_worker(&priv->event_thread[i].worker);
> - kthread_stop(priv->event_thread[i].thread);
> + kthread_destroy_worker(&priv->event_thread[i].worker);
> priv->event_thread[i].thread = NULL;
> }
> }
>
> - msm_gem_shrinker_cleanup(ddev);
> -
> - drm_kms_helper_poll_fini(ddev);
> -
> - drm_dev_unregister(ddev);
> -
> - msm_perf_debugfs_cleanup(priv);
> - msm_rd_debugfs_cleanup(priv);
> -
> -#ifdef CONFIG_DRM_FBDEV_EMULATION
> - if (fbdev && priv->fbdev)
> - msm_fbdev_free(ddev);
> -#endif
> - drm_mode_config_cleanup(ddev);
> -
> pm_runtime_get_sync(dev);
> drm_irq_uninstall(ddev);
> pm_runtime_put_sync(dev);
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-11-07 15:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 22:36 [PATCH v2 1/5] drm/msm: destroy msm threads after config cleanup Jeykumar Sankaran
[not found] ` <1541543790-748-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 22:36 ` [PATCH v2 2/5] drm/msm/dpu: use system wq for vblank events Jeykumar Sankaran
2018-11-06 22:36 ` [PATCH v2 4/5] drm/msm: clean up display thread Jeykumar Sankaran
2018-11-06 22:36 ` [PATCH v2 5/5] drm/msm: subclass work object for vblank events Jeykumar Sankaran
[not found] ` <1541543790-748-5-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 23:15 ` Jordan Crouse
2018-11-07 15:55 ` Sean Paul
2018-11-20 22:04 ` Jeykumar Sankaran
[not found] ` <86c75419b86da1a3f538638ef0004203-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-29 22:15 ` Sean Paul
2018-11-30 19:45 ` Jeykumar Sankaran
[not found] ` <126d5b3a93c1827aaf10cd64486d4967-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-30 20:07 ` Sean Paul
2018-12-01 0:21 ` Jeykumar Sankaran
[not found] ` <e50d359b8cdd5fd0ccc975a791f65847-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-03 14:21 ` Sean Paul
2018-12-03 20:27 ` Jeykumar Sankaran
2018-12-07 17:22 ` [Freedreno] " Sean Paul
2018-12-07 23:23 ` Jeykumar Sankaran
2018-12-06 18:56 ` Jeykumar Sankaran
2018-12-07 2:32 ` [Freedreno] " Jeykumar Sankaran
2018-11-07 15:42 ` Sean Paul [this message]
2018-11-06 22:36 ` [PATCH v2 3/5] drm/msm/dpu: use system wq for idle power collapse Jeykumar Sankaran
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=20181107154248.GY154160@art_vandelay \
--to=sean-p7ytbzm4h96eqtr555yldq@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
/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