AMD-GFX Archive on 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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox