Skip to content

Commit

Permalink
drm/amdgpu: only check mmBIF_IOV_FUNC_IDENTIFIER on tonga/fiji
Browse files Browse the repository at this point in the history
We only support SR-IOV on tonga/fiji.  Don't check this register
on other VI parts.

Fixes: 048765a (amdgpu: fix asic initialization for virtualized environments (v2))
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Alex Deucher committed Dec 20, 2017
1 parent ea478d0 commit 57ad33a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions drivers/gpu/drm/amd/amdgpu/vi.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,19 @@ static bool vi_read_bios_from_rom(struct amdgpu_device *adev,

static void vi_detect_hw_virtualization(struct amdgpu_device *adev)
{
uint32_t reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER);
/* bit0: 0 means pf and 1 means vf */
/* bit31: 0 means disable IOV and 1 means enable */
if (reg & 1)
adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;

if (reg & 0x80000000)
adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
uint32_t reg = 0;

if (adev->asic_type == CHIP_TONGA ||
adev->asic_type == CHIP_FIJI) {
reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER);
/* bit0: 0 means pf and 1 means vf */
/* bit31: 0 means disable IOV and 1 means enable */
if (reg & 1)
adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;

if (reg & 0x80000000)
adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
}

if (reg == 0) {
if (is_virtual_machine()) /* passthrough mode exclus sr-iov mode */
Expand Down

0 comments on commit 57ad33a

Please sign in to comment.