All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu/psp: add a few more fw load type checks
@ 2018-03-08 20:54 Alex Deucher
       [not found] ` <20180308205409.3203-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2018-03-08 20:54 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 6e712f12eecd..9a75410cd576 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module
       [not found] ` <20180308205409.3203-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-08 20:54   ` Alex Deucher
       [not found]     ` <20180308205409.3203-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2018-03-08 20:54 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module
       [not found]     ` <20180308205409.3203-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-09  5:10       ` Zhu, Rex
       [not found]         ` <CY4PR12MB1687F2F0D4288F02D750C755FBDE0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Zhu, Rex @ 2018-03-09  5:10 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander


[-- Attachment #1.1: Type: text/plain, Size: 2357 bytes --]

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 <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Friday, March 9, 2018 4:54 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
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 <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
---
 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
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
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 ...



[-- Attachment #1.2: Type: text/html, Size: 6479 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-drm-amdgpu-Remove-additional-firmware-loading-type-c.patch --]
[-- Type: text/x-patch; name="0001-drm-amdgpu-Remove-additional-firmware-loading-type-c.patch", Size: 2261 bytes --]

From 29b7717b97fff81f0dcd80b4bda24cea3d6903bb Mon Sep 17 00:00:00 2001
From: Rex Zhu <Rex.Zhu@amd.com>
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 <Rex.Zhu@amd.com>
---
 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


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module
       [not found]         ` <CY4PR12MB1687F2F0D4288F02D750C755FBDE0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-03-09  7:45           ` Christian König
       [not found]             ` <b6999bc4-1fae-c293-42f4-2929b08d1821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Christian König @ 2018-03-09  7:45 UTC (permalink / raw)
  To: Zhu, Rex, Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Deucher, Alexander


[-- Attachment #1.1: Type: text/plain, Size: 2902 bytes --]

Hi Rex,

I think still initializing the PSP even when you don't need it for 
firmware upload sounds like a good idea to me.

But take that with a grain of salt since I really on don't know that 
part of the hardware so well.

Christian.

Am 09.03.2018 um 06:10 schrieb Zhu, Rex:
>
> 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 <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of 
> Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> *Sent:* Friday, March 9, 2018 4:54 AM
> *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> *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 <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
> ---
>  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
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> 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
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 10205 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module
       [not found]             ` <b6999bc4-1fae-c293-42f4-2929b08d1821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-03-09 17:02               ` Alex Deucher
       [not found]                 ` <CADnq5_PK5K5OYG4HVxKa1wCk-MxtJNaxH83HF9F7RzxkaXai_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2018-03-09 17:02 UTC (permalink / raw)
  To: Christian Koenig
  Cc: Deucher, Alexander, Zhu, Rex, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 3831 bytes --]

On Fri, Mar 9, 2018 at 2:45 AM, Christian König <
ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Hi Rex,
>
> I think still initializing the PSP even when you don't need it for
> firmware upload sounds like a good idea to me.
>
> But take that with a grain of salt since I really on don't know that part
> of the hardware so well.
>

Right.  We need PSP for GPU resets among other things.  I also don't really
like the fact that we use the module parameter directly to determine
whether to load the PSP module or not, we should be using
adev->firmware.load_type, but that doesn't get set until later.  We should
probably just move that earlier in the common code rather than having it in
the soc files.  The problem with checking the module parameter is that that
param is gobal so if you you have multiple GPUs, you may get messed up.

Alex



>
> Christian.
>
>
> Am 09.03.2018 um 06:10 schrieb Zhu, Rex:
>
> 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 <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
> <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher
> <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> *Sent:* Friday, March 9, 2018 4:54 AM
> *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> *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 <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
> <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
> ---
>  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
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> 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 listamd-gfx-PD4FTy7X32lNgt0PjOBp934avgP/u3fG0wdF1cv0I5s@public.gmane.org://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 10387 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module
       [not found]                 ` <CADnq5_PK5K5OYG4HVxKa1wCk-MxtJNaxH83HF9F7RzxkaXai_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-03-09 17:53                   ` Zhu, Rex
       [not found]                     ` <CY4PR12MB1687AD7E1DEB313C60E836CFFBDE0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Zhu, Rex @ 2018-03-09 17:53 UTC (permalink / raw)
  To: Alex Deucher, Koenig, Christian
  Cc: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 5611 bytes --]

 >I also don't really like the fact that we use the module parameter directly to determine whether to load the >PSP module or not, we should be using adev->firmware.load_type, but that doesn't get set until later.

we can move function amdgpu_ucode_get_load_type to amdgpu_check_arguments(adev);
adev->firmware.load_type will be set.

>The problem with checking the module parameter is that that param is gobal so if you you have multiple >GPUs, you may get messed up.

if user set the load type through module parameters, it is valid for all gpu.


Best Regards
Rex


________________________________
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Saturday, March 10, 2018 1:02 AM
To: Koenig, Christian
Cc: Zhu, Rex; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; Deucher, Alexander
Subject: Re: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module

On Fri, Mar 9, 2018 at 2:45 AM, Christian König <ckoenig.leichtzumerken@gmail.com<mailto:ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote:
Hi Rex,

I think still initializing the PSP even when you don't need it for firmware upload sounds like a good idea to me.

But take that with a grain of salt since I really on don't know that part of the hardware so well.

