All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks
@ 2018-03-09 20:25 Alex Deucher
       [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Deucher @ 2018-03-09 20:25 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] 11+ messages in thread

* [PATCH 2/5] drm/amdgpu: move firmware loading type setup to common code
       [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-09 20:25   ` Alex Deucher
       [not found]     ` <20180309202523.5269-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2018-03-09 20:25   ` [PATCH 3/5] drm/amdgpu: use adev->firmware to determine whether to load the PSP module Alex Deucher
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Alex Deucher @ 2018-03-09 20:25 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

No need to replicate it in several places.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 856378434ea2..db0670289a3d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -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);
 }
 
 /**
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 4324184996a5..f14dd1b073e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 8dc8b72ed49b..de7defbfe932 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 61360a1552d8..dec7de3be78a 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 3/5] drm/amdgpu: use adev->firmware to determine whether to load the PSP module
       [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2018-03-09 20:25   ` [PATCH 2/5] drm/amdgpu: move firmware loading type setup to common code Alex Deucher
@ 2018-03-09 20:25   ` Alex Deucher
       [not found]     ` <20180309202523.5269-3-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2018-03-09 20:25   ` [PATCH 4/5] drm/amdgpu/soc15: always load the psp module Alex Deucher
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Alex Deucher @ 2018-03-09 20:25 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

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.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index de7defbfe932..5b2019b7972d 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 4/5] drm/amdgpu/soc15: always load the psp module
       [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2018-03-09 20:25   ` [PATCH 2/5] drm/amdgpu: move firmware loading type setup to common code Alex Deucher
  2018-03-09 20:25   ` [PATCH 3/5] drm/amdgpu: use adev->firmware to determine whether to load the PSP module Alex Deucher
@ 2018-03-09 20:25   ` Alex Deucher
       [not found]     ` <20180309202523.5269-4-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2018-03-09 20:25   ` [PATCH 5/5] drm/amdgpu: move getting pcie info to common code Alex Deucher
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Alex Deucher @ 2018-03-09 20:25 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

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.

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 5b2019b7972d..b2cf0bea41d2 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 (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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 5/5] drm/amdgpu: move getting pcie info to common code
       [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (2 preceding siblings ...)
  2018-03-09 20:25   ` [PATCH 4/5] drm/amdgpu/soc15: always load the psp module Alex Deucher
@ 2018-03-09 20:25   ` Alex Deucher
       [not found]     ` <20180309202523.5269-5-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2018-03-09 20:31   ` [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks Christian König
  2018-03-10  0:26   ` Zhu, Rex
  5 siblings, 1 reply; 11+ messages in thread
From: Alex Deucher @ 2018-03-09 20:25 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

No need to replicate it in several places.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 7d987dda478b..a243d8850768 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -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
  */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index db0670289a3d..97cb5e8c3306 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index f14dd1b073e9..71b35623b32d 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1887,8 +1887,6 @@ static int cik_common_early_init(void *handle)
 		return -EINVAL;
 	}
 
-	amdgpu_device_get_pcie_info(adev);
-
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index b2cf0bea41d2..28b0dbf85986 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -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;
 }
 
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index dec7de3be78a..e7cf752c3c87 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks
       [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (3 preceding siblings ...)
  2018-03-09 20:25   ` [PATCH 5/5] drm/amdgpu: move getting pcie info to common code Alex Deucher
@ 2018-03-09 20:31   ` Christian König
  2018-03-10  0:26   ` Zhu, Rex
  5 siblings, 0 replies; 11+ messages in thread
From: Christian König @ 2018-03-09 20:31 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Am 09.03.2018 um 21:25 schrieb 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>

Acked-by: Christian König <christian.koenig@amd.com> for the series.

> ---
>   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");

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

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

* Re: [PATCH 2/5] drm/amdgpu: move firmware loading type setup to common code
       [not found]     ` <20180309202523.5269-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-10  0:24       ` Zhu, Rex
  0 siblings, 0 replies; 11+ messages in thread
From: Zhu, Rex @ 2018-03-10  0:24 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander


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

Reviewed-by: Rex Zhu<rezhu-5C7GfCeVMHo@public.gmane.org>

Best Regards
Rex


________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Saturday, March 10, 2018 4:25 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
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.

Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 856378434ea2..db0670289a3d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -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);
 }

 /**
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 4324184996a5..f14dd1b073e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 8dc8b72ed49b..de7defbfe932 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 61360a1552d8..dec7de3be78a 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -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
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: 8471 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] 11+ messages in thread

* Re: [PATCH 3/5] drm/amdgpu: use adev->firmware to determine whether to load the PSP module
       [not found]     ` <20180309202523.5269-3-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-10  0:26       ` Zhu, Rex
  0 siblings, 0 replies; 11+ messages in thread
From: Zhu, Rex @ 2018-03-10  0:26 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander


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

Reviewed-by: Rex Zhu<rezhu-5C7GfCeVMHo@public.gmane.org>

Best Regards
Rex


________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Saturday, March 10, 2018 4:25 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
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.

Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index de7defbfe932..5b2019b7972d 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -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
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: 6475 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] 11+ messages in thread

* Re: [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks
       [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (4 preceding siblings ...)
  2018-03-09 20:31   ` [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks Christian König
@ 2018-03-10  0:26   ` Zhu, Rex
  5 siblings, 0 replies; 11+ messages in thread
From: Zhu, Rex @ 2018-03-10  0:26 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander


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

Reviewed-by: Rex Zhu<rezhu-5C7GfCeVMHo@public.gmane.org>

Best Regards
Rex


________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Saturday, March 10, 2018 4:25 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
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.

Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
---
 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-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: 7223 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] 11+ messages in thread

* Re: [PATCH 5/5] drm/amdgpu: move getting pcie info to common code
       [not found]     ` <20180309202523.5269-5-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-10  0:27       ` Zhu, Rex
  0 siblings, 0 replies; 11+ messages in thread
From: Zhu, Rex @ 2018-03-10  0:27 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander


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

Reviewed-by: Rex Zhu<rezhu-5C7GfCeVMHo@public.gmane.org>

Best Regards
Rex


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

No need to replicate it in several places.

Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 7d987dda478b..a243d8850768 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -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
  */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index db0670289a3d..97cb5e8c3306 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index f14dd1b073e9..71b35623b32d 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1887,8 +1887,6 @@ static int cik_common_early_init(void *handle)
                 return -EINVAL;
         }

-       amdgpu_device_get_pcie_info(adev);
-
         return 0;
 }

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index b2cf0bea41d2..28b0dbf85986 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -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;
 }

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index dec7de3be78a..e7cf752c3c87 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -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
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: 9588 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] 11+ messages in thread

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


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

Reviewed-by: Rex Zhu<rezhu-5C7GfCeVMHo@public.gmane.org>

Best Regards
Rex


________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Saturday, March 10, 2018 4:25 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
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.

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 5b2019b7972d..b2cf0bea41d2 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 (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
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: 6677 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] 11+ messages in thread

end of thread, other threads:[~2018-03-10  0:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09 20:25 [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks Alex Deucher
     [not found] ` <20180309202523.5269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-09 20:25   ` [PATCH 2/5] drm/amdgpu: move firmware loading type setup to common code Alex Deucher
     [not found]     ` <20180309202523.5269-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-10  0:24       ` Zhu, Rex
2018-03-09 20:25   ` [PATCH 3/5] drm/amdgpu: use adev->firmware to determine whether to load the PSP module Alex Deucher
     [not found]     ` <20180309202523.5269-3-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-10  0:26       ` Zhu, Rex
2018-03-09 20:25   ` [PATCH 4/5] drm/amdgpu/soc15: always load the psp module Alex Deucher
     [not found]     ` <20180309202523.5269-4-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-10  0:32       ` Zhu, Rex
2018-03-09 20:25   ` [PATCH 5/5] drm/amdgpu: move getting pcie info to common code Alex Deucher
     [not found]     ` <20180309202523.5269-5-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-10  0:27       ` Zhu, Rex
2018-03-09 20:31   ` [PATCH 1/5] drm/amdgpu/psp: add a few more fw load type checks Christian König
2018-03-10  0:26   ` Zhu, Rex

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.