Skip to contentSkip to conversation

drm/amdgpu: fix pm_load_smu_firmware for SR-IOV

PATCH In review Trigger Huang 3 participants 3 messages Jun 11, 2019 1 message not in the archive

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

PATCH 1/1 drm/amdgpu: fix pm_load_smu_firmware for SR-IOV

For SR-IOV VF, powerplay may not be supported, in this case, error '-EINVAL' should not be returned.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +3 -0
index 21b5be1..4276d63 100644
@@ -2709,7 +2709,10 @@ int amdgpu_pm_load_smu_firmware(struct amdgpu_device *adev, uint32_t *smu_versio
 			return r;
 		}
 		*smu_version = adev->pm.fw_version;
+	} else if (amdgpu_sriov_vf(adev)) {
+		r = 0;
 	}
+
 	return r;
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
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): 1560226110-10201-1-git-send-email-Trigger.Huang-5C7GfCeVMHo@public.gmane.org

Reviewed-by Prike Liang
#2 lore raw

Thanks,
Prike

Quoted 34 lines

-----Original Message-----
From: Trigger Huang <[email protected]>
Sent: Tuesday, June 11, 2019 12:09 PM
To: [email protected]
Cc: Huang, Trigger <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH] drm/amdgpu: fix pm_load_smu_firmware for SR-IOV

For SR-IOV VF, powerplay may not be supported, in this case, error '-EINVAL' should not be returned.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -0
index 21b5be1..4276d63 100644
@@ -2709,7 +2709,10 @@ int amdgpu_pm_load_smu_firmware(struct

amdgpu_device *adev, uint32_t *smu_versio

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +3 -1
 			return r;
 		}
 		*smu_version = adev->pm.fw_version;
+	} else if (amdgpu_sriov_vf(adev)) {
+		r = 0;
 	}
+
 	return r;
 }
 
--
Quoted 1 line

2.7.4

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

Reviewed-by Huang Rui
#3 lore raw
In reply to a message not in the archive
Quoted 24 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Trigger Huang
Sent: Tuesday, June 11, 2019 12:09 PM
To: [email protected]
Cc: Liang, Prike <[email protected]>; Huang, Trigger <[email protected]>
Subject: [PATCH] drm/amdgpu: fix pm_load_smu_firmware for SR-IOV

For SR-IOV VF, powerplay may not be supported, in this case, error '-EINVAL' should not be returned.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0 -0
index 21b5be1..4276d63 100644
@@ -2709,7 +2709,10 @@ int amdgpu_pm_load_smu_firmware(struct

amdgpu_device *adev, uint32_t *smu_versio

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c int amdgpu_pm_load_smu_firmware(struct amdgpu_device *adev, uint32_t *smu_versio · line 2713

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -0
 			return r;
 		}
 		*smu_version = adev->pm.fw_version;
+	} else if (amdgpu_sriov_vf(adev)) {
+		r = 0;

Could you please add the checking at the start of this function:

if (amdgpu_sriov_vf(adev))

	return 0;

The code looks better than adding a "else" here.

With that fixed, please add

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1 -1
 	}
+
 	return r;
 }
 
--

2.7.4

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