Skip to contentSkip to conversation

Only detect virtualization capabilities on Fiji and Tonga.

PATCH In review José Pekkarinen 2 participants 3 messages Dec 26, 2017 – Dec 27, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Only detect virtualization capabilities on Fiji and Tonga.

---
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +13 -10
index 045988b18bc3..1a043a50d22f 100644
@@ -245,16 +245,19 @@ void nbio_v6_1_detect_hw_virt(struct amdgpu_device *adev)
 {
 	uint32_t reg;
 
-	reg = RREG32_SOC15(NBIO, 0, mmRCC_PF_0_0_RCC_IOV_FUNC_IDENTIFIER);
-	if (reg & 1)
-		adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
-
-	if (reg & 0x80000000)
-		adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
-
-	if (!reg) {
-		if (is_virtual_machine())	/* passthrough mode exclus sriov mod */
-			adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
+	if (adev->asic_type == CHIP_TONGA ||
+	    adev->asic_type == CHIP_FIJI) {
+		reg = RREG32_SOC15(NBIO, 0, mmRCC_PF_0_0_RCC_IOV_FUNC_IDENTIFIER);
+		if (reg & 1)
+			adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
+
+		if (reg & 0x80000000)
+			adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
+
+		if (!reg) {
+			if (is_virtual_machine())	/* passthrough mode exclus sriov mod */
+				adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
+		}
 	}
 }
 
Signature · 6 lines
2.13.6

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171226142610.27402-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 1 line · José Pekkarinen

NACK. This would break vega10 and this code path is only called on vega10 asics.

Alex

Quoted 41 lines
---
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +13 -11
index 045988b18bc3..1a043a50d22f 100644
@@ -245,16 +245,19 @@ void nbio_v6_1_detect_hw_virt(struct amdgpu_device *adev)
 {
        uint32_t reg;
 
-       reg = RREG32_SOC15(NBIO, 0, mmRCC_PF_0_0_RCC_IOV_FUNC_IDENTIFIER);
-       if (reg & 1)
-               adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
-
-       if (reg & 0x80000000)
-               adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
-
-       if (!reg) {
-               if (is_virtual_machine())       /* passthrough mode exclus sriov mod */
-                       adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
+       if (adev->asic_type == CHIP_TONGA ||
+           adev->asic_type == CHIP_FIJI) {
+               reg = RREG32_SOC15(NBIO, 0, mmRCC_PF_0_0_RCC_IOV_FUNC_IDENTIFIER);
+               if (reg & 1)
+                       adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
+
+               if (reg & 0x80000000)
+                       adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
+
+               if (!reg) {
+                       if (is_virtual_machine())       /* passthrough mode exclus sriov mod */
+                               adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
+               }
        }
 }
 
--

2.13.6

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_NM+BLiKUhAoQ1a6Dx=fXGeYNHrPjXzp8Ao+UHCxv4GzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 7 lines · On Wednesday, 27 December 2017 09:45:57 EET Alex Deucher wrote:
Quoted 1 line · José Pekkarinen

NACK. This would break vega10 and this code path is only called on vega10 asics.

Alex

True, this may not be harmful. Thanks Alex!

José.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx