Skip to contentSkip to conversation

drm/amd/powerplay: fix request smc_sk firmware case

PATCH In review Huang Rui 3 participants 3 messages Dec 19, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: fix request smc_sk firmware case

This patch fixes firmware request error on polaris protection mode. Because we need load smc_sk instead of smc under security protection mode.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +4 -0
index 9ada56c..3235630 100755
@@ -713,6 +713,7 @@ static int amdgpu_cgs_rel_firmware(struct cgs_device *cgs_device, enum cgs_ucode
 	CGS_FUNC_ADEV;
 	if ((CGS_UCODE_ID_SMU == type) || (CGS_UCODE_ID_SMU_SK == type)) {
 		release_firmware(adev->pm.fw);
+		adev->pm.fw = NULL;
 		return 0;
 	}
 	/* cannot release other firmware because they are not created by cgs */
@@ -808,6 +809,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 		const uint8_t *src;
 		const struct smc_firmware_header_v1_0 *hdr;
 
+		if (CGS_UCODE_ID_SMU_SK == type)
+			amdgpu_cgs_rel_firmware(cgs_device, CGS_UCODE_ID_SMU);
+
 		if (!adev->pm.fw) {
 			switch (adev->asic_type) {
 			case CHIP_TOPAZ:
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): 1482131735-9092-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org

Tested-by Evan Quan
#2 lore raw
Quoted 46 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Monday, December 19, 2016 3:16 PM
To: [email protected]
Cc: Huang, Ray <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix request smc_sk firmware case

This patch fixes firmware request error on polaris protection mode. Because we need load smc_sk instead of smc under security protection mode.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +1 -0
index 9ada56c..3235630 100755
@@ -713,6 +713,7 @@ static int amdgpu_cgs_rel_firmware(struct cgs_device
 *cgs_device, enum cgs_ucode
 	CGS_FUNC_ADEV;
 	if ((CGS_UCODE_ID_SMU == type) || (CGS_UCODE_ID_SMU_SK ==
 type)) {
 		release_firmware(adev->pm.fw);
+		adev->pm.fw = NULL;
 		return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -0
 	}
 	/* cannot release other firmware because they are not created by

cgs */ @@ -808,6 +809,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,

drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +2 -0
 		const uint8_t *src;
 		const struct smc_firmware_header_v1_0 *hdr;
 
+		if (CGS_UCODE_ID_SMU_SK == type)
+			amdgpu_cgs_rel_firmware(cgs_device,

CGS_UCODE_ID_SMU);

drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +1 -1
+
 		if (!adev->pm.fw) {
 			switch (adev->asic_type) {
 			case CHIP_TOPAZ:
--

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

Reviewed-by Alex Deucher
#3 lore raw
In reply to a message not in the archive
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Monday, December 19, 2016 2:16 AM
To: [email protected]
Cc: Huang, Ray
Subject: [PATCH] drm/amd/powerplay: fix request smc_sk firmware case

Quoted 5 lines

This patch fixes firmware request error on polaris protection mode. Because we need load smc_sk instead of smc under security protection mode.

Quoted 35 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +1 -0
index 9ada56c..3235630 100755
@@ -713,6 +713,7 @@ static int amdgpu_cgs_rel_firmware(struct cgs_device
 *cgs_device, enum cgs_ucode
 	CGS_FUNC_ADEV;
 	if ((CGS_UCODE_ID_SMU == type) || (CGS_UCODE_ID_SMU_SK ==
 type)) {
 		release_firmware(adev->pm.fw);
+		adev->pm.fw = NULL;
 		return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -0
 	}
 	/* cannot release other firmware because they are not created by

cgs */

drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +3 -0
@@ -808,6 +809,9 @@ static int amdgpu_cgs_get_firmware_info(struct
 cgs_device *cgs_device,
 		const uint8_t *src;
 		const struct smc_firmware_header_v1_0 *hdr;
 
+		if (CGS_UCODE_ID_SMU_SK == type)
+			amdgpu_cgs_rel_firmware(cgs_device,
 CGS_UCODE_ID_SMU);
+
 		if (!adev->pm.fw) {
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -1
 			switch (adev->asic_type) {
 			case CHIP_TOPAZ:
--

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