From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH] drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV Date: Tue, 17 Apr 2018 17:26:41 +0200 Message-ID: <0cf6dae0-afae-c858-73af-ab47673a7d8a@gmail.com> References: <20180417130135.1895-1-christian.koenig@amd.com> Reply-To: christian.koenig-5C7GfCeVMHo@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0389292229==" Return-path: In-Reply-To: Content-Language: en-US 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: "Deucher, Alexander" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" , "Deng, Emily" , "Liu, Monk" This is a multi-part message in MIME format. --===============0389292229== Content-Type: multipart/alternative; boundary="------------BCB105D82FA74AF6D71744BF" Content-Language: en-US This is a multi-part message in MIME format. --------------BCB105D82FA74AF6D71744BF Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit > Does this actually work on SR-IOV? Or does it just seem to but nothing > bad happens because we get a GPU reset on a world switch? I honestly don't know. I think that SR-IOV uses a specialized firmware where this packet has a different meaning. But the real fix would be to get the RLC firmware fix to not reinitialize those regs to zero on world switch. Christian. Am 17.04.2018 um 16:02 schrieb Deucher, Alexander: > > Does this actually work on SR-IOV?  Or does it just seem to but > nothing bad happens because we get a GPU reset on a world switch?  The > behavior of this packet should be the same as SDMA and that definitely > doesn't work.  I don't see why this would be any different. > > > Acked-by: Alex Deucher > > > Alex > > ------------------------------------------------------------------------ > *From:* amd-gfx on behalf of > Christian König > *Sent:* Tuesday, April 17, 2018 9:01:35 AM > *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > *Subject:* [PATCH] drm/amdgpu: limit reg_write_reg_wait workaround to > SRIOV > Turned out that this locks up some bare metal Vega10. > > Signed-off-by: Christian König > --- >  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++++++- >  1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > index 583f6f616dd3..5329d7e5fb71 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > @@ -4144,7 +4144,12 @@ static void > gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, >  { >          int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX); > > -       gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, > mask, 0x20); > +       if (amdgpu_sriov_vf(adev)) > +               gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, > +                                     ref, mask, 0x20); > +       else > + amdgpu_ring_emit_reg_write_reg_wait_helper(ring, reg0, reg1, > + ref, mask); >  } > >  static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device > *adev, > -- > 2.14.1 > > _______________________________________________ > amd-gfx mailing list > amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx --------------BCB105D82FA74AF6D71744BF Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit
Does this actually work on SR-IOV? Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch?
I honestly don't know. I think that SR-IOV uses a specialized firmware where this packet has a different meaning.

But the real fix would be to get the RLC firmware fix to not reinitialize those regs to zero on world switch.

Christian.

Am 17.04.2018 um 16:02 schrieb Deucher, Alexander:

Does this actually work on SR-IOV?  Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch?  The behavior of this packet should be the same as SDMA and that definitely doesn't work.  I don't see why this would be any different.


Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>


Alex


From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Tuesday, April 17, 2018 9:01:35 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH] drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV
 
Turned out that this locks up some bare metal Vega10.

Signed-off-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 583f6f616dd3..5329d7e5fb71 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -4144,7 +4144,12 @@ static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
 {
         int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
 
-       gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
+       if (amdgpu_sriov_vf(adev))
+               gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1,
+                                     ref, mask, 0x20);
+       else
+               amdgpu_ring_emit_reg_write_reg_wait_helper(ring, reg0, reg1,
+                                                          ref, mask);
 }
 
 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
--
2.14.1

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

--------------BCB105D82FA74AF6D71744BF-- --===============0389292229== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============0389292229==--