* [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
@ 2024-12-05 22:45 Yuan Feng
2024-12-06 5:17 ` Lazar, Lijo
0 siblings, 1 reply; 6+ messages in thread
From: Yuan Feng @ 2024-12-05 22:45 UTC (permalink / raw)
To: amd-gfx; +Cc: Yuan Feng
On SRIOV, guest driver and host driver might deploy different versions of MEC firmware binaries that
lead to potential compability issues cause system hang. To solve this, host and guest deploy MEC fw copies
with two level jump table.
Signed-off-by: Yuan Feng <yfeng1@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index 03654bfda58a..f248449e93a7 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
+MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
#define GFX9_MEC_HPD_SIZE 4096
#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
@@ -574,7 +575,16 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_device *adev,
{
int err;
- err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+ if (amdgpu_sriov_vf(adev)) {
+ err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+ "amdgpu/%s_sjt_mec.bin", chip_name);
+
+ if (err)
+ err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+ "amdgpu/%s_mec.bin", chip_name);
+ }
+ else
+ err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
"amdgpu/%s_mec.bin", chip_name);
if (err)
goto out;
--
2.39.1.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
2024-12-05 22:45 [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3 Yuan Feng
@ 2024-12-06 5:17 ` Lazar, Lijo
2024-12-06 6:15 ` Feng, Yuan
2024-12-06 6:48 ` Feng, Yuan
0 siblings, 2 replies; 6+ messages in thread
From: Lazar, Lijo @ 2024-12-06 5:17 UTC (permalink / raw)
To: Yuan Feng, amd-gfx
On 12/6/2024 4:15 AM, Yuan Feng wrote:
> On SRIOV, guest driver and host driver might deploy different versions of MEC firmware binaries that
> lead to potential compability issues cause system hang. To solve this, host and guest deploy MEC fw copies
> with two level jump table.
>
> Signed-off-by: Yuan Feng <yfeng1@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 03654bfda58a..f248449e93a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
> +MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
>
This change needs to be done on top of
https://patchwork.freedesktop.org/patch/626097/ as that one adds support
for GFX 9.4.4 also.
Thanks,
Lijo
> #define GFX9_MEC_HPD_SIZE 4096
> #define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
> @@ -574,7 +575,16 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_device *adev,
> {
> int err;
>
> - err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + if (amdgpu_sriov_vf(adev)) {
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + "amdgpu/%s_sjt_mec.bin", chip_name);
> +
> + if (err)
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + "amdgpu/%s_mec.bin", chip_name);
> + }
> + else
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> "amdgpu/%s_mec.bin", chip_name);
> if (err)
> goto out;
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
2024-12-06 5:17 ` Lazar, Lijo
@ 2024-12-06 6:15 ` Feng, Yuan
2024-12-06 6:48 ` Feng, Yuan
1 sibling, 0 replies; 6+ messages in thread
From: Feng, Yuan @ 2024-12-06 6:15 UTC (permalink / raw)
To: Lazar, Lijo, amd-gfx@lists.freedesktop.org
[AMD Official Use Only - AMD Internal Distribution Only]
Hey @Lazar, Lijo,
Yes, Just pinged Victor, Zhao. Sure, I will make a change accordingly.
Thanks,
Yuan
-----Original Message-----
From: Lazar, Lijo <Lijo.Lazar@amd.com>
Sent: Friday, December 6, 2024 12:18 AM
To: Feng, Yuan <Yuan.Feng@amd.com>; amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
On 12/6/2024 4:15 AM, Yuan Feng wrote:
> On SRIOV, guest driver and host driver might deploy different versions
> of MEC firmware binaries that lead to potential compability issues
> cause system hang. To solve this, host and guest deploy MEC fw copies with two level jump table.
>
> Signed-off-by: Yuan Feng <yfeng1@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 03654bfda58a..f248449e93a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
> +MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
>
This change needs to be done on top of
https://patchwork.freedesktop.org/patch/626097/ as that one adds support for GFX 9.4.4 also.
Thanks,
Lijo
> #define GFX9_MEC_HPD_SIZE 4096
> #define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L @@ -574,7
> +575,16 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct
> amdgpu_device *adev, {
> int err;
>
> - err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + if (amdgpu_sriov_vf(adev)) {
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + "amdgpu/%s_sjt_mec.bin", chip_name);
> +
> + if (err)
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + "amdgpu/%s_mec.bin", chip_name);
> + }
> + else
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> "amdgpu/%s_mec.bin", chip_name);
> if (err)
> goto out;
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
2024-12-06 5:17 ` Lazar, Lijo
2024-12-06 6:15 ` Feng, Yuan
@ 2024-12-06 6:48 ` Feng, Yuan
1 sibling, 0 replies; 6+ messages in thread
From: Feng, Yuan @ 2024-12-06 6:48 UTC (permalink / raw)
To: Lazar, Lijo, amd-gfx@lists.freedesktop.org
[-- Attachment #1: Type: text/plain, Size: 2431 bytes --]
[AMD Official Use Only - AMD Internal Distribution Only]
Hi @Lazar, Lijo,
Please refer the attached. The idea is to try to load regular MEC firmware if SJT one is not available.
Thanks,
Yuan
-----Original Message-----
From: Lazar, Lijo <Lijo.Lazar@amd.com>
Sent: Friday, December 6, 2024 12:18 AM
To: Feng, Yuan <Yuan.Feng@amd.com>; amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
On 12/6/2024 4:15 AM, Yuan Feng wrote:
> On SRIOV, guest driver and host driver might deploy different versions
> of MEC firmware binaries that lead to potential compability issues
> cause system hang. To solve this, host and guest deploy MEC fw copies with two level jump table.
>
> Signed-off-by: Yuan Feng <yfeng1@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 03654bfda58a..f248449e93a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
> +MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
>
This change needs to be done on top of
https://patchwork.freedesktop.org/patch/626097/ as that one adds support for GFX 9.4.4 also.
Thanks,
Lijo
> #define GFX9_MEC_HPD_SIZE 4096
> #define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L @@ -574,7
> +575,16 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct
> amdgpu_device *adev, {
> int err;
>
> - err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + if (amdgpu_sriov_vf(adev)) {
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + "amdgpu/%s_sjt_mec.bin", chip_name);
> +
> + if (err)
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + "amdgpu/%s_mec.bin", chip_name);
> + }
> + else
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> "amdgpu/%s_mec.bin", chip_name);
> if (err)
> goto out;
[-- Attachment #2: 0001-drm-amdgpu-Fix-for-MEC-SJT-FW-Load-Fail-on-VF.patch --]
[-- Type: application/octet-stream, Size: 1231 bytes --]
From a73a30bfb023594782b45410f523a698f88422cd Mon Sep 17 00:00:00 2001
From: yfeng1 <yfeng1@amd.com>
Date: Fri, 6 Dec 2024 01:36:46 -0500
Subject: [PATCH] drm/amdgpu: Fix for MEC SJT FW Load Fail on VF
Users might switch to ROCM build does not include MEC SJT FW and driver
needs to consider this case.
Signed-of-yfeng1 <yfeng1@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index cc038f300a56..5e6c1aab2e83 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -579,10 +579,15 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_device *adev,
{
int err;
- if (amdgpu_sriov_vf(adev))
+ if (amdgpu_sriov_vf(adev)) {
err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_sjt_mec.bin", chip_name);
+ if (err)
+ err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+ AMDGPU_UCODE_REQUIRED,
+ "amdgpu/%s_mec.bin", chip_name);
+ }
else
err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
AMDGPU_UCODE_REQUIRED,
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
@ 2024-11-19 15:37 Yuan Feng
2024-11-21 13:33 ` Lazar, Lijo
0 siblings, 1 reply; 6+ messages in thread
From: Yuan Feng @ 2024-11-19 15:37 UTC (permalink / raw)
To: amd-gfx; +Cc: Yuan Feng
On SRIOV, guest driver and host driver might deploy different versions
of MEC firmware binaries that lead to potential compability issues cause
system hang. To solve this, host and guest deploy MEC fw with two level jump
table.
Signed-off-by: Yuan Feng <yfeng1@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index 03654bfda58a..6011332cce92 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
+MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
#define GFX9_MEC_HPD_SIZE 4096
#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
@@ -574,7 +575,11 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_device *adev,
{
int err;
- err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+ if (amdgpu_sriov_vf(adev))
+ err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+ "amdgpu/%s_sjt_mec.bin", chip_name);
+ else
+ err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
"amdgpu/%s_mec.bin", chip_name);
if (err)
goto out;
--
2.39.1.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3
2024-11-19 15:37 Yuan Feng
@ 2024-11-21 13:33 ` Lazar, Lijo
0 siblings, 0 replies; 6+ messages in thread
From: Lazar, Lijo @ 2024-11-21 13:33 UTC (permalink / raw)
To: Yuan Feng, amd-gfx
On 11/19/2024 9:07 PM, Yuan Feng wrote:
> On SRIOV, guest driver and host driver might deploy different versions
> of MEC firmware binaries that lead to potential compability issues cause
> system hang. To solve this, host and guest deploy MEC fw with two level jump
> table.
>
> Signed-off-by: Yuan Feng <yfeng1@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 03654bfda58a..6011332cce92 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_mec.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
> MODULE_FIRMWARE("amdgpu/gc_9_4_4_rlc.bin");
> +MODULE_FIRMWARE("amdgpu/gc_9_4_3_sjt_mec.bin");
>
> #define GFX9_MEC_HPD_SIZE 4096
> #define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
> @@ -574,7 +575,11 @@ static int gfx_v9_4_3_init_cp_compute_microcode(struct amdgpu_device *adev,
> {
> int err;
>
> - err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + if (amdgpu_sriov_vf(adev))
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> + "amdgpu/%s_sjt_mec.bin", chip_name);
> + else
> + err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
> "amdgpu/%s_mec.bin", chip_name);
> if (err)
> goto out;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-06 6:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-05 22:45 [PATCH] drm/amdgpu: Use MEC FW with SJT on gfx_v9_4_3 Yuan Feng
2024-12-06 5:17 ` Lazar, Lijo
2024-12-06 6:15 ` Feng, Yuan
2024-12-06 6:48 ` Feng, Yuan
-- strict thread matches above, loose matches on Subject: below --
2024-11-19 15:37 Yuan Feng
2024-11-21 13:33 ` Lazar, Lijo
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.