]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu/sriov: workaround on rev_id for Navi12 under sriov
authorTiecheng Zhou <Tiecheng.Zhou@amd.com>
Wed, 8 Jan 2020 05:44:29 +0000 (13:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:38:05 +0000 (08:38 +0100)
[ Upstream commit df5e984c8bd414561c320d6cbbb66d53abf4c7e2 ]

guest vm gets 0xffffffff when reading RCC_DEV0_EPF0_STRAP0,
as a consequence, the rev_id and external_rev_id are wrong.

workaround it by hardcoding the rev_id to 0, which is the default value.

v2. add comment in the code

Signed-off-by: Tiecheng Zhou <Tiecheng.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/nv.c

index 0ba66bef57468849a5d00d89ff51e90394862dda..de40bf12c4a8c4c4ae766abc7706eebd3b26fd82 100644 (file)
@@ -701,6 +701,12 @@ static int nv_common_early_init(void *handle)
                adev->pg_flags = AMD_PG_SUPPORT_VCN |
                        AMD_PG_SUPPORT_VCN_DPG |
                        AMD_PG_SUPPORT_ATHUB;
+               /* guest vm gets 0xffffffff when reading RCC_DEV0_EPF0_STRAP0,
+                * as a consequence, the rev_id and external_rev_id are wrong.
+                * workaround it by hardcoding rev_id to 0 (default value).
+                */
+               if (amdgpu_sriov_vf(adev))
+                       adev->rev_id = 0;
                adev->external_rev_id = adev->rev_id + 0xa;
                break;
        default: