Skip to contentSkip to conversation

drm/amdgpu/psp: add a few more fw load type checks

PATCH In review Alex Deucher 3 participants 11 messages Mar 9, 2018 – Mar 10, 2018 5 messages not in the archive

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

PATCH 1/5 drm/amdgpu/psp: add a few more fw load type checks

We already checked and returned early in most of the IP functions, fill in the rest as well.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +9 -0
index 6e712f12eecd..9a75410cd576 100644
@@ -62,6 +62,9 @@ static int psp_sw_init(void *handle)
 
 	psp->adev = adev;
 
+	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
+		return 0;
+
 	ret = psp_init_microcode(psp);
 	if (ret) {
 		DRM_ERROR("Failed to load psp firmware!\n");
@@ -75,6 +78,9 @@ static int psp_sw_fini(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
+		return 0;
+
 	release_firmware(adev->psp.sos_fw);
 	adev->psp.sos_fw = NULL;
 	release_firmware(adev->psp.asd_fw);
@@ -453,6 +459,9 @@ static int psp_suspend(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;
+
 	ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
 	if (ret) {
 		DRM_ERROR("PSP ring stop failed\n");
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): 20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/5 drm/amdgpu: move firmware loading type setup to common code

No need to replicate it in several places.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/cik.c           | 2 --
 drivers/gpu/drm/amd/amdgpu/soc15.c         | 2 --
 drivers/gpu/drm/amd/amdgpu/vi.c            | 3 ---
 4 files changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
index 856378434ea2..db0670289a3d 100644
@@ -830,6 +830,8 @@ static void amdgpu_device_check_arguments(struct amdgpu_device *adev)
 		dev_warn(adev->dev, "lockup_timeout msut be > 0, adjusting to 10000\n");
 		amdgpu_lockup_timeout = 10000;
 	}
+
+	adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/cik.c +0 -2
index 4324184996a5..f14dd1b073e9 100644
@@ -1887,8 +1887,6 @@ static int cik_common_early_init(void *handle)
 		return -EINVAL;
 	}
 
-	adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
-
 	amdgpu_device_get_pcie_info(adev);
 
 	return 0;
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -2
index 8dc8b72ed49b..de7defbfe932 100644
@@ -692,8 +692,6 @@ static int soc15_common_early_init(void *handle)
 		xgpu_ai_mailbox_set_irq_funcs(adev);
 	}
 
-	adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
-
 	amdgpu_device_get_pcie_info(adev);
 
 	return 0;
drivers/gpu/drm/amd/amdgpu/vi.c +0 -3
index 61360a1552d8..dec7de3be78a 100644
@@ -1097,9 +1097,6 @@ static int vi_common_early_init(void *handle)
 		xgpu_vi_mailbox_set_irq_funcs(adev);
 	}
 
-	/* vi use smc load by default */
-	adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
-
 	amdgpu_device_get_pcie_info(adev);
 
 	return 0;
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): 20180309202523.5269-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Rex Zhu
#4 lore raw

Re: [PATCH 2/5] drm/amdgpu: move firmware loading type setup to common code

Best Regards
Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <[email protected]>
Sent: Saturday, March 10, 2018 4:25 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 2/5] drm/amdgpu: move firmware loading type setup to common code

No need to replicate it in several places.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/cik.c           | 2 --
 drivers/gpu/drm/amd/amdgpu/soc15.c         | 2 --
 drivers/gpu/drm/amd/amdgpu/vi.c            | 3 ---
 4 files changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
index 856378434ea2..db0670289a3d 100644
@@ -830,6 +830,8 @@ static void amdgpu_device_check_arguments(struct amdgpu_device *adev)
                 dev_warn(adev->dev, "lockup_timeout msut be > 0, adjusting to 10000\n");
                 amdgpu_lockup_timeout = 10000;
         }
+
+       adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/cik.c +0 -2
index 4324184996a5..f14dd1b073e9 100644
@@ -1887,8 +1887,6 @@ static int cik_common_early_init(void *handle)
                 return -EINVAL;
         }
 
-       adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
-
         amdgpu_device_get_pcie_info(adev);
 
         return 0;
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -2
index 8dc8b72ed49b..de7defbfe932 100644
@@ -692,8 +692,6 @@ static int soc15_common_early_init(void *handle)
                 xgpu_ai_mailbox_set_irq_funcs(adev);
         }
 
-       adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
-
         amdgpu_device_get_pcie_info(adev);
 
         return 0;
drivers/gpu/drm/amd/amdgpu/vi.c +0 -3
index 61360a1552d8..dec7de3be78a 100644
@@ -1097,9 +1097,6 @@ static int vi_common_early_init(void *handle)
                 xgpu_vi_mailbox_set_irq_funcs(adev);
         }
 
-       /* vi use smc load by default */
-       adev->firmware.load_type = amdgpu_ucode_get_load_type(adev, amdgpu_fw_load_type);
-
         amdgpu_device_get_pcie_info(adev);
 
         return 0;

--
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 ...

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

#5 lore raw

PATCH 3/5 drm/amdgpu: use adev->firmware to determine whether to load the PSP module

In reply to a message not in the archive

The per device firmware load method is limited to what makes sense for that asic rather than whatever arbitrary value may have been set by the user.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
index de7defbfe932..5b2019b7972d 100644
@@ -531,7 +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)
+		if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)
 			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);
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): 20180309202523.5269-3-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Rex Zhu
#7 lore raw

Re: [PATCH 3/5] drm/amdgpu: use adev->firmware to determine whether to load the PSP module

Best Regards
Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <[email protected]>
Sent: Saturday, March 10, 2018 4:25 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 3/5] drm/amdgpu: use adev->firmware to determine whether to load the PSP module

The per device firmware load method is limited to what makes sense for that asic rather than whatever arbitrary value may have been set by the user.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
index de7defbfe932..5b2019b7972d 100644
@@ -531,7 +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)
+               if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)
                         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);

--
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 ...

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

#8 lore raw

PATCH 4/5 drm/amdgpu/soc15: always load the psp module

In reply to a message not in the archive

Regardless of whether the user has selected psp fw loading or not. It's still needed for GPU reset among other things. There are already guards in place to avoid setting up the full psp if PSP fw loading is not enabled.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
index 5b2019b7972d..b2cf0bea41d2 100644
@@ -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 (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)
-			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))
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): 20180309202523.5269-4-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Rex Zhu
#10 lore raw

Re: [PATCH 4/5] drm/amdgpu/soc15: always load the psp module

Best Regards
Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <[email protected]>
Sent: Saturday, March 10, 2018 4:25 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 4/5] drm/amdgpu/soc15: always load the psp module

Regardless of whether the user has selected psp fw loading or not. It's still needed for GPU reset among other things. There are already guards in place to avoid setting up the full psp if PSP fw loading is not enabled.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
index 5b2019b7972d..b2cf0bea41d2 100644
@@ -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 (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)
-                       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 ...

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

#11 lore raw

PATCH 5/5 drm/amdgpu: move getting pcie info to common code

In reply to a message not in the archive

No need to replicate it in several places.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++++-
 drivers/gpu/drm/amd/amdgpu/cik.c           | 2 --
 drivers/gpu/drm/amd/amdgpu/soc15.c         | 2 --
 drivers/gpu/drm/amd/amdgpu/vi.c            | 2 --
 5 files changed, 5 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -2
index 7d987dda478b..a243d8850768 100644
@@ -1082,8 +1082,6 @@ struct amdgpu_wb {
 int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb);
 void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb);
 
-void amdgpu_device_get_pcie_info(struct amdgpu_device *adev);
-
 /*
  * SDMA
  */
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -1
index db0670289a3d..97cb5e8c3306 100644
@@ -87,6 +87,8 @@ static const char *amdgpu_asic_name[] = {
 	"LAST",
 };
 
+static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev);
+
 bool amdgpu_device_is_px(struct drm_device *dev)
 {
 	struct amdgpu_device *adev = dev->dev_private;
@@ -1880,6 +1882,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	if (adev->rio_mem == NULL)
 		DRM_INFO("PCI I/O BAR is not found.\n");
 
+	amdgpu_device_get_pcie_info(adev);
+
 	/* early init functions */
 	r = amdgpu_device_ip_early_init(adev);
 	if (r)
@@ -2757,7 +2761,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 	return r;
 }
 
-void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
+static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
 {
 	u32 mask;
 	int ret;
drivers/gpu/drm/amd/amdgpu/cik.c +0 -2
index f14dd1b073e9..71b35623b32d 100644
@@ -1887,8 +1887,6 @@ static int cik_common_early_init(void *handle)
 		return -EINVAL;
 	}
 
-	amdgpu_device_get_pcie_info(adev);
-
 	return 0;
 }
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -2
index b2cf0bea41d2..28b0dbf85986 100644
@@ -691,8 +691,6 @@ static int soc15_common_early_init(void *handle)
 		xgpu_ai_mailbox_set_irq_funcs(adev);
 	}
 
-	amdgpu_device_get_pcie_info(adev);
-
 	return 0;
 }
 
drivers/gpu/drm/amd/amdgpu/vi.c +0 -2
index dec7de3be78a..e7cf752c3c87 100644
@@ -1097,8 +1097,6 @@ static int vi_common_early_init(void *handle)
 		xgpu_vi_mailbox_set_irq_funcs(adev);
 	}
 
-	amdgpu_device_get_pcie_info(adev);
-
 	return 0;
 }
 
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): 20180309202523.5269-5-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Rex Zhu
#13 lore raw

