[PATCH] SWDEV-187506: drm/amdgpu: [Gibraltar][v320]VM-destroy3 (case 29) failed 5/5

Jesse Zhang zhexi.zhang at amd.com
Wed Jul 10 03:43:37 UTC 2019

Issue: On host P520 with S03J3226A SBIOS platform, passthrough both
gfx and audio device to VM, the first time start VM after host bootup,
driver woule load fail.

Root cause: Passthrough both devices allows VFIO to do hot reset
on bridge, this reset clears register BIOS_SCRATCH_7 which is used
for judging if VBIOS has been post. Since in the first time driver
does not do BACO reset when loading, VBIOS would be post twice.

Solution: When running in passthrough mode, force enable BACO reset
in every time loading driver.

Notice: This is a workaround for SWDEV-187506 issue, passthrough two
devices to VM is required.

Signed-off-by: Jesse Zhang <zhexi.zhang at amd.com>
 drivers/gpu/drm/amd/amdgpu/soc15.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 9d33ba4..790099d 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -738,15 +738,16 @@ static bool soc15_need_reset_on_init(struct amdgpu_device *adev)
 	u32 sol_reg;
-	if (!amdgpu_passthrough(adev))
-		return false;
 	if (adev->flags & AMD_IS_APU)
 		return false;
 	/* Check sOS sign of life register to confirm sys driver and sOS
 	 * are already been loaded.
+	if (amdgpu_passthrough(adev))
+		return true;
 	sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
 	if (sol_reg)
 		return true;

More information about the amd-gfx mailing list