linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Grodzovsky, Andrey" <Andrey.Grodzovsky@amd.com>
To: Neil Armstrong <narmstrong@baylibre.com>,
	Hillf Danton <hdanton@sina.com>
Cc: Rob Herring <robh@kernel.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"steven.price@arm.com" <steven.price@arm.com>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	Erico Nunes <nunes.erico@gmail.com>
Subject: Re: drm_sched with panfrost crash on T820
Date: Fri, 4 Oct 2019 14:53:31 +0000	[thread overview]
Message-ID: <94096e4e-0f60-79d1-69b5-c7c3e59a4d78@amd.com> (raw)
In-Reply-To: <7339b7a1-2d1c-4379-89a0-daf8b28d81c8@baylibre.com>


On 10/3/19 4:34 AM, Neil Armstrong wrote:
> Hi Andrey,
>
> Le 02/10/2019 à 16:40, Grodzovsky, Andrey a écrit :
>> On 9/30/19 10:52 AM, Hillf Danton wrote:
>>> On Mon, 30 Sep 2019 11:17:45 +0200 Neil Armstrong wrote:
>>>> Did a new run from 5.3:
>>>>
>>>> [   35.971972] Call trace:
>>>> [   35.974391]  drm_sched_increase_karma+0x5c/0xf0
>>>> 			ffff000010667f38	FFFF000010667F94
>>>> 			drivers/gpu/drm/scheduler/sched_main.c:335
>>>>
>>>> The crashing line is :
>>>>                                   if (bad->s_fence->scheduled.context ==
>>>>                                       entity->fence_context) {
>>>>
>>>> Doesn't seem related to guilty job.
>>> Bail out if s_fence is no longer fresh.
>>>
>>> --- a/drivers/gpu/drm/scheduler/sched_main.c
>>> +++ b/drivers/gpu/drm/scheduler/sched_main.c
>>> @@ -333,6 +333,10 @@ void drm_sched_increase_karma(struct drm
>>>    
>>>    			spin_lock(&rq->lock);
>>>    			list_for_each_entry_safe(entity, tmp, &rq->entities, list) {
>>> +				if (!smp_load_acquire(&bad->s_fence)) {
>>> +					spin_unlock(&rq->lock);
>>> +					return;
>>> +				}
>>>    				if (bad->s_fence->scheduled.context ==
>>>    				    entity->fence_context) {
>>>    					if (atomic_read(&bad->karma) >
>>> @@ -543,7 +547,7 @@ EXPORT_SYMBOL(drm_sched_job_init);
>>>    void drm_sched_job_cleanup(struct drm_sched_job *job)
>>>    {
>>>    	dma_fence_put(&job->s_fence->finished);
>>> -	job->s_fence = NULL;
>>> +	smp_store_release(&job->s_fence, 0);
>>>    }
>>>    EXPORT_SYMBOL(drm_sched_job_cleanup);
> This fixed the problem on the 10 CI runs.
>
> Neil


These are good news but I still fail to see how this fixes the problem - 
Hillf, do you mind explaining how you came up with this particular fix - 
what was the bug you saw ?

Andrey

>
>> Does this change help the problem ? Note that drm_sched_job_cleanup is
>> called from scheduler thread which is stopped at all times when work_tdr
>> thread is running and anyway the 'bad' job is still in the
>> ring_mirror_list while it's being accessed from
>> drm_sched_increase_karma so I don't think drm_sched_job_cleanup can be
>> called for it BEFORE or while drm_sched_increase_karma is executed.
>>
>> Andrey
>>
>>
>>>    
>>> --
>>>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2019-10-04 14:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27  8:12 drm_sched with panfrost crash on T820 Neil Armstrong
2019-09-27  9:55 ` Steven Price
2019-09-27 10:48   ` Steven Price
2019-09-27 11:27     ` Neil Armstrong
2019-09-27 11:48       ` Neil Armstrong
2019-09-27 15:00         ` Steven Price
2019-09-27 15:20           ` Neil Armstrong
2019-09-30 13:18           ` Neil Armstrong
2019-09-27 20:55 ` Grodzovsky, Andrey
2019-09-30  9:17   ` Neil Armstrong
2019-10-02 16:53     ` Grodzovsky, Andrey
2019-10-03  8:36       ` Neil Armstrong
2019-09-30 14:52   ` Hillf Danton
2019-10-02 14:40     ` Grodzovsky, Andrey
2019-10-02 14:44       ` Neil Armstrong
2019-10-03  8:34       ` Neil Armstrong
2019-10-04 14:53         ` Grodzovsky, Andrey [this message]
2019-10-04 15:03           ` Neil Armstrong
2019-10-04 15:27             ` Steven Price
2019-10-04 15:34               ` Koenig, Christian
2019-10-04 16:02                 ` Steven Price
     [not found] <8e003dfd-2761-4941-8b5b-ecc186222229@email.android.com>
2019-10-07 12:47 ` Steven Price

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=94096e4e-0f60-79d1-69b5-c7c3e59a4d78@amd.com \
    --to=andrey.grodzovsky@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdanton@sina.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=nunes.erico@gmail.com \
    --cc=robh@kernel.org \
    --cc=steven.price@arm.com \
    --cc=tomeu.vizoso@collabora.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).