]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/admgpu: Skip CG/PG on SOC21 under SRIOV VF
authorYifan Zha <Yifan.Zha@amd.com>
Fri, 19 Aug 2022 03:02:19 +0000 (11:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Oct 2022 10:39:14 +0000 (12:39 +0200)
[ Upstream commit 828418259254863e0af5805bd712284e2bd88e3b ]

[Why]
There is no CG(Clock Gating)/PG(Power Gating) requirement on SRIOV VF.
For multi VF, VF should not enable any CG/PG features.
For one VF, PF will program CG/PG related registers.

[How]
Do not set any cg/pg flag bit at early init under sriov.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Yifan Zha <Yifan.Zha@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/soc21.c

index 276ff6709881af1353080561c5f611e590ce0c38..9c3463b481396131c97a5420ee9a6750f2932e5a 100644 (file)
@@ -583,6 +583,10 @@ static int soc21_common_early_init(void *handle)
                        AMD_PG_SUPPORT_JPEG |
                        AMD_PG_SUPPORT_ATHUB |
                        AMD_PG_SUPPORT_MMHUB;
+               if (amdgpu_sriov_vf(adev)) {
+                       adev->cg_flags = 0;
+                       adev->pg_flags = 0;
+               }
                adev->external_rev_id = adev->rev_id + 0x1; // TODO: need update
                break;
        case IP_VERSION(11, 0, 2):