Hi Alex,

How about keep the firmware type checking in set_ip_blocks.

and remove the same check code in psp module.

also no need to change load type if psp load firmware failed in psp module.


Please review the attached patch.


Best Regards

Rex

________________________________
From: amd-gfx <[email protected]> on behalf of Alex Deucher 
<[email protected]>
Sent: Friday, March 9, 2018 4:54 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module

We already handle the firmware loading type checks in the
psp module directly, no need for an additional check.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c 
b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 8dc8b72ed49b..ecf58a68cf66 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -531,8 +531,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
                 amdgpu_device_ip_block_add(adev, &vega10_common_ip_block);
                 amdgpu_device_ip_block_add(adev, &gmc_v9_0_ip_block);
                 amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block);
-               if (amdgpu_fw_load_type == 2 || amdgpu_fw_load_type == -1)
-                       amdgpu_device_ip_block_add(adev, &psp_v3_1_ip_block);
+               amdgpu_device_ip_block_add(adev, &psp_v3_1_ip_block);
                 if (!amdgpu_sriov_vf(adev))
                         amdgpu_device_ip_block_add(adev, &amdgpu_pp_ip_block);
                 if (adev->enable_virtual_display || amdgpu_sriov_vf(adev))
--
2.13.6

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - 
freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. 
Use of all freedesktop.org lists is subject to our Code of ...


From 29b7717b97fff81f0dcd80b4bda24cea3d6903bb Mon Sep 17 00:00:00 2001
From: Rex Zhu <[email protected]>
Date: Fri, 9 Mar 2018 12:34:05 +0800
Subject: [PATCH] drm/amdgpu: Remove additional firmware loading type check in
 psp module

PSP ip only be added and initialized in PSP load firmware case.
when PSP load failed, change the load type is meanless, because
in this case, driver do not support other load type and
will return failed directly.

Change-Id: Iebe80642fcbb0c802d25005be5ef60735a5758ee
Signed-off-by: Rex Zhu <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 6e712f1..1997f79 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -391,10 +391,6 @@ static int psp_hw_init(void *handle)
 	int ret;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-
-	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
-		return 0;
-
 	mutex_lock(&adev->firmware.mutex);
 	/*
 	 * This sequence is just used on hw_init only once, no need on
@@ -414,7 +410,6 @@ static int psp_hw_init(void *handle)
 	return 0;
 
 failed:
-	adev->firmware.load_type = AMDGPU_FW_LOAD_DIRECT;
 	mutex_unlock(&adev->firmware.mutex);
 	return -EINVAL;
 }
@@ -424,9 +419,6 @@ static int psp_hw_fini(void *handle)
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	struct psp_context *psp = &adev->psp;
 
-	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
-		return 0;
-
 	amdgpu_ucode_fini_bo(adev);
 
 	psp_ring_destroy(psp, PSP_RING_TYPE__KM);
@@ -468,8 +460,6 @@ static int psp_resume(void *handle)
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	struct psp_context *psp = &adev->psp;
 
-	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
-		return 0;
 
 	DRM_INFO("PSP is resuming...\n");
 
@@ -503,11 +493,6 @@ static bool psp_check_fw_loading_status(struct amdgpu_device *adev,
 {
 	struct amdgpu_firmware_info *ucode = NULL;
 
-	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) {
-		DRM_INFO("firmware is not loaded by PSP\n");
-		return true;
-	}
-
 	if (!adev->firmware.fw_size)
 		return false;
 
-- 
1.9.1

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

Reply via email to