All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()
@ 2021-12-03  6:54 Lang Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Lang Yu @ 2021-12-03  6:54 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Huang Rui, Lang Yu

Currently, we don't find some neccesities to power on/off
SDMA in SMU hw_init/fini(). It makes more sense in SDMA
hw_init/fini().

Signed-off-by: Lang Yu <lang.yu@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 5839918cb574..2d718c30c8eb 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1350,7 +1350,6 @@ static int smu_hw_init(void *handle)
 	}
 
 	if (smu->is_apu) {
-		smu_powergate_sdma(&adev->smu, false);
 		smu_dpm_set_vcn_enable(smu, true);
 		smu_dpm_set_jpeg_enable(smu, true);
 		smu_set_gfx_cgpg(&adev->smu, true);
@@ -1512,10 +1511,6 @@ static int smu_hw_fini(void *handle)
 	if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
 		return 0;
 
-	if (smu->is_apu) {
-		smu_powergate_sdma(&adev->smu, true);
-	}
-
 	smu_dpm_set_vcn_enable(smu, false);
 	smu_dpm_set_jpeg_enable(smu, false);
 
-- 
2.25.1


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

* [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()
@ 2021-12-08  9:26 Lang Yu
  2021-12-08  9:26 ` [PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that Lang Yu
  2021-12-08 10:06 ` [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Wang, Yang(Kevin)
  0 siblings, 2 replies; 8+ messages in thread
From: Lang Yu @ 2021-12-08  9:26 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Lang Yu, Lijo Lazar, Huang Rui

Currently, we don't find some neccesities to power on/off
SDMA in SMU hw_init/fini(). It makes more sense in SDMA
hw_init/fini().

Signed-off-by: Lang Yu <lang.yu@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 5839918cb574..2d718c30c8eb 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1350,7 +1350,6 @@ static int smu_hw_init(void *handle)
 	}
 
 	if (smu->is_apu) {
-		smu_powergate_sdma(&adev->smu, false);
 		smu_dpm_set_vcn_enable(smu, true);
 		smu_dpm_set_jpeg_enable(smu, true);
 		smu_set_gfx_cgpg(&adev->smu, true);
@@ -1512,10 +1511,6 @@ static int smu_hw_fini(void *handle)
 	if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
 		return 0;
 
-	if (smu->is_apu) {
-		smu_powergate_sdma(&adev->smu, true);
-	}
-
 	smu_dpm_set_vcn_enable(smu, false);
 	smu_dpm_set_jpeg_enable(smu, false);
 
-- 
2.25.1


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

* [PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that
  2021-12-08  9:26 [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Lang Yu
@ 2021-12-08  9:26 ` Lang Yu
  2021-12-08 10:09   ` Wang, Yang(Kevin)
  2021-12-08 10:06 ` [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Wang, Yang(Kevin)
  1 sibling, 1 reply; 8+ messages in thread
From: Lang Yu @ 2021-12-08  9:26 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Lang Yu, Lijo Lazar, Huang Rui

We found some headaches on ASICs don't need that,
so remove that for them.

Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Lang Yu <lang.yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 47 +++++++++++++++-------
 1 file changed, 32 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3c5afa45173c..b5b32a582c51 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2656,6 +2656,36 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)
 	return 0;
 }
 
+/**
+ * amdgpu_device_smu_fini_early - smu hw_fini wrapper
+ *
+ * @adev: amdgpu_device pointer
+ *
+ * For ASICs need to disable SMC first
+ */
+static void amdgpu_device_smu_fini_early(struct amdgpu_device *adev)
+{
+	int i, r;
+
+	if (adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0))
+		return;
+
+	for (i = 0; i < adev->num_ip_blocks; i++) {
+		if (!adev->ip_blocks[i].status.hw)
+			continue;
+		if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
+			r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
+			/* XXX handle errors */
+			if (r) {
+				DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+					  adev->ip_blocks[i].version->funcs->name, r);
+			}
+			adev->ip_blocks[i].status.hw = false;
+			break;
+		}
+	}
+}
+
 static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
 {
 	int i, r;
@@ -2676,21 +2706,8 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
 	amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
 	amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
 
-	/* need to disable SMC first */
-	for (i = 0; i < adev->num_ip_blocks; i++) {
-		if (!adev->ip_blocks[i].status.hw)
-			continue;
-		if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
-			r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
-			/* XXX handle errors */
-			if (r) {
-				DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
-					  adev->ip_blocks[i].version->funcs->name, r);
-			}
-			adev->ip_blocks[i].status.hw = false;
-			break;
-		}
-	}
+	/* Workaroud for ASICs need to disable SMC first */
+	amdgpu_device_smu_fini_early(adev);
 
 	for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
 		if (!adev->ip_blocks[i].status.hw)
-- 
2.25.1


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

* Re: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()
  2021-12-08  9:26 [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Lang Yu
  2021-12-08  9:26 ` [PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that Lang Yu
@ 2021-12-08 10:06 ` Wang, Yang(Kevin)
  2021-12-08 10:58   ` Lang Yu
  1 sibling, 1 reply; 8+ messages in thread
From: Wang, Yang(Kevin) @ 2021-12-08 10:06 UTC (permalink / raw)
  To: Yu, Lang, amd-gfx@lists.freedesktop.org
  Cc: Deucher, Alexander, Lazar, Lijo, Huang, Ray

[-- Attachment #1: Type: text/plain, Size: 2014 bytes --]

[AMD Official Use Only]

Hi Lang,

the function of smu_powergate_sdma() is only valid on renoir chip.
if you want to remove it, please also remove following callback pointer in struct pptable_funcs{}.
related macro definitions also need to be cleaned up.

int (*powergate_sdma)(struct smu_context *smu, bool gate);

Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Lang Yu <lang.yu@amd.com>
Sent: Wednesday, December 8, 2021 5:26 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Yu, Lang <Lang.Yu@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Huang, Ray <Ray.Huang@amd.com>
Subject: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()

Currently, we don't find some neccesities to power on/off
SDMA in SMU hw_init/fini(). It makes more sense in SDMA
hw_init/fini().

Signed-off-by: Lang Yu <lang.yu@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 5839918cb574..2d718c30c8eb 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1350,7 +1350,6 @@ static int smu_hw_init(void *handle)
         }

         if (smu->is_apu) {
-               smu_powergate_sdma(&adev->smu, false);
                 smu_dpm_set_vcn_enable(smu, true);
                 smu_dpm_set_jpeg_enable(smu, true);
                 smu_set_gfx_cgpg(&adev->smu, true);
@@ -1512,10 +1511,6 @@ static int smu_hw_fini(void *handle)
         if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
                 return 0;

-       if (smu->is_apu) {
-               smu_powergate_sdma(&adev->smu, true);
-       }
-
         smu_dpm_set_vcn_enable(smu, false);
         smu_dpm_set_jpeg_enable(smu, false);

--
2.25.1


[-- Attachment #2: Type: text/html, Size: 7419 bytes --]

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

* Re: [PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that
  2021-12-08  9:26 ` [PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that Lang Yu
@ 2021-12-08 10:09   ` Wang, Yang(Kevin)
  0 siblings, 0 replies; 8+ messages in thread
From: Wang, Yang(Kevin) @ 2021-12-08 10:09 UTC (permalink / raw)
  To: Yu, Lang, amd-gfx@lists.freedesktop.org
  Cc: Deucher, Alexander, Lazar, Lijo, Huang, Ray

[-- Attachment #1: Type: text/plain, Size: 3595 bytes --]

[AMD Official Use Only]

Reviewed-by: Kevin Wang <kevinyang.wang@amd.com>

Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Lang Yu <lang.yu@amd.com>
Sent: Wednesday, December 8, 2021 5:26 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Yu, Lang <Lang.Yu@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Huang, Ray <Ray.Huang@amd.com>
Subject: [PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that

We found some headaches on ASICs don't need that,
so remove that for them.

Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Lang Yu <lang.yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 47 +++++++++++++++-------
 1 file changed, 32 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3c5afa45173c..b5b32a582c51 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2656,6 +2656,36 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)
         return 0;
 }

+/**
+ * amdgpu_device_smu_fini_early - smu hw_fini wrapper
+ *
+ * @adev: amdgpu_device pointer
+ *
+ * For ASICs need to disable SMC first
+ */
+static void amdgpu_device_smu_fini_early(struct amdgpu_device *adev)
+{
+       int i, r;
+
+       if (adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0))
+               return;
+
+       for (i = 0; i < adev->num_ip_blocks; i++) {
+               if (!adev->ip_blocks[i].status.hw)
+                       continue;
+               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
+                       r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
+                       /* XXX handle errors */
+                       if (r) {
+                               DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+                                         adev->ip_blocks[i].version->funcs->name, r);
+                       }
+                       adev->ip_blocks[i].status.hw = false;
+                       break;
+               }
+       }
+}
+
 static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
 {
         int i, r;
@@ -2676,21 +2706,8 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
         amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
         amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);

-       /* need to disable SMC first */
-       for (i = 0; i < adev->num_ip_blocks; i++) {
-               if (!adev->ip_blocks[i].status.hw)
-                       continue;
-               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
-                       r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
-                       /* XXX handle errors */
-                       if (r) {
-                               DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
-                                         adev->ip_blocks[i].version->funcs->name, r);
-                       }
-                       adev->ip_blocks[i].status.hw = false;
-                       break;
-               }
-       }
+       /* Workaroud for ASICs need to disable SMC first */
+       amdgpu_device_smu_fini_early(adev);

         for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
                 if (!adev->ip_blocks[i].status.hw)
--
2.25.1


[-- Attachment #2: Type: text/html, Size: 8535 bytes --]

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

* Re: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()
  2021-12-08 10:06 ` [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Wang, Yang(Kevin)
@ 2021-12-08 10:58   ` Lang Yu
  2021-12-08 11:11     ` Wang, Yang(Kevin)
  0 siblings, 1 reply; 8+ messages in thread
From: Lang Yu @ 2021-12-08 10:58 UTC (permalink / raw)
  To: Wang, Yang(Kevin)
  Cc: Deucher, Alexander, Lazar, Lijo, Huang, Ray,
	amd-gfx@lists.freedesktop.org

On 12/08/ , Wang, Yang(Kevin) wrote:
>    [AMD Official Use Only]
> 
>    Hi Lang,
>    the function of smu_powergate_sdma() is only valid on renoir chip.
>    if you want to remove it, please also remove following callback pointer
>    in struct pptable_funcs{}.
>    related macro definitions also need to be cleaned up.
>    int (*powergate_sdma)(struct smu_context *smu, bool gate);

     It will be still called by amdgpu_dpm_set_powergating_by_smu()
     in sdma_v4_0_hw_init/fini().
	
     Regards,
     Lang

>    Best Regards,
>    Kevin
>      __________________________________________________________________
> 
>    From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Lang
>    Yu <lang.yu@amd.com>
>    Sent: Wednesday, December 8, 2021 5:26 PM
>    To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
>    Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Yu, Lang
>    <Lang.Yu@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Huang, Ray
>    <Ray.Huang@amd.com>
>    Subject: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU
>    hw_init/fini()
> 
>    Currently, we don't find some neccesities to power on/off
>    SDMA in SMU hw_init/fini(). It makes more sense in SDMA
>    hw_init/fini().
>    Signed-off-by: Lang Yu <lang.yu@amd.com>
>    ---
>     drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 -----
>     1 file changed, 5 deletions(-)
>    diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    index 5839918cb574..2d718c30c8eb 100644
>    --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    @@ -1350,7 +1350,6 @@ static int smu_hw_init(void *handle)
>             }
> 
>             if (smu->is_apu) {
>    -               smu_powergate_sdma(&adev->smu, false);
>                     smu_dpm_set_vcn_enable(smu, true);
>                     smu_dpm_set_jpeg_enable(smu, true);
>                     smu_set_gfx_cgpg(&adev->smu, true);
>    @@ -1512,10 +1511,6 @@ static int smu_hw_fini(void *handle)
>             if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
>                     return 0;
> 
>    -       if (smu->is_apu) {
>    -               smu_powergate_sdma(&adev->smu, true);
>    -       }
>    -
>             smu_dpm_set_vcn_enable(smu, false);
>             smu_dpm_set_jpeg_enable(smu, false);
> 
>    --
>    2.25.1

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

* Re: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()
  2021-12-08 10:58   ` Lang Yu
@ 2021-12-08 11:11     ` Wang, Yang(Kevin)
  2021-12-21  8:41       ` Josef Johansson
  0 siblings, 1 reply; 8+ messages in thread
From: Wang, Yang(Kevin) @ 2021-12-08 11:11 UTC (permalink / raw)
  To: Yu, Lang
  Cc: Deucher, Alexander, Lazar, Lijo, Huang, Ray,
	amd-gfx@lists.freedesktop.org

[-- Attachment #1: Type: text/plain, Size: 3031 bytes --]

[AMD Official Use Only]

OK, I miss this call path.

Reviewed-by: Kevin Wang <kevinyang.wang@amd.com>

Best Regards,
Kevin

________________________________
From: Yu, Lang <Lang.Yu@amd.com>
Sent: Wednesday, December 8, 2021 6:58 PM
To: Wang, Yang(Kevin) <KevinYang.Wang@amd.com>
Cc: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Deucher, Alexander <Alexander.Deucher@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Huang, Ray <Ray.Huang@amd.com>
Subject: Re: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()

On 12/08/ , Wang, Yang(Kevin) wrote:
>    [AMD Official Use Only]
>
>    Hi Lang,
>    the function of smu_powergate_sdma() is only valid on renoir chip.
>    if you want to remove it, please also remove following callback pointer
>    in struct pptable_funcs{}.
>    related macro definitions also need to be cleaned up.
>    int (*powergate_sdma)(struct smu_context *smu, bool gate);

     It will be still called by amdgpu_dpm_set_powergating_by_smu()
     in sdma_v4_0_hw_init/fini().

     Regards,
     Lang

>    Best Regards,
>    Kevin
>      __________________________________________________________________
>
>    From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Lang
>    Yu <lang.yu@amd.com>
>    Sent: Wednesday, December 8, 2021 5:26 PM
>    To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
>    Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Yu, Lang
>    <Lang.Yu@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Huang, Ray
>    <Ray.Huang@amd.com>
>    Subject: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU
>    hw_init/fini()
>
>    Currently, we don't find some neccesities to power on/off
>    SDMA in SMU hw_init/fini(). It makes more sense in SDMA
>    hw_init/fini().
>    Signed-off-by: Lang Yu <lang.yu@amd.com>
>    ---
>     drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 -----
>     1 file changed, 5 deletions(-)
>    diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    index 5839918cb574..2d718c30c8eb 100644
>    --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>    @@ -1350,7 +1350,6 @@ static int smu_hw_init(void *handle)
>             }
>
>             if (smu->is_apu) {
>    -               smu_powergate_sdma(&adev->smu, false);
>                     smu_dpm_set_vcn_enable(smu, true);
>                     smu_dpm_set_jpeg_enable(smu, true);
>                     smu_set_gfx_cgpg(&adev->smu, true);
>    @@ -1512,10 +1511,6 @@ static int smu_hw_fini(void *handle)
>             if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
>                     return 0;
>
>    -       if (smu->is_apu) {
>    -               smu_powergate_sdma(&adev->smu, true);
>    -       }
>    -
>             smu_dpm_set_vcn_enable(smu, false);
>             smu_dpm_set_jpeg_enable(smu, false);
>
>    --
>    2.25.1

[-- Attachment #2: Type: text/html, Size: 6718 bytes --]

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

* Re: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()
  2021-12-08 11:11     ` Wang, Yang(Kevin)
@ 2021-12-21  8:41       ` Josef Johansson
  0 siblings, 0 replies; 8+ messages in thread
From: Josef Johansson @ 2021-12-21  8:41 UTC (permalink / raw)
  To: Wang, Yang(Kevin), Yu, Lang
  Cc: Deucher, Alexander, Lazar, Lijo, Huang, Ray,
	amd-gfx@lists.freedesktop.org


On 12/8/21 12:11, Wang, Yang(Kevin) wrote:
>
> [AMD Official Use Only]
>
>
> OK, I miss this call path.
>
> Reviewed-by: Kevin Wang <kevinyang.wang@amd.com>
>
> Best Regards,
> Kevin
>
> ------------------------------------------------------------------------
> *From:* Yu, Lang <Lang.Yu@amd.com>
> *Sent:* Wednesday, December 8, 2021 6:58 PM
> *To:* Wang, Yang(Kevin) <KevinYang.Wang@amd.com>
> *Cc:* amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>;
> Deucher, Alexander <Alexander.Deucher@amd.com>; Lazar, Lijo
> <Lijo.Lazar@amd.com>; Huang, Ray <Ray.Huang@amd.com>
> *Subject:* Re: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU
> hw_init/fini()
>  
> On 12/08/ , Wang, Yang(Kevin) wrote:
> >    [AMD Official Use Only]
> >
> >    Hi Lang,
> >    the function of smu_powergate_sdma() is only valid on renoir chip.
> >    if you want to remove it, please also remove following callback
> pointer
> >    in struct pptable_funcs{}.
> >    related macro definitions also need to be cleaned up.
> >    int (*powergate_sdma)(struct smu_context *smu, bool gate);
>
>      It will be still called by amdgpu_dpm_set_powergating_by_smu()
>      in sdma_v4_0_hw_init/fini().
>        
>      Regards,
>      Lang
>
> >    Best Regards,
> >    Kevin
> >      __________________________________________________________________
> >
> >    From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf
> of Lang
> >    Yu <lang.yu@amd.com>
> >    Sent: Wednesday, December 8, 2021 5:26 PM
> >    To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
> >    Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Yu, Lang
> >    <Lang.Yu@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Huang, Ray
> >    <Ray.Huang@amd.com>
> >    Subject: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU
> >    hw_init/fini()
> >
> >    Currently, we don't find some neccesities to power on/off
> >    SDMA in SMU hw_init/fini(). It makes more sense in SDMA
> >    hw_init/fini().
> >    Signed-off-by: Lang Yu <lang.yu@amd.com>
> >    ---
> >     drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 -----
> >     1 file changed, 5 deletions(-)
> >    diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> >    b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> >    index 5839918cb574..2d718c30c8eb 100644
> >    --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> >    +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> >    @@ -1350,7 +1350,6 @@ static int smu_hw_init(void *handle)
> >             }
> >
> >             if (smu->is_apu) {
> >    -               smu_powergate_sdma(&adev->smu, false);
> >                     smu_dpm_set_vcn_enable(smu, true);
> >                     smu_dpm_set_jpeg_enable(smu, true);
> >                     smu_set_gfx_cgpg(&adev->smu, true);
> >    @@ -1512,10 +1511,6 @@ static int smu_hw_fini(void *handle)
> >             if (amdgpu_sriov_vf(adev)&&
> !amdgpu_sriov_is_pp_one_vf(adev))
> >                     return 0;
> >
> >    -       if (smu->is_apu) {
> >    -               smu_powergate_sdma(&adev->smu, true);
> >    -       }
> >    -
> >             smu_dpm_set_vcn_enable(smu, false);
> >             smu_dpm_set_jpeg_enable(smu, false);
> >
> >    --
> >    2.25.1
Hi,

Could this patch be related to the stacktrace I get when setting
amdgpu.dpm=0 on Renoir?
I tried to clear it up as much as possible (translated via OTR).

amdgpu 0000:07:00.0: amdgpu: amdgpu_device_ip_init failed
amdgpu 0000:07:00.0: amdgpu: Fatal error during GPU init
hid-multitouch 2003:04F3:ZACC.0001: Input,hiddeu 96, hidrawo: USB HID v1.10 Device CELAN Touchscreen on 00.3-4/inputor
amdgpu 0000:07:00.0: amdgpu: amdgpu: finishing device.
[drm] free PSP TMR buffer
amdgpu: probe of 0000:07:00.0 failed with error -95
BUG: unable to handle page fault for address: ffffc90080ccc000
#PF: supervisor write access in kernel modes
#PF: error_code(0x0002) - not-present page
PGD cd7cc067 P4D cd7cc067 PUD 10d93b067 PMD 10db30067 PTE O
Oops: 0002 (#1) SMP NOPTI
CPU: 4 PID: 427 Conn: systend-udevd Tainted: G V
5.16.0-0.rcs.8.fc32.qubes.x86_64 eur
Hardware name: LENOVO 20Y1S02400/2041502400, BIOS RIBET66U(1.35 ) 07/30/2021
RIP: e030:vcn_v2_0_sw_fini+0x72/0x90 [amdgpu]
Code: 89 ef eB 41 17 FE FE 85 c0 75 08 48 69 ef e8 65 10 FE ER 48 Bb 54 24 08 65 48 2b 14 25 28 00 00 00 75 18 48 83 4 10 51 5d c3 c?> 03 00 00 00 00 66 70 24 04 e8 af 07 do ff eb be es
RSP: e02b:feffc9004070bc18 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffffc900B0ccc000 RCX: 0000000000000000
RDX: 0000607ebf40a 100 RSI: feffc9004070bcic RDI: PEEEEEEfco2760401
RBP: ffff88810fe20000 ROB: 0000000000000000 RO9: 0000000080200018
R10: 0000000040000000 R11: 0000000000000004 R12: FF188810fe35a2er
R13: fer88810fe36980 R14: 000000000000000b R15: ffff88810111137cf
FS: 00007033B0a08b80C0000) GS: PEF 88814070000000000) knlGS:000000000000
CS: e030 DS: 0000 ES: 0000 CRO: 0000000080050033
CR2: ffffc90088ccc000 CR3: 0000000100b9c000 CR4: 0000000000050660
Call Trace:
<TASK>
amdgpu_device_ip_fini.isra.O+Oxb6/0x1bo [amdgpu]
amdgpu_device_fini_sw+Ox16/Oxe0 [amdgpu]
amdgpu_driver release_kms.0x12/0x30 [amdgpu]
devm_drm_dev_init_release+Ox3d/0x60 tarnir
devres_release_all.0xb8/0x100
really probe.x100/BX3108
_driver_probe_device.exfe/0x180P
driver probe_device-Oxle/8x90
_driver_attach•OxcB/Oxice
? _device_attach_driver Oxee/exeos
? _device_attach_driver.exe/Oxeos
bus_for_each_dev@x89/exdes
Bus_add_driver Ox149/Oxices
driver register.Ox8f/xee
? Oxffffffffcobddooos
do_one_initcall.0257/8x200
do_init_module=0x5c/8x260
_do_sys_finit_module.Oxae Exi1er
do_syscall_64.0x3b/Bx90
entry_SYSCALL_64_after_huframe.8x44 Axael
RIP: 0033:0x70308ee351345
Code: 00 c3 66 Ze of 1f 84 00 00 00 00 90 83 or le fa 48 89 68 48 89 67 48 89 46 48 89 ca 40 89 c2 40 69 cb 4c 8b 4c 24 08 of 05 <48> 30  01 to ff ff 73 01 c3 48 8b od 2b 6d Oc '00 f? d8 64 89 01 4
RSP: 002b:00007fff2a5c6198 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 00005a0b9881a640 RCX: 0000703d8ee35131
RDX: 0000000000000000 RSI: 00005a0b98819100 RDI: 00000000000000148
RBP: 0000000000020000 ROB: 0000000000000000 RO9; 00005ab9875700N
R10: 0000000000000014 R11: 0000000000000246 R12: 0000000000000000
R13: 00005a0b98819000 R14: 00005ab9881b9a0 R15: 0000000000000006
<TASKS
Modules linked in: hid_multitouch andgpul) commu_y2 gpu_sched 
12c_algo_bit dem_ttn_helper ttn sdhcl_pcl crct1001f_pclmul crc32_pc Imul
 drm_kms_helper crc32c_intel cqhci xhci_pci cec sdhci inme 
xhci_ci_remesa
serio_raw ghash_clmulni_intel xhci_hcd muc_core ehci 
Jhcd nume_core xen_acpl_processor xen_pr lucnd xen_pelback xen_blkback 
xen_gntalloc xen_gntdeu xen_eutchn uinputs
CR2: ffffc900B0cce000
--- end trace 6bbd70000e18e7a9 )---


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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08  9:26 [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Lang Yu
2021-12-08  9:26 ` [PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that Lang Yu
2021-12-08 10:09   ` Wang, Yang(Kevin)
2021-12-08 10:06 ` [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Wang, Yang(Kevin)
2021-12-08 10:58   ` Lang Yu
2021-12-08 11:11     ` Wang, Yang(Kevin)
2021-12-21  8:41       ` Josef Johansson
  -- strict thread matches above, loose matches on Subject: below --
2021-12-03  6:54 Lang Yu

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.