Re: [PATCH 5/5] drm/amdgpu: move getting pcie info to common code

Best Regards
Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <[email protected]>
Sent: Saturday, March 10, 2018 4:25 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 5/5] drm/amdgpu: move getting pcie info to common code

No need to replicate it in several places.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++++-
 drivers/gpu/drm/amd/amdgpu/cik.c           | 2 --
 drivers/gpu/drm/amd/amdgpu/soc15.c         | 2 --
 drivers/gpu/drm/amd/amdgpu/vi.c            | 2 --
 5 files changed, 5 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -2
index 7d987dda478b..a243d8850768 100644
@@ -1082,8 +1082,6 @@ struct amdgpu_wb {
 int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb);
 void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb);
 
-void amdgpu_device_get_pcie_info(struct amdgpu_device *adev);
-
 /*
  * SDMA
  */
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -1
index db0670289a3d..97cb5e8c3306 100644
@@ -87,6 +87,8 @@ static const char *amdgpu_asic_name[] = {
         "LAST",
 };
 
+static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev);
+
 bool amdgpu_device_is_px(struct drm_device *dev)
 {
         struct amdgpu_device *adev = dev->dev_private;
@@ -1880,6 +1882,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
         if (adev->rio_mem == NULL)
                 DRM_INFO("PCI I/O BAR is not found.\n");
 
+       amdgpu_device_get_pcie_info(adev);
+
         /* early init functions */
         r = amdgpu_device_ip_early_init(adev);
         if (r)
@@ -2757,7 +2761,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
         return r;
 }
 
-void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
+static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
 {
         u32 mask;
         int ret;
drivers/gpu/drm/amd/amdgpu/cik.c +0 -2
index f14dd1b073e9..71b35623b32d 100644
@@ -1887,8 +1887,6 @@ static int cik_common_early_init(void *handle)
                 return -EINVAL;
         }
 
-       amdgpu_device_get_pcie_info(adev);
-
         return 0;
 }
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -2
index b2cf0bea41d2..28b0dbf85986 100644
@@ -691,8 +691,6 @@ static int soc15_common_early_init(void *handle)
                 xgpu_ai_mailbox_set_irq_funcs(adev);
         }
 
-       amdgpu_device_get_pcie_info(adev);
-
         return 0;
 }
 
drivers/gpu/drm/amd/amdgpu/vi.c +0 -2
index dec7de3be78a..e7cf752c3c87 100644
@@ -1097,8 +1097,6 @@ static int vi_common_early_init(void *handle)
                 xgpu_vi_mailbox_set_irq_funcs(adev);
         }
 
-       amdgpu_device_get_pcie_info(adev);
-
         return 0;
 }
 

--
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 ...

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

#14 lore raw
In reply to a message not in the archive

Am 09.03.2018 um 21:25 schrieb Alex Deucher:

Quoted 4 lines

We already checked and returned early in most of the IP functions, fill in the rest as well.

Quoted 29 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++++++
  1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -0
index 6e712f12eecd..9a75410cd576 100644
@@ -62,6 +62,9 @@ static int psp_sw_init(void *handle)
 
  	psp->adev = adev;
 
+	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
+		return 0;
+
  	ret = psp_init_microcode(psp);
  	if (ret) {
  		DRM_ERROR("Failed to load psp firmware!\n");
@@ -75,6 +78,9 @@ static int psp_sw_fini(void *handle)
  {
  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
+		return 0;
+
  	release_firmware(adev->psp.sos_fw);
  	adev->psp.sos_fw = NULL;
  	release_firmware(adev->psp.asd_fw);

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_suspend(void *handle) · line 467

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
@@ -453,6 +459,9 @@ static int psp_suspend(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;
+
  	ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
  	if (ret) {
  		DRM_ERROR("PSP ring stop failed\n");

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

Reviewed-by Rex Zhu
#15 lore raw
In reply to a message not in the archive

Best Regards
Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <[email protected]>
Sent: Saturday, March 10, 2018 4:25 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks

We already checked and returned early in most of the IP functions, fill in the rest as well.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +9 -0
index 6e712f12eecd..9a75410cd576 100644
@@ -62,6 +62,9 @@ static int psp_sw_init(void *handle)
 
         psp->adev = adev;
 
+       if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
+               return 0;
+
         ret = psp_init_microcode(psp);
         if (ret) {
                 DRM_ERROR("Failed to load psp firmware!\n");
@@ -75,6 +78,9 @@ static int psp_sw_fini(void *handle)
 {
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
+               return 0;
+
         release_firmware(adev->psp.sos_fw);
         adev->psp.sos_fw = NULL;
         release_firmware(adev->psp.asd_fw);
@@ -453,6 +459,9 @@ static int psp_suspend(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;
+
         ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
         if (ret) {
                 DRM_ERROR("PSP ring stop failed\n");

--
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 ...

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