public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
To: Sharat Masetty <smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 1/2] drm/scheduler: Set sched->thread to NULL on failure
Date: Thu, 29 Nov 2018 16:04:21 +0000	[thread overview]
Message-ID: <ae80e58f-06f8-320f-bf1c-06a8ba05e40b@amd.com> (raw)
In-Reply-To: <1543485920-28037-1-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

Am 29.11.18 um 11:05 schrieb Sharat Masetty:
> In cases where the scheduler instance is used as a base object of another
> driver object, it's not clear if the driver can call scheduler cleanup on the
> fail path. So, Set the sched->thread to NULL, so that the driver can safely
> call drm_sched_fini() during cleanup.
>
> Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index 44fe587..c993d10 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -594,7 +594,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
>   		   long timeout,
>   		   const char *name)
>   {
> -	int i;
> +	int i, ret;
>   	sched->ops = ops;
>   	sched->hw_submission_limit = hw_submission;
>   	sched->name = name;
> @@ -615,8 +615,10 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
>   	/* Each scheduler will run on a seperate kernel thread */
>   	sched->thread = kthread_run(drm_sched_main, sched, sched->name);
>   	if (IS_ERR(sched->thread)) {
> +		ret = PTR_ERR(sched->thread);
> +		sched->thread = NULL;
>   		DRM_ERROR("Failed to create scheduler for %s.\n", name);
> -		return PTR_ERR(sched->thread);
> +		return ret;
>   	}
>   
>   	return 0;

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2018-11-29 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 10:05 [PATCH 1/2] drm/scheduler: Set sched->thread to NULL on failure Sharat Masetty
     [not found] ` <1543485920-28037-1-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-29 10:05   ` [PATCH 2/2] drm/scheduler: Add drm_sched_suspend/resume_timeout() Sharat Masetty
     [not found]     ` <1543485920-28037-2-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-29 16:07       ` Koenig, Christian
2018-11-29 16:04   ` Koenig, Christian [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-11-02 10:31 [PATCH 1/2] drm/scheduler: Set sched->thread to NULL on failure Sharat Masetty

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=ae80e58f-06f8-320f-bf1c-06a8ba05e40b@amd.com \
    --to=christian.koenig-5c7gfcevmho@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smasetty-sgV2jX0FEOL9JmXXK+q4OQ@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