* [PATCH 0/2] runtime pm fix
@ 2020-11-17 13:30 Kenneth Feng
2020-11-17 13:30 ` [PATCH 1/2] drm/amd/amdgpu: fix null pointer in runtime pm Kenneth Feng
2020-11-17 13:30 ` [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume Kenneth Feng
0 siblings, 2 replies; 6+ messages in thread
From: Kenneth Feng @ 2020-11-17 13:30 UTC (permalink / raw)
To: amd-gfx; +Cc: Kenneth Feng
this 2 patches fix the runtime pm problems on SIENNA_CICHLID.
Kenneth Feng (2):
drm/amd/amdgpu: fix null pointer in runtime pm
drm/amd/pm: fix the crash after runtime pm resume
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +++++--
2 files changed, 7 insertions(+), 4 deletions(-)
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] drm/amd/amdgpu: fix null pointer in runtime pm
2020-11-17 13:30 [PATCH 0/2] runtime pm fix Kenneth Feng
@ 2020-11-17 13:30 ` Kenneth Feng
2020-11-17 13:30 ` [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume Kenneth Feng
1 sibling, 0 replies; 6+ messages in thread
From: Kenneth Feng @ 2020-11-17 13:30 UTC (permalink / raw)
To: amd-gfx; +Cc: Kenneth Feng
fix the null pointer issue when runtime pm is triggered.
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 1fe850e0a94d..0ebba4380979 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4859,7 +4859,7 @@ int amdgpu_device_baco_enter(struct drm_device *dev)
if (!amdgpu_device_supports_baco(adev_to_drm(adev)))
return -ENOTSUPP;
- if (ras && ras->supported)
+ if (ras && ras->supported && adev->nbio.funcs->enable_doorbell_interrupt)
adev->nbio.funcs->enable_doorbell_interrupt(adev, false);
return amdgpu_dpm_baco_enter(adev);
@@ -4878,7 +4878,7 @@ int amdgpu_device_baco_exit(struct drm_device *dev)
if (ret)
return ret;
- if (ras && ras->supported)
+ if (ras && ras->supported && adev->nbio.funcs->enable_doorbell_interrupt)
adev->nbio.funcs->enable_doorbell_interrupt(adev, true);
return 0;
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
2020-11-17 13:30 [PATCH 0/2] runtime pm fix Kenneth Feng
2020-11-17 13:30 ` [PATCH 1/2] drm/amd/amdgpu: fix null pointer in runtime pm Kenneth Feng
@ 2020-11-17 13:30 ` Kenneth Feng
2020-11-17 14:22 ` Deucher, Alexander
2020-11-18 0:45 ` Quan, Evan
1 sibling, 2 replies; 6+ messages in thread
From: Kenneth Feng @ 2020-11-17 13:30 UTC (permalink / raw)
To: amd-gfx; +Cc: Kenneth Feng
Some features are still disabled after runtime pm resume. This can take the hardware back.
Unlike other projects, this doesn't need pptable retransfer.
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 39990790ed67..ebd50f144c5d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -914,11 +914,14 @@ static int smu_smc_hw_setup(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
uint32_t pcie_gen = 0, pcie_width = 0;
- int ret;
+ int ret = 0;
if (adev->in_suspend && smu_is_dpm_running(smu)) {
dev_info(adev->dev, "dpm has been enabled\n");
- return 0;
+ /* this is needed specifically */
+ if (adev->asic_type == CHIP_SIENNA_CICHLID)
+ ret = smu_system_features_control(smu, true);
+ return ret;
}
ret = smu_init_display_count(smu, 0);
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
2020-11-17 13:30 ` [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume Kenneth Feng
@ 2020-11-17 14:22 ` Deucher, Alexander
2020-11-18 0:45 ` Quan, Evan
1 sibling, 0 replies; 6+ messages in thread
From: Deucher, Alexander @ 2020-11-17 14:22 UTC (permalink / raw)
To: Feng, Kenneth, amd-gfx@lists.freedesktop.org
[-- Attachment #1.1: Type: text/plain, Size: 2337 bytes --]
[AMD Official Use Only - Internal Distribution Only]
Series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Does the same thing need to be applied to navy flounder and dimgrey cavefish?
Alex
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Kenneth Feng <kenneth.feng@amd.com>
Sent: Tuesday, November 17, 2020 8:30 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Feng, Kenneth <Kenneth.Feng@amd.com>
Subject: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
Some features are still disabled after runtime pm resume. This can take the hardware back.
Unlike other projects, this doesn't need pptable retransfer.
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 39990790ed67..ebd50f144c5d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -914,11 +914,14 @@ static int smu_smc_hw_setup(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
uint32_t pcie_gen = 0, pcie_width = 0;
- int ret;
+ int ret = 0;
if (adev->in_suspend && smu_is_dpm_running(smu)) {
dev_info(adev->dev, "dpm has been enabled\n");
- return 0;
+ /* this is needed specifically */
+ if (adev->asic_type == CHIP_SIENNA_CICHLID)
+ ret = smu_system_features_control(smu, true);
+ return ret;
}
ret = smu_init_display_count(smu, 0);
--
2.17.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&data=04%7C01%7Calexander.deucher%40amd.com%7Cdd553fd04f0f44ebf3ca08d88afd11ad%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637412166838877500%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=swZeNMubEey64ZdWb7W5sTg88as3VNS9ILwmLb08GHY%3D&reserved=0
[-- Attachment #1.2: Type: text/html, Size: 5281 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
2020-11-17 13:30 ` [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume Kenneth Feng
2020-11-17 14:22 ` Deucher, Alexander
@ 2020-11-18 0:45 ` Quan, Evan
2020-11-18 2:23 ` Feng, Kenneth
1 sibling, 1 reply; 6+ messages in thread
From: Quan, Evan @ 2020-11-18 0:45 UTC (permalink / raw)
To: Feng, Kenneth, amd-gfx@lists.freedesktop.org; +Cc: Feng, Kenneth
[AMD Official Use Only - Internal Distribution Only]
I suspect "smu_is_dpm_running" reports a wrong result due to "smu_system_features_control(smu, false)" was skipped for SIENNA_CICHLID in smu_disable_dpms().
That is outdated cached values were used for "smu_is_dpm_running".
If that's true, a fix in smu_disable_dpms() may be more proper.
Evan
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Kenneth Feng
Sent: Tuesday, November 17, 2020 9:31 PM
To: amd-gfx@lists.freedesktop.org
Cc: Feng, Kenneth <Kenneth.Feng@amd.com>
Subject: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
Some features are still disabled after runtime pm resume. This can take the hardware back.
Unlike other projects, this doesn't need pptable retransfer.
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 39990790ed67..ebd50f144c5d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -914,11 +914,14 @@ static int smu_smc_hw_setup(struct smu_context *smu) {
struct amdgpu_device *adev = smu->adev;
uint32_t pcie_gen = 0, pcie_width = 0;
-int ret;
+int ret = 0;
if (adev->in_suspend && smu_is_dpm_running(smu)) {
dev_info(adev->dev, "dpm has been enabled\n");
-return 0;
+/* this is needed specifically */
+if (adev->asic_type == CHIP_SIENNA_CICHLID)
+ret = smu_system_features_control(smu, true);
+return ret;
}
ret = smu_init_display_count(smu, 0);
--
2.17.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&data=04%7C01%7Cevan.quan%40amd.com%7Cdd553fd04f0f44ebf3ca08d88afd11ad%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637412166811942772%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SgtA0lq6Sx5aiQ5PSLvf9GdXUU50cFLE5ELMY0e8k5g%3D&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] 6+ messages in thread
* RE: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
2020-11-18 0:45 ` Quan, Evan
@ 2020-11-18 2:23 ` Feng, Kenneth
0 siblings, 0 replies; 6+ messages in thread
From: Feng, Kenneth @ 2020-11-18 2:23 UTC (permalink / raw)
To: Quan, Evan, amd-gfx@lists.freedesktop.org
[AMD Official Use Only - Internal Distribution Only]
[AMD Official Use Only - Internal Distribution Only]
Hi Evan/Alex,
In the process of baco enter/exit, smu disables all features, so smu_disable_dpms is not needed.
And the sequential steps in smu_smc_hw_setup after function smu_is_dpm_running are not needed since baco doesn't clean up the smu status.
This fix is specific to SIENNA_CICHLID. For the other ASICS, need to confirm since the firmware might be different.
Thanks.
Best Regards
Kenneth
-----Original Message-----
From: Quan, Evan <Evan.Quan@amd.com>
Sent: Wednesday, November 18, 2020 8:46 AM
To: Feng, Kenneth <Kenneth.Feng@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Feng, Kenneth <Kenneth.Feng@amd.com>
Subject: RE: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
[AMD Official Use Only - Internal Distribution Only]
I suspect "smu_is_dpm_running" reports a wrong result due to "smu_system_features_control(smu, false)" was skipped for SIENNA_CICHLID in smu_disable_dpms().
That is outdated cached values were used for "smu_is_dpm_running".
If that's true, a fix in smu_disable_dpms() may be more proper.
Evan
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Kenneth Feng
Sent: Tuesday, November 17, 2020 9:31 PM
To: amd-gfx@lists.freedesktop.org
Cc: Feng, Kenneth <Kenneth.Feng@amd.com>
Subject: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
Some features are still disabled after runtime pm resume. This can take the hardware back.
Unlike other projects, this doesn't need pptable retransfer.
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 39990790ed67..ebd50f144c5d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -914,11 +914,14 @@ static int smu_smc_hw_setup(struct smu_context *smu) { struct amdgpu_device *adev = smu->adev; uint32_t pcie_gen = 0, pcie_width = 0; -int ret;
+int ret = 0;
if (adev->in_suspend && smu_is_dpm_running(smu)) { dev_info(adev->dev, "dpm has been enabled\n"); -return 0;
+/* this is needed specifically */
+if (adev->asic_type == CHIP_SIENNA_CICHLID) ret =
+smu_system_features_control(smu, true); return ret;
}
ret = smu_init_display_count(smu, 0);
--
2.17.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&data=04%7C01%7Cevan.quan%40amd.com%7Cdd553fd04f0f44ebf3ca08d88afd11ad%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637412166811942772%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SgtA0lq6Sx5aiQ5PSLvf9GdXUU50cFLE5ELMY0e8k5g%3D&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] 6+ messages in thread
end of thread, other threads:[~2020-11-18 2:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-17 13:30 [PATCH 0/2] runtime pm fix Kenneth Feng
2020-11-17 13:30 ` [PATCH 1/2] drm/amd/amdgpu: fix null pointer in runtime pm Kenneth Feng
2020-11-17 13:30 ` [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume Kenneth Feng
2020-11-17 14:22 ` Deucher, Alexander
2020-11-18 0:45 ` Quan, Evan
2020-11-18 2:23 ` Feng, Kenneth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox