All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2
@ 2021-04-14 23:39 Joseph Greathouse
  2021-04-14 23:48 ` Felix Kuehling
  2021-04-15  2:40 ` Zhang, Hawking
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph Greathouse @ 2021-04-14 23:39 UTC (permalink / raw)
  To: amd-gfx; +Cc: Joseph Greathouse

If we skipped loading MEC2 firmware separately from MEC, then
MEC2 will be running the same firmware image. Copy the MEC version
and feature numbers into MEC2 version and feature numbers. This
is needed for things like GWS support, where we rely on knowing
what version of firmware is running on MEC2. Leaving these MEC2
entries blank breaks our ability to version-check enables and
workarounds.

Signed-off-by: Joseph Greathouse <Joseph.Greathouse@amd.com>
Change-Id: Id6f672fc69452abd6ff41821a5f2240037048a6f
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 06811a1f4625..a078a38c2cee 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1587,6 +1587,9 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,
 			err = 0;
 			adev->gfx.mec2_fw = NULL;
 		}
+	} else {
+		adev->gfx.mec2_fw_version = adev->gfx.mec_fw_version;
+		adev->gfx.mec2_feature_version = adev->gfx.mec_feature_version;
 	}
 
 	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
-- 
2.20.1

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

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

* Re: [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2
  2021-04-14 23:39 [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2 Joseph Greathouse
@ 2021-04-14 23:48 ` Felix Kuehling
  2021-04-15  9:12   ` Clements, John
  2021-04-15  2:40 ` Zhang, Hawking
  1 sibling, 1 reply; 4+ messages in thread
From: Felix Kuehling @ 2021-04-14 23:48 UTC (permalink / raw)
  To: amd-gfx, Clements, John

Am 2021-04-14 um 7:39 p.m. schrieb Joseph Greathouse:
> If we skipped loading MEC2 firmware separately from MEC, then
> MEC2 will be running the same firmware image. Copy the MEC version
> and feature numbers into MEC2 version and feature numbers. This
> is needed for things like GWS support, where we rely on knowing
> what version of firmware is running on MEC2. Leaving these MEC2
> entries blank breaks our ability to version-check enables and
> workarounds.
>
> Signed-off-by: Joseph Greathouse <Joseph.Greathouse@amd.com>
> Change-Id: Id6f672fc69452abd6ff41821a5f2240037048a6f

The patch looks good to me. I'd wait for John to approve it as well.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>

John, if the patch looks good to you, please feel free to apply it to
amd-staging-drm-next in your time zone. We're in a hurry because this
fix is needed in the next ROCm release. If you believe reporting a fake
MEC2 version would cause problems for graphics, an alternative fix would
be to change kfd_gws_init to check the mec_fw_version on Arcturus.

Regards,
  Felix


> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 06811a1f4625..a078a38c2cee 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -1587,6 +1587,9 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,
>  			err = 0;
>  			adev->gfx.mec2_fw = NULL;
>  		}
> +	} else {
> +		adev->gfx.mec2_fw_version = adev->gfx.mec_fw_version;
> +		adev->gfx.mec2_feature_version = adev->gfx.mec_feature_version;
>  	}
>  
>  	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2
  2021-04-14 23:39 [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2 Joseph Greathouse
  2021-04-14 23:48 ` Felix Kuehling
@ 2021-04-15  2:40 ` Zhang, Hawking
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Hawking @ 2021-04-15  2:40 UTC (permalink / raw)
  To: Greathouse, Joseph, amd-gfx; +Cc: Greathouse, Joseph

[AMD Public Use]

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Regards,
Hawking
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Joseph Greathouse
Sent: Thursday, April 15, 2021 07:40
To: amd-gfx@lists.freedesktop.org
Cc: Greathouse, Joseph <Joseph.Greathouse@amd.com>
Subject: [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2

If we skipped loading MEC2 firmware separately from MEC, then
MEC2 will be running the same firmware image. Copy the MEC version and feature numbers into MEC2 version and feature numbers. This is needed for things like GWS support, where we rely on knowing what version of firmware is running on MEC2. Leaving these MEC2 entries blank breaks our ability to version-check enables and workarounds.

Signed-off-by: Joseph Greathouse <Joseph.Greathouse@amd.com>
Change-Id: Id6f672fc69452abd6ff41821a5f2240037048a6f
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 06811a1f4625..a078a38c2cee 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1587,6 +1587,9 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,
 			err = 0;
 			adev->gfx.mec2_fw = NULL;
 		}
+	} else {
+		adev->gfx.mec2_fw_version = adev->gfx.mec_fw_version;
+		adev->gfx.mec2_feature_version = adev->gfx.mec_feature_version;
 	}
 
 	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
--
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Chawking.zhang%40amd.com%7C7d6c47df75ed45ba91de08d8ff9e9ae7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637540403966327155%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ikRLjhzcWaHCAGIwFqjILjRYw7Dy5xUsZBECmyY%2FYOI%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2
  2021-04-14 23:48 ` Felix Kuehling
@ 2021-04-15  9:12   ` Clements, John
  0 siblings, 0 replies; 4+ messages in thread
From: Clements, John @ 2021-04-15  9:12 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx

[AMD Official Use Only - Internal Distribution Only]

This looks good to me, I apologize for introducing this issue.
I see the patch has already been submitted to amd-staging-drm-next.

My only concern would be is that MEC2 FW version might still fail to report in the firmware_info debugfs.
I believe the check for adev->gfx.mec2_fw will fail before querying for the version.
The IOCTL FW query interface looks like it will work if that’s the mechanism the app is using.

Other then that, I believe there is no potential side effects of this change.

Thank you,
John Clements 

-----Original Message-----
From: Kuehling, Felix <Felix.Kuehling@amd.com> 
Sent: Thursday, April 15, 2021 7:48 AM
To: amd-gfx@lists.freedesktop.org; Clements, John <John.Clements@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2

Am 2021-04-14 um 7:39 p.m. schrieb Joseph Greathouse:
> If we skipped loading MEC2 firmware separately from MEC, then
> MEC2 will be running the same firmware image. Copy the MEC version and 
> feature numbers into MEC2 version and feature numbers. This is needed 
> for things like GWS support, where we rely on knowing what version of 
> firmware is running on MEC2. Leaving these MEC2 entries blank breaks 
> our ability to version-check enables and workarounds.
>
> Signed-off-by: Joseph Greathouse <Joseph.Greathouse@amd.com>
> Change-Id: Id6f672fc69452abd6ff41821a5f2240037048a6f

The patch looks good to me. I'd wait for John to approve it as well.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>

John, if the patch looks good to you, please feel free to apply it to amd-staging-drm-next in your time zone. We're in a hurry because this fix is needed in the next ROCm release. If you believe reporting a fake
MEC2 version would cause problems for graphics, an alternative fix would be to change kfd_gws_init to check the mec_fw_version on Arcturus.

Regards,
  Felix


> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 06811a1f4625..a078a38c2cee 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -1587,6 +1587,9 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,
>  			err = 0;
>  			adev->gfx.mec2_fw = NULL;
>  		}
> +	} else {
> +		adev->gfx.mec2_fw_version = adev->gfx.mec_fw_version;
> +		adev->gfx.mec2_feature_version = adev->gfx.mec_feature_version;
>  	}
>  
>  	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-04-15  9:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 23:39 [PATCH] drm/amdgpu: Copy MEC FW version to MEC2 if we skipped loading MEC2 Joseph Greathouse
2021-04-14 23:48 ` Felix Kuehling
2021-04-15  9:12   ` Clements, John
2021-04-15  2:40 ` Zhang, Hawking

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.