All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: fix request smc_sk firmware case
@ 2016-12-19  7:15 Huang Rui
       [not found] ` <1482131735-9092-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Huang Rui @ 2016-12-19  7:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Huang Rui

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

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index 9ada56c..3235630 100755
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -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:
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amd/powerplay: fix request smc_sk firmware case
       [not found] ` <1482131735-9092-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
@ 2016-12-19  8:07   ` Quan, Evan
  2016-12-19 17:35   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2016-12-19  8:07 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Huang, Ray

Tested-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of
> Huang Rui
> Sent: Monday, December 19, 2016 3:16 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Huang, Ray <Ray.Huang@amd.com>
> 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.
> 
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> index 9ada56c..3235630 100755
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> @@ -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:
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amd/powerplay: fix request smc_sk firmware case
       [not found] ` <1482131735-9092-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
  2016-12-19  8:07   ` Quan, Evan
@ 2016-12-19 17:35   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2016-12-19 17:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Huang, Ray

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Huang Rui
> Sent: Monday, December 19, 2016 2:16 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Huang, Ray
> 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.
> 
> Signed-off-by: Huang Rui <ray.huang@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> index 9ada56c..3235630 100755
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> @@ -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:
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-19 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19  7:15 [PATCH] drm/amd/powerplay: fix request smc_sk firmware case Huang Rui
     [not found] ` <1482131735-9092-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2016-12-19  8:07   ` Quan, Evan
2016-12-19 17:35   ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.