All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling-5C7GfCeVMHo@public.gmane.org>
To: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	"Huang Rui" <ray.huang-5C7GfCeVMHo@public.gmane.org>
Cc: "Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Zhang, Hawking" <Hawking.Zhang-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: fix ib test hang with gfxoff enabled
Date: Fri, 1 Jun 2018 15:01:57 -0400	[thread overview]
Message-ID: <87096349-b8de-8268-3893-d89fb54385bd@amd.com> (raw)
In-Reply-To: <4266ad90-6d02-646e-994b-c492fbdbf0eb-5C7GfCeVMHo@public.gmane.org>

On 2018-06-01 06:09 AM, Christian König wrote:
> Am 01.06.2018 um 11:29 schrieb Huang Rui:
>> On Fri, Jun 01, 2018 at 05:13:49PM +0800, Christian König wrote:
>>> Am 01.06.2018 um 08:41 schrieb Huang Rui:
>>>> After defer the execution of gfx/compute ib tests. However, at that
>>>> time, the
>>>> gfx already go into "mid state" of gfxoff.
>>>>
>>>> PWR_MISC_CNTL_STATUS: PWR_GFXOFF_STATUS field (2:1 bits)
>>>> 0 = GFXOFF.
>>>> 1 = Transition out of GFXOFF state.
>>>> 2 = Not in GFXOFF.
>>>> 3 = Transition into GFXOFF.
>>>>
>>>> If hit the mid state (1 or 3), the doorbell writing interrupt
>>>> cannot wake up the
>>>> gfx back successfully. And the field value is 1 when we issue the
>>>> ib test at
>>>> that, so we got the hang. This is the root cause that we
>>>> encountered the issue.
>>>>
>>>> Meanwhile, we cannot set clockgating of GFX after gfx is already in
>>>> "off" state.
>>>> So here we should move the gfx powergating and gfxoff enabling
>>>> behavior at the
>>>> end of initialization behind ib test and clockgating.
>>> Mhm, that still looks like a only halve backed solution:
>>>
>>> 1. What prevents this bug from happening during "normal" IB submission
>>> from userspace?
>>>
>>> 2. Shouldn't we poll the PWR_MISC_CNTL_STATUS register to make sure we
>>> are not in any transition phase instead?
>>>
>> Yes, right. How about also add polling of PWR_MISC_CNTL_STATUS in
>> amdgpu_ring_commit() behind set_wptr that confirm the status as "0"
>> or "2"?
>
> You could add an end_use() callback for that, but I think we rather
> need to do this in gfx_v9_0_ring_set_wptr_gfx() before we write the
> doorbell.
Isn't testing the status like this is a potential race condition.

Having to do this at all is contrary to the documentation that I've
read. Writing a doorbell should wake up the GFX engine. Are we sure that
we understand the cause of the problem correctly? Does the IB test use
any MMIO? Maybe it's doing an HDP flush using MMIO for a ring that
doesn't support HDP flushing.

Regards,
  Felix


>
> Christian.
>
>>
>> Thanks,
>> Ray
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-06-01 19:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  6:41 [PATCH] drm/amdgpu: fix ib test hang with gfxoff enabled Huang Rui
     [not found] ` <1527835264-31040-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2018-06-01  9:13   ` Christian König
     [not found]     ` <0898687d-fd87-c1d5-d484-f44d4c56d2a6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-06-01  9:29       ` Huang Rui
2018-06-01 10:09         ` Christian König
     [not found]           ` <4266ad90-6d02-646e-994b-c492fbdbf0eb-5C7GfCeVMHo@public.gmane.org>
2018-06-01 19:01             ` Felix Kuehling [this message]
     [not found]               ` <87096349-b8de-8268-3893-d89fb54385bd-5C7GfCeVMHo@public.gmane.org>
2018-06-04  7:52                 ` Huang Rui
2018-06-04  7:53                   ` Christian König

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=87096349-b8de-8268-3893-d89fb54385bd@amd.com \
    --to=felix.kuehling-5c7gfcevmho@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=Hawking.Zhang-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=ray.huang-5C7GfCeVMHo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.