[v2] drm/amdgpu/sriov: Only sriov runtime support use kiq

Submitted by Deng, Emily on Aug. 21, 2018, 5:16 a.m.

Details

Message ID 1534828612-6608-1-git-send-email-Emily.Deng@amd.com
State New
Headers show
Series "drm/amdgpu/sriov: Only sriov runtime support use kiq" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Deng, Emily Aug. 21, 2018, 5:16 a.m.
Refine the code style, add brackets.

For sriov, don't use kiq in exclusive mode, as don't know how long time
it will take, some times it will occur exclusive timeout.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index f71615e..adfd0bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -320,7 +320,7 @@  signed long  amdgpu_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
 	struct amdgpu_kiq *kiq = &adev->gfx.kiq;
 	struct amdgpu_ring *ring = &kiq->ring;
 
-	if (!ring->ready)
+	if (!ring->ready || (!amdgpu_sriov_runtime(adev) && amdgpu_sriov_vf(adev)))
 		return -EINVAL;
 
 	spin_lock_irqsave(&kiq->ring_lock, flags);

Comments

Am 21.08.2018 um 07:16 schrieb Emily Deng:
> Refine the code style, add brackets.
>
> For sriov, don't use kiq in exclusive mode, as don't know how long time
> it will take, some times it will occur exclusive timeout.
>
> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index f71615e..adfd0bd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -320,7 +320,7 @@ signed long  amdgpu_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
>   	struct amdgpu_kiq *kiq = &adev->gfx.kiq;
>   	struct amdgpu_ring *ring = &kiq->ring;
>   
> -	if (!ring->ready)
> +	if (!ring->ready || (!amdgpu_sriov_runtime(adev) && amdgpu_sriov_vf(adev)))

Please rework the code flow a bit to make it more obvious what happens here.

E.g. move the check into the caller instead of returning an error code here.

Christian.

>   		return -EINVAL;
>   
>   	spin_lock_irqsave(&kiq->ring_lock, flags);
>-----Original Message-----

>From: Christian König <ckoenig.leichtzumerken@gmail.com>

>Sent: Tuesday, August 21, 2018 3:51 PM

>To: Deng, Emily <Emily.Deng@amd.com>; amd-gfx@lists.freedesktop.org

>Subject: Re: [PATCH v2] drm/amdgpu/sriov: Only sriov runtime support use kiq

>

>Am 21.08.2018 um 07:16 schrieb Emily Deng:

>> Refine the code style, add brackets.

>>

>> For sriov, don't use kiq in exclusive mode, as don't know how long

>> time it will take, some times it will occur exclusive timeout.

>>

>> Signed-off-by: Emily Deng <Emily.Deng@amd.com>

>> ---

>>   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +-

>>   1 file changed, 1 insertion(+), 1 deletion(-)

>>

>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

>> b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

>> index f71615e..adfd0bd 100644

>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

>> @@ -320,7 +320,7 @@ signed long  amdgpu_kiq_reg_write_reg_wait(struct

>amdgpu_device *adev,

>>   	struct amdgpu_kiq *kiq = &adev->gfx.kiq;

>>   	struct amdgpu_ring *ring = &kiq->ring;

>>

>> -	if (!ring->ready)

>> +	if (!ring->ready || (!amdgpu_sriov_runtime(adev) &&

>> +amdgpu_sriov_vf(adev)))

>

>Please rework the code flow a bit to make it more obvious what happens here.

>

>E.g. move the check into the caller instead of returning an error code here.

Thanks, will refine.

>Christian.

>

>>   		return -EINVAL;

>>

>>   	spin_lock_irqsave(&kiq->ring_lock, flags);