Right.  We need PSP for GPU resets among other things.  I also don't really like the fact that we use the module parameter directly to determine whether to load the PSP module or not, we should be using adev->firmware.load_type, but that doesn't get set until later.  We should probably just move that earlier in the common code rather than having it in the soc files.  The problem with checking the module parameter is that that param is gobal so if you you have multiple GPUs, you may get messed up.

Alex



Christian.


Am 09.03.2018 um 06:10 schrieb Zhu, Rex:

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 <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:amd-gfx-bounces@lists.freedesktop.org> on behalf of Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org><mailto:alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Friday, March 9, 2018 4:54 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
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 <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
---
 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
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
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 Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org<http://lists.freedesktop.org>
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org<http://freedesktop.org> lists is subject to our Code of ...
www<http://freedesktop.org/>
freedesktop.org
Welcome to freedesktop.org. freedesktop.org is open source / open discussion software projects working on interoperability and shared technology for X Window System ...







_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
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 ...





[-- Attachment #1.2: Type: text/html, Size: 19112 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module
       [not found]                     ` <CY4PR12MB1687AD7E1DEB313C60E836CFFBDE0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-03-09 18:29                       ` Christian König
  0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2018-03-09 18:29 UTC (permalink / raw)
  To: Zhu, Rex, Alex Deucher, Koenig, Christian
  Cc: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 6913 bytes --]

That still leaves us with the issue that we need the PSP for the GPU 
reset independent if it is used for firmware loading or not.

Additional to that the PSP is present in the hardware no matter if we 
use it or not. So I think we should always at least add it.

Regards,
Christian.

Am 09.03.2018 um 18:53 schrieb Zhu, Rex:
>
>  >I also don't really like the fact that we use the module parameter 
> directly to determine whether to load the >PSP module or not, we 
> should be using adev->firmware.load_type, but that doesn't get set 
> until later.
>
>
> we can move function amdgpu_ucode_get_load_type to 
> amdgpu_check_arguments(adev);
> adev->firmware.load_type will be set.
>
> >The problem with checking the module parameter is that that param is 
> gobal so if you you have multiple >GPUs, you may get messed up.
>
> if user set the load type through module parameters, it is valid for 
> all gpu.
>
> Best Regards
> Rex
>
>
> ------------------------------------------------------------------------
> *From:* Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> *Sent:* Saturday, March 10, 2018 1:02 AM
> *To:* Koenig, Christian
> *Cc:* Zhu, Rex; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; Deucher, Alexander
> *Subject:* Re: [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP 
> module
> On Fri, Mar 9, 2018 at 2:45 AM, Christian König 
> <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 
> <mailto:ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote:
>
>     Hi Rex,
>
>     I think still initializing the PSP even when you don't need it for
>     firmware upload sounds like a good idea to me.
>
>     But take that with a grain of salt since I really on don't know
>     that part of the hardware so well.
>
>
> Right.  We need PSP for GPU resets among other things.  I also don't 
> really like the fact that we use the module parameter directly to 
> determine whether to load the PSP module or not, we should be using 
> adev->firmware.load_type, but that doesn't get set until later.  We 
> should probably just move that earlier in the common code rather than 
> having it in the soc files.  The problem with checking the module 
> parameter is that that param is gobal so if you you have multiple 
> GPUs, you may get messed up.
>
> Alex
>
>
>     Christian.
>
>
>     Am 09.03.2018 um 06:10 schrieb Zhu, Rex:
>>
>>     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 <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>>     <mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex
>>     Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> <mailto:alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>     *Sent:* Friday, March 9, 2018 4:54 AM
>>     *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>>     <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>>     *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 <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>>     <mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>>     ---
>>      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
>>     amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>>     https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>>     <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 Info Page - freedesktop.org
>>     <https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
>>     lists.freedesktop.org <http://lists.freedesktop.org>
>>     Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the
>>     following form. Use of all freedesktop.org
>>     <http://freedesktop.org> lists is subject to our Code of ...
>>     www <http://freedesktop.org/>
>>     freedesktop.org
>>     Welcome to freedesktop.org. freedesktop.org is open source / open
>>     discussion software projects working on interoperability and
>>     shared technology for X Window System ...
>>
>>
>>
>>
>>
>>     _______________________________________________
>>     amd-gfx mailing list
>>     amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>>     https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>>     <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
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 45944 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

end of thread, other threads:[~2018-03-09 18:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 20:54 [PATCH 1/2] drm/amdgpu/psp: add a few more fw load type checks Alex Deucher
     [not found] ` <20180308205409.3203-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-08 20:54   ` [PATCH 2/2] drm/amdgpu/soc15: always load the psp IP module Alex Deucher
     [not found]     ` <20180308205409.3203-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-09  5:10       ` Zhu, Rex
     [not found]         ` <CY4PR12MB1687F2F0D4288F02D750C755FBDE0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-09  7:45           ` Christian König
     [not found]             ` <b6999bc4-1fae-c293-42f4-2929b08d1821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-09 17:02               ` Alex Deucher
     [not found]                 ` <CADnq5_PK5K5OYG4HVxKa1wCk-MxtJNaxH83HF9F7RzxkaXai_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-09 17:53                   ` Zhu, Rex
     [not found]                     ` <CY4PR12MB1687AD7E1DEB313C60E836CFFBDE0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-09 18:29                       ` Christian König

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.