From: "Koenig, Christian" Subject: Re: [PATCH] drm/amdgpu: fix the ib test hang when gfx is in "idle" state Date: Mon, 23 Apr 2018 09:57:06 +0000 Message-ID: References: <1524217255-25968-1-git-send-email-ray.huang@amd.com> , <20180423095228.GA23608@hr-amur2> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0490214358==" Return-path: In-Reply-To: <20180423095228.GA23608@hr-amur2> Content-Language: de-DE List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: "Huang, Ray" Cc: "Deucher, Alexander" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" , "S, Shirish" --===============0490214358== Content-Language: de-DE Content-Type: multipart/alternative; boundary="_000_afda993b2d5041819378f3440b5d633cemailandroidcom_" --_000_afda993b2d5041819378f3440b5d633cemailandroidcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray, Am 23.04.2018 11:47 schrieb Huang Rui : On Fri, Apr 20, 2018 at 05:59:16PM +0800, Koenig, Christian wrote: > Am 20.04.2018 um 11:40 schrieb Huang Rui: > > "aaabaf4 drm/amdgpu: defer test IBs on the rings at boot (V3)" > > Above patch defers the execution of gfx/compute ib tests. However, at t= hat time, > > the gfx may already go into idle state. If "idle" gfx receives command > > submission, it will get hang in the system. So we must add is_gfx_on ch= ecking at > > start of ib tests. > > Do I see that right that you just skip the IB test when the GFX block is > already turned of? In this case that would be a clear NAK. > > BTW: How do you detect that we need to turn GFX on again? Christian, I know point. But there is a hang issue if we would like try to disable/enable gfxoff with SMC message at runtime. Actually, I am trying to find a good sequence to fix it. After that, I can even expose an debugfs interface to configure that. So I have to skip the test for the moment when gfx is in "idle". Working around that issue for the moment is ok, but please note that explic= itly in both the commit message and a code comment. But don't you run into the same problem when the UMD starts to submit comma= nds? I mean the idea of the IB test is that you "simulate" an userspace command = submission and see if it works. Regards, Christian. Thanks, Ray On Fri, Apr 20, 2018 at 05:59:16PM +0800, Koenig, Christian wrote: > Am 20.04.2018 um 11:40 schrieb Huang Rui: > > "aaabaf4 drm/amdgpu: defer test IBs on the rings at boot (V3)" > > Above patch defers the execution of gfx/compute ib tests. However, at t= hat time, > > the gfx may already go into idle state. If "idle" gfx receives command > > submission, it will get hang in the system. So we must add is_gfx_on ch= ecking at > > start of ib tests. > > Do I see that right that you just skip the IB test when the GFX block is > already turned of? In this case that would be a clear NAK. > > BTW: How do you detect that we need to turn GFX on again? Christian, I know point. But there is a hang issue if we would like try to disable/enable gfxoff with SMC message at runtime. Actually, I am trying to find a good sequence to fix it. After that, I can even expose an debugfs interface to configure that. So I have to skip the test for the moment when gfx is in "idle". Thanks, Ray --_000_afda993b2d5041819378f3440b5d633cemailandroidcom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi Ray,

Am 23.04.2018 11:47 schrieb Huang Rui <ray.= huang-5C7GfCeVMHo@public.gmane.org>:
On Fri, Apr 20, 2018 at 05:59:16PM +0800, Koenig, Christian wrote:=
> Am 20.04.2018 um 11:40 schrieb Huang Rui:
> > "aaabaf4   drm/amdgpu: defer test IBs on the rings= at boot (V3)"
> > Above patch defers the execution of gfx/compute ib tests. However= , at that time,
> > the gfx may already go into idle state. If "idle" gfx r= eceives command
> > submission, it will get hang in the system. So we must add is_gfx= _on checking at
> > start of ib tests.
>
> Do I see that right that you just skip the IB test when the GFX block = is
> already turned of? In this case that would be a clear NAK.
>
> BTW: How do you detect that we need to turn GFX on again?

Christian, I know point. But there is a hang issue if we would like try to<= br> disable/enable gfxoff with SMC message at runtime. Actually, I am trying to=
find a good sequence to fix it. After that, I can even expose an debugfs interface to configure that. So I have to skip the test for the moment when=
gfx is in "idle".

Working around that issue for the moment is ok, but pleas= e note that explicitly in both the commit message and a code comment.

But don't you run into the same problem when the UMD star= ts to submit commands?

I mean the idea of the IB test is that you "simulate= " an userspace command submission and see if it works.

Regards,
Christian.


Thanks,
Ray

On Fri, Apr 20, 2018 at 05:59:16PM +0800, Koen= ig, Christian wrote:
> Am 20.04.2018 um 11:40 schrieb Huang Rui:
> > "aaabaf4   drm/amdgpu: defer test IBs on the rings= at boot (V3)"
> > Above patch defers the execution of gfx/compute ib tests. However= , at that time,
> > the gfx may already go into idle state. If "idle" gfx r= eceives command
> > submission, it will get hang in the system. So we must add is_gfx= _on checking at
> > start of ib tests.
>
> Do I see that right that you just skip the IB test when the GFX block = is
> already turned of? In this case that would be a clear NAK.
>
> BTW: How do you detect that we need to turn GFX on again?

Christian, I know point. But there is a hang issue if we would like try to<= br> disable/enable gfxoff with SMC message at runtime. Actually, I am trying to=
find a good sequence to fix it. After that, I can even expose an debugfs interface to configure that. So I have to skip the test for the moment when=
gfx is in "idle".

Thanks,
Ray
--_000_afda993b2d5041819378f3440b5d633cemailandroidcom_-- --===============0490214358== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============0490214358==--