All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: skip SMU FW reloading in runpm BACO case
@ 2022-07-11 13:57 Guchun Chen
  2022-07-11 15:29 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Guchun Chen @ 2022-07-11 13:57 UTC (permalink / raw)
  To: amd-gfx, alexander.deucher, hawking.zhang, lijo.lazar, evan.quan,
	kenneth.feng
  Cc: Guchun Chen

SMU is always alive, so it's fine to skip SMU FW reloading
when runpm resumed from BACO, this can avoid some race issues
when resuming SMU FW.

Suggested-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index e9411c28d88b..9f17235bab83 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -2348,6 +2348,12 @@ static int psp_load_smu_fw(struct psp_context *psp)
 			&adev->firmware.ucode[AMDGPU_UCODE_ID_SMC];
 	struct amdgpu_ras *ras = psp->ras_context.ras;
 
+	/* Skip SMU FW reloading in case of using BACO for runpm,
+	 * as SMU is always alive.
+	 */
+	if (adev->in_runpm && amdgpu_asic_supports_baco(adev))
+		return 0;
+
 	if (!ucode->fw || amdgpu_sriov_vf(psp->adev))
 		return 0;
 
-- 
2.17.1


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

* Re: [PATCH 1/2] drm/amdgpu: skip SMU FW reloading in runpm BACO case
  2022-07-11 13:57 [PATCH 1/2] drm/amdgpu: skip SMU FW reloading in runpm BACO case Guchun Chen
@ 2022-07-11 15:29 ` Alex Deucher
  2022-07-12  3:44   ` Chen, Guchun
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2022-07-11 15:29 UTC (permalink / raw)
  To: Guchun Chen
  Cc: Lazar, Lijo, amd-gfx list, Deucher, Alexander, Quan, Evan,
	Kenneth Feng, Hawking Zhang

On Mon, Jul 11, 2022 at 9:58 AM Guchun Chen <guchun.chen@amd.com> wrote:
>
> SMU is always alive, so it's fine to skip SMU FW reloading
> when runpm resumed from BACO, this can avoid some race issues
> when resuming SMU FW.
>
> Suggested-by: Evan Quan <evan.quan@amd.com>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index e9411c28d88b..9f17235bab83 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -2348,6 +2348,12 @@ static int psp_load_smu_fw(struct psp_context *psp)
>                         &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC];
>         struct amdgpu_ras *ras = psp->ras_context.ras;
>
> +       /* Skip SMU FW reloading in case of using BACO for runpm,
> +        * as SMU is always alive.
> +        */
> +       if (adev->in_runpm && amdgpu_asic_supports_baco(adev))
> +               return 0;

What is an asic supports both BACO and BOCO?  I think we need to
differentiate here.

Alex

> +
>         if (!ucode->fw || amdgpu_sriov_vf(psp->adev))
>                 return 0;
>
> --
> 2.17.1
>

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

* RE: [PATCH 1/2] drm/amdgpu: skip SMU FW reloading in runpm BACO case
  2022-07-11 15:29 ` Alex Deucher
@ 2022-07-12  3:44   ` Chen, Guchun
  0 siblings, 0 replies; 3+ messages in thread
From: Chen, Guchun @ 2022-07-12  3:44 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Lazar, Lijo, amd-gfx list, Deucher, Alexander, Quan, Evan, Feng,
	 Kenneth, Zhang, Hawking

Good point. We should limit it in BACO only once an ASIC supports BOCO and BACO together.

Regards,
Guchun

-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com> 
Sent: Monday, July 11, 2022 11:29 PM
To: Chen, Guchun <Guchun.Chen@amd.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Deucher, Alexander <Alexander.Deucher@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>
Subject: Re: [PATCH 1/2] drm/amdgpu: skip SMU FW reloading in runpm BACO case

On Mon, Jul 11, 2022 at 9:58 AM Guchun Chen <guchun.chen@amd.com> wrote:
>
> SMU is always alive, so it's fine to skip SMU FW reloading when runpm 
> resumed from BACO, this can avoid some race issues when resuming SMU 
> FW.
>
> Suggested-by: Evan Quan <evan.quan@amd.com>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index e9411c28d88b..9f17235bab83 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -2348,6 +2348,12 @@ static int psp_load_smu_fw(struct psp_context *psp)
>                         &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC];
>         struct amdgpu_ras *ras = psp->ras_context.ras;
>
> +       /* Skip SMU FW reloading in case of using BACO for runpm,
> +        * as SMU is always alive.
> +        */
> +       if (adev->in_runpm && amdgpu_asic_supports_baco(adev))
> +               return 0;

What is an asic supports both BACO and BOCO?  I think we need to differentiate here.

Alex

> +
>         if (!ucode->fw || amdgpu_sriov_vf(psp->adev))
>                 return 0;
>
> --
> 2.17.1
>

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

end of thread, other threads:[~2022-07-12  3:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 13:57 [PATCH 1/2] drm/amdgpu: skip SMU FW reloading in runpm BACO case Guchun Chen
2022-07-11 15:29 ` Alex Deucher
2022-07-12  3:44   ` Chen, Guchun

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.