drm/amdgpu: Fix wait for RLCG command completion
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix wait for RLCG command completion
if (!(tmp & flag)) condition will always evaluate to true when the flag is 0x0 (AMDGPU_RLCG_GC_WRITE). Instead check that address bits are cleared to determine whether the command is complete.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -1
@@ -902,7 +902,7 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 vfor (i =0 ; i < timeout; i++) { tmp =readl (scratch_reg1); -if (!(tmp & flag)) +if (!(tmp &AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK ))break ;udelay (10 ); }
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -0
@@ -43,6 +43,8 @@#define AMDGPU_RLCG_WRONG_OPERATION_TYPE 0x2000000#define AMDGPU_RLCG_REG_NOT_IN_RANGE 0x1000000 +#define AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK 0xFFFFF +/* all asic after AI use this offset */ #define mmRCC_IOV_FUNC_IDENTIFIER 0xDE5/* tonga/fiji use this offset */
Signature · 1 line
2.25.1
[AMD Official Use Only]
The test configuration is 8VF with 100 loops of VM reboot.
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Victor Skvortsov
Sent: Thursday, February 3, 2022 4:25 PM
To: [email protected]
Cc: Skvortsov, Victor <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix wait for RLCG command completion
if (!(tmp & flag)) condition will always evaluate to true when the flag is 0x0 (AMDGPU_RLCG_GC_WRITE). Instead check that address bits are cleared to determine whether the command is complete.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -1
@@ -902,7 +902,7 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 vfor (i =0 ; i < timeout; i++) { tmp =readl (scratch_reg1); -if (!(tmp & flag)) +if (!(tmp &AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK ))break ;udelay (10 ); }
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -1
@@ -43,6 +43,8 @@#define AMDGPU_RLCG_WRONG_OPERATION_TYPE 0x2000000#define AMDGPU_RLCG_REG_NOT_IN_RANGE 0x1000000 +#define AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK 0xFFFFF +/* all asic after AI use this offset */ #define mmRCC_IOV_FUNC_IDENTIFIER 0xDE5/* tonga/fiji use this offset */ --
2.25.1
Skvortsov, Victor
Tested-by Bokun Zhang[AMD Official Use Only]
+Shaoyun
-----Original Message-----
From: Zhang, Bokun <[email protected]>
Sent: Monday, February 14, 2022 4:09 PM
To: Skvortsov, Victor <[email protected]>; [email protected]
Cc: Skvortsov, Victor <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Fix wait for RLCG command completion
[AMD Official Use Only]
The test configuration is 8VF with 100 loops of VM reboot.
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Victor Skvortsov
Sent: Thursday, February 3, 2022 4:25 PM
To: [email protected]
Cc: Skvortsov, Victor <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix wait for RLCG command completion
if (!(tmp & flag)) condition will always evaluate to true when the flag is 0x0 (AMDGPU_RLCG_GC_WRITE). Instead check that address bits are cleared to determine whether the command is complete.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -1
@@ -902,7 +902,7 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 vfor (i =0 ; i < timeout; i++) { tmp =readl (scratch_reg1); -if (!(tmp & flag)) +if (!(tmp &AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK ))break ;udelay (10 ); }
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -1
@@ -43,6 +43,8 @@#define AMDGPU_RLCG_WRONG_OPERATION_TYPE 0x2000000#define AMDGPU_RLCG_REG_NOT_IN_RANGE 0x1000000 +#define AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK 0xFFFFF +/* all asic after AI use this offset */ #define mmRCC_IOV_FUNC_IDENTIFIER 0xDE5/* tonga/fiji use this offset */ --
2.25.1
Liu, Shaoyun
Tested-by Bokun Zhang[AMD Official Use Only]
So driver will use the flag on write but use the new way to check on read.
Looks good to me . Reviewed by : Shaoyun.liu <[email protected]>
-----Original Message-----
From: Skvortsov, Victor <[email protected]>
Sent: Tuesday, February 15, 2022 10:54 AM
To: Zhang, Bokun <[email protected]>; [email protected]; Liu, Shaoyun <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Fix wait for RLCG command completion
[AMD Official Use Only]
+Shaoyun
-----Original Message-----
From: Zhang, Bokun <[email protected]>
Sent: Monday, February 14, 2022 4:09 PM
To: Skvortsov, Victor <[email protected]>; [email protected]
Cc: Skvortsov, Victor <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Fix wait for RLCG command completion
[AMD Official Use Only]
The test configuration is 8VF with 100 loops of VM reboot.
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Victor Skvortsov
Sent: Thursday, February 3, 2022 4:25 PM
To: [email protected]
Cc: Skvortsov, Victor <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix wait for RLCG command completion
if (!(tmp & flag)) condition will always evaluate to true when the flag is 0x0 (AMDGPU_RLCG_GC_WRITE). Instead check that address bits are cleared to determine whether the command is complete.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -1
@@ -902,7 +902,7 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 vfor (i =0 ; i < timeout; i++) { tmp =readl (scratch_reg1); -if (!(tmp & flag)) +if (!(tmp &AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK ))break ;udelay (10 ); }
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -1
@@ -43,6 +43,8 @@#define AMDGPU_RLCG_WRONG_OPERATION_TYPE 0x2000000#define AMDGPU_RLCG_REG_NOT_IN_RANGE 0x1000000 +#define AMDGPU_RLCG_SCRATCH1_ADDRESS_MASK 0xFFFFF +/* all asic after AI use this offset */ #define mmRCC_IOV_FUNC_IDENTIFIER 0xDE5/* tonga/fiji use this offset */ --
2.25.1