Skip to contentSkip to conversation

drm/amd/powerplay: don't give up if DPM is already running

PATCH In review Grazvydas Ignotas 7 participants 11 messages Oct 9, 2016 – Oct 20, 2016 6 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/powerplay: don't give up if DPM is already running

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f
Call Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -2
index f6afa6a..327030b 100644
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 
 	tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
 	PP_ASSERT_WITH_CODE(tmp_result == 0,
-			"DPM is already running right now, no need to enable DPM!",
-			return 0);
+			"DPM is already running",
+			);
 
 	if (smu7_voltage_control(hwmgr)) {
 		tmp_result = smu7_enable_voltage_control(hwmgr);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): 1476040988-11676-1-git-send-email-notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 42 lines · Grazvydas Ignotas

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f
Call Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +0 -0
index f6afa6a..327030b 100644

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c static int smu7_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · line 1173

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -2
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 
 	tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
 	PP_ASSERT_WITH_CODE(tmp_result == 0,
-			"DPM is already running right now, no need to enable DPM!",
-			return 0);
+			"DPM is already running",
+			);
 
 	if (smu7_voltage_control(hwmgr)) {
 		tmp_result = smu7_enable_voltage_control(hwmgr);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to Grazvydas Ignotas

+Rex to review this.

Alex

Quoted 54 lines · Grazvydas Ignotas

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f
Call Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -3
index f6afa6a..327030b 100644
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 
        tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
        PP_ASSERT_WITH_CODE(tmp_result == 0,
-                       "DPM is already running right now, no need to enable DPM!",
-                       return 0);
+                       "DPM is already running",
+                       );
 
        if (smu7_voltage_control(hwmgr)) {
                tmp_result = smu7_enable_voltage_control(hwmgr);
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): CADnq5_PBtB=c=ycPRU-gOndt8C7HaZL_7SxKD6uEBFvWsSXz8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw

Hi Grazvydas and Alex,

We needed to disable dpm when rmmod amdgpu for this issue.

I am checking the function of disable dpm task.

Best Regards
Rex

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, October 12, 2016 4:01 AM
To: Grazvydas Ignotas; Zhu, Rex
Cc: Maling list - DRI developers; amd-gfx list
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

+Rex to review this.

Alex

Quoted 53 lines · Grazvydas Ignotas

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f Call 
Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -2
index f6afa6a..327030b 100644
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr 
 *hwmgr)
 
        tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
        PP_ASSERT_WITH_CODE(tmp_result == 0,
-                       "DPM is already running right now, no need to enable DPM!",
-                       return 0);
+                       "DPM is already running",
+                       );
 
        if (smu7_voltage_control(hwmgr)) {
                tmp_result = smu7_enable_voltage_control(hwmgr);
Quoted 7 lines

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#6 lore raw

Hi all,

The attached patches were also for this issue.
Disable dpm when rmmod amdgpu.

Please help to review.

Best Regards
Rex

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Zhu, Rex
Sent: Wednesday, October 12, 2016 9:45 PM
To: Alex Deucher; Grazvydas Ignotas
Cc: amd-gfx list; Maling list - DRI developers
Subject: RE: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Hi Grazvydas and Alex,

We needed to disable dpm when rmmod amdgpu for this issue.

I am checking the function of disable dpm task.

Best Regards
Rex

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, October 12, 2016 4:01 AM
To: Grazvydas Ignotas; Zhu, Rex
Cc: Maling list - DRI developers; amd-gfx list
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

+Rex to review this.

Alex

Quoted 53 lines · Grazvydas Ignotas

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f Call
Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -2
index f6afa6a..327030b 100644
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr
 *hwmgr)
 
        tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
        PP_ASSERT_WITH_CODE(tmp_result == 0,
-                       "DPM is already running right now, no need to enable DPM!",
-                       return 0);
+                       "DPM is already running",
+                       );
 
        if (smu7_voltage_control(hwmgr)) {
                tmp_result = smu7_enable_voltage_control(hwmgr);
Quoted 7 lines

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

From b513b776a871452889f3307ea6887a95f3750be1 Mon Sep 17 00:00:00 2001
From: Rex Zhu <[email protected]>
Date: Thu, 13 Oct 2016 15:17:22 +0800
Subject: [PATCH 1/3] drm/amdgpu: need to disable dpm first when rmmod amdgpu.

otherwise, the dpm can't be disabled

Change-Id Ia318f7bbcda1f0b1841c0198fd0fdbc93afc0adf
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +9 -0
index 60d63bf..bfd830a 100644
@@ -1444,6 +1444,13 @@ static int amdgpu_fini(struct amdgpu_device *adev)
 {
 	int i, r;
 
+	r = adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->hw_fini((void *)adev);
+	if (r)
+		DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+			adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->name, r);
+
+	adev->ip_block_status[AMD_IP_BLOCK_TYPE_SMC].hw = false;
+
 	for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
 		if (!adev->ip_block_status[i].hw)
 			continue;
@@ -1451,6 +1458,8 @@ static int amdgpu_fini(struct amdgpu_device *adev)
 			amdgpu_wb_fini(adev);
 			amdgpu_vram_scratch_fini(adev);
 		}
+
+
 		/* ungate blocks before hw fini so that we can shutdown the blocks safely */
 		r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev,
 								    AMD_CG_STATE_UNGATE);
Signature · 1 line
1.9.1

From c8e343545afc29bc99e3435ee5ad8d3dcb7a3fa8 Mon Sep 17 00:00:00 2001
From: Rex Zhu <[email protected]>
Date: Thu, 13 Oct 2016 15:24:12 +0800
Subject: [PATCH 2/3] drm/amd/powerplay: fix bug stop dpm can't work on Vi.

Change-Id I8b4f5422f661b8bf4c03c0286cee4700a92eb0d3
---
 .../drm/amd/powerplay/eventmgr/eventactionchains.c |  1 +
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   | 39 +++++++++++++---------
 2 files changed, 25 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c +1 -0
index 92b1178..8cee4e0 100644
@@ -49,6 +49,7 @@ static const pem_event_action * const uninitialize_event[] = {
 	uninitialize_display_phy_access_tasks,
 	disable_gfx_voltage_island_power_gating_tasks,
 	disable_gfx_clock_gating_tasks,
+	uninitialize_thermal_controller_tasks,
 	set_boot_state_tasks,
 	adjust_power_state_tasks,
 	disable_dynamic_state_management_tasks,
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +24 -15
index d6b3fd1..4a6f655 100644
@@ -1030,20 +1030,19 @@ static int smu7_disable_sclk_mclk_dpm(struct pp_hwmgr *hwmgr)
 	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 
 	/* disable SCLK dpm */
-	if (!data->sclk_dpm_key_disabled)
-		PP_ASSERT_WITH_CODE(
-				(smum_send_msg_to_smc(hwmgr->smumgr,
-						PPSMC_MSG_DPM_Disable) == 0),
-				"Failed to disable SCLK DPM!",
-				return -EINVAL);
+	if (!data->sclk_dpm_key_disabled) {
+		PP_ASSERT_WITH_CODE(true == smum_is_dpm_running(hwmgr),
+				"Trying to disable SCLK DPM when DPM is disabled",
+				return 0);
+		smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_DPM_Disable);
+	}
 
 	/* disable MCLK dpm */
 	if (!data->mclk_dpm_key_disabled) {
-		PP_ASSERT_WITH_CODE(
-				(smum_send_msg_to_smc(hwmgr->smumgr,
-						PPSMC_MSG_MCLKDPM_Disable) == 0),
-				"Failed to disable MCLK DPM!",
-				return -EINVAL);
+		PP_ASSERT_WITH_CODE(true == smum_is_dpm_running(hwmgr),
+				"Trying to disable MCLK DPM when DPM is disabled",
+				return 0);
+		smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_MCLKDPM_Disable);
 	}
 
 	return 0;
@@ -1069,10 +1068,13 @@ static int smu7_stop_dpm(struct pp_hwmgr *hwmgr)
 				return -EINVAL);
 	}
 
-	if (smu7_disable_sclk_mclk_dpm(hwmgr)) {
-		printk(KERN_ERR "Failed to disable Sclk DPM and Mclk DPM!");
-		return -EINVAL;
-	}
+	smu7_disable_sclk_mclk_dpm(hwmgr);
+
+	PP_ASSERT_WITH_CODE(true == smum_is_dpm_running(hwmgr),
+			"Trying to disable voltage DPM when DPM is disabled",
+			return 0);
+
+	smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_Voltage_Cntl_Disable);
 
 	return 0;
 }
@@ -1306,6 +1308,12 @@ int smu7_disable_dpm_tasks(struct pp_hwmgr *hwmgr)
 	PP_ASSERT_WITH_CODE((tmp_result == 0),
 			"Failed to disable thermal auto throttle!", result = tmp_result);
 
+	if (1 == PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, FEATURE_STATUS, AVS_ON)) {
+		PP_ASSERT_WITH_CODE((0 == smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_DisableAvfs)),
+					"Failed to disable AVFS!",
+					return -1;);
+	}
+
 	tmp_result = smu7_stop_dpm(hwmgr);
 	PP_ASSERT_WITH_CODE((tmp_result == 0),
 			"Failed to stop DPM!", result = tmp_result);
@@ -4345,6 +4353,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
 	.set_mclk_od = smu7_set_mclk_od,
 	.get_clock_by_type = smu7_get_clock_by_type,
 	.read_sensor = smu7_read_sensor,
+	.dynamic_state_management_disable = smu7_disable_dpm_tasks,
 };
 
 uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock,
Signature · 1 line
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#7 lore raw
Quoted 6 lines · Rex

Hi all,

The attached patches were also for this issue.
Disable dpm when rmmod amdgpu.

Please help to review.

Patch 1:
+ r = adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->hw_fini((void *)adev);
+ if (r)
+ DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+ adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->name, r);
+
+ adev->ip_block_status[AMD_IP_BLOCK_TYPE_SMC].hw = false;

You can't use AMD_IP_BLOCK_TYPE_* as index. Some chips may not have the IP block. Maybe something like the attached patch. That said, I think longer term it makes more sense to allows the SOCs to specify the order for init, fini, etc. otherwise we'll have lots of variable logic in the common code.

Patch 2:
+ if (1 == PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device,
CGS_IND_REG__SMC, FEATURE_STATUS, AVS_ON)) {
+ PP_ASSERT_WITH_CODE((0 == smum_send_msg_to_smc(hwmgr->smumgr,
PPSMC_MSG_DisableAvfs)),
+ "Failed to disable AVFS!",
+ return -1;);
+ }

Use a proper error code there like -EINVAL or something. With that fixed:

Alex

Quoted 88 lines

Best Regards
Rex

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Zhu, Rex
Sent: Wednesday, October 12, 2016 9:45 PM
To: Alex Deucher; Grazvydas Ignotas
Cc: amd-gfx list; Maling list - DRI developers
Subject: RE: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Hi Grazvydas and Alex,

We needed to disable dpm when rmmod amdgpu for this issue.

I am checking the function of disable dpm task.

Best Regards
Rex

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, October 12, 2016 4:01 AM
To: Grazvydas Ignotas; Zhu, Rex
Cc: Maling list - DRI developers; amd-gfx list
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

+Rex to review this.

Alex

Quoted 56 lines · Grazvydas Ignotas

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f Call
Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -2
index f6afa6a..327030b 100644
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr
 *hwmgr)
 
        tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
        PP_ASSERT_WITH_CODE(tmp_result == 0,
-                       "DPM is already running right now, no need to enable DPM!",
-                       return 0);
+                       "DPM is already running",
+                       );
 
        if (smu7_voltage_control(hwmgr)) {
                tmp_result = smu7_enable_voltage_control(hwmgr);

--
2.7.4

Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

From 0e338a127bbe5eb9de37a41330a62b0b0f5e1983 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Thu, 13 Oct 2016 11:22:17 -0400
Subject: [PATCH] drm/amdgpu: disable smu hw first on tear down

Otherwise, you can't disable dpm.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +24 -0
index b88a3b7..5a99a43 100644
@@ -1463,6 +1463,30 @@ static int amdgpu_fini(struct amdgpu_device *adev)
 {
 	int i, r;
 
+	/* need to disable SMC first */
+	for (i = 0; i < adev->num_ip_blocks; i++) {
+		if (!adev->ip_block_status[i].hw)
+			continue;
+		if (adev->ip_blocks[i].type == AMD_IP_BLOCK_TYPE_SMC) {
+			/* ungate blocks before hw fini so that we can shutdown the blocks safely */
+			r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev,
+									    AMD_CG_STATE_UNGATE);
+			if (r) {
+				DRM_ERROR("set_clockgating_state(ungate) of IP block <%s> failed %d\n",
+					  adev->ip_blocks[i].funcs->name, r);
+				return r;
+			}
+			r = adev->ip_blocks[i].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].funcs->name, r);
+			}
+			adev->ip_block_status[i].hw = false;
+			break;
+		}
+	}
+
 	for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
 		if (!adev->ip_block_status[i].hw)
 			continue;
Signature · 1 line
2.5.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): CADnq5_M=Lt1qoOG2=T+t+TjaJNJQpU=_vPqUZbusAq+6O7Hq9Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Reviewed-by Alex Deucher
#9 lore raw

Hi Alex,

Your new attached patch is Tested-by and Reviewed-by: Rex Zhu <[email protected]>

Just one question,

Do we need to set clock_gate for smu?

Best Regards
Rex

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Thursday, October 13, 2016 11:29 PM
To: Zhu, Rex
Cc: Grazvydas Ignotas; amd-gfx list; Maling list - DRI developers
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Quoted 6 lines · Rex

Hi all,

The attached patches were also for this issue. Disable dpm when rmmod amdgpu.

Please help to review.

Patch 1:
+ r = adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->hw_fini((void *)adev);
+ if (r)
+ DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+ adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->name, r);
+
+ adev->ip_block_status[AMD_IP_BLOCK_TYPE_SMC].hw = false;

You can't use AMD_IP_BLOCK_TYPE_* as index. Some chips may not have the IP block. Maybe something like the attached patch. That said, I think longer term it makes more sense to allows the SOCs to specify the order for init, fini, etc. otherwise we'll have lots of variable logic in the common code.

Patch 2:
+ if (1 == PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device,
CGS_IND_REG__SMC, FEATURE_STATUS, AVS_ON)) {
+ PP_ASSERT_WITH_CODE((0 == smum_send_msg_to_smc(hwmgr->smumgr,
PPSMC_MSG_DisableAvfs)),
+ "Failed to disable AVFS!",
+ return -1;);
+ }

Use a proper error code there like -EINVAL or something. With that fixed:

Alex

Quoted 92 lines

Best Regards
Rex

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Zhu, Rex
Sent: Wednesday, October 12, 2016 9:45 PM
To: Alex Deucher; Grazvydas Ignotas
Cc: amd-gfx list; Maling list - DRI developers
Subject: RE: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Hi Grazvydas and Alex,

We needed to disable dpm when rmmod amdgpu for this issue.

I am checking the function of disable dpm task.

Best Regards
Rex

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, October 12, 2016 4:01 AM
To: Grazvydas Ignotas; Zhu, Rex
Cc: Maling list - DRI developers; amd-gfx list
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

+Rex to review this.

Alex

Quoted 57 lines · Grazvydas Ignotas

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f Call
Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +0 -0
index f6afa6a..327030b 100644
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct 

pp_hwmgr
*hwmgr)

        tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
        PP_ASSERT_WITH_CODE(tmp_result == 0,
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -3
-                       "DPM is already running right now, no need to enable DPM!",
-                       return 0);
+                       "DPM is already running",
+                       );
 
        if (smu7_voltage_control(hwmgr)) {
                tmp_result = smu7_enable_voltage_control(hwmgr);
--

2.7.4

Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CY4PR12MB168731E2B30496DA257B1AFFFBDF0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#11 lore raw
Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Zhu, Rex
Sent: Friday, October 14, 2016 8:12 AM
To: Alex Deucher
Cc: Maling list - DRI developers; amd-gfx list
Subject: RE: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Quoted 8 lines

Hi Alex,

Your new attached patch is Tested-by and Reviewed-by: Rex Zhu <[email protected]>

Just one question,

Do we need to set clock_gate for smu?

At the moment, no, but if we ever have have clockgating for smu related IPs, we might as well include it. It matches the current behavior with respect to IP tear down.

Alex

Quoted 151 lines

Best Regards
Rex

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Thursday, October 13, 2016 11:29 PM
To: Zhu, Rex
Cc: Grazvydas Ignotas; amd-gfx list; Maling list - DRI developers
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Quoted 6 lines · Rex

Hi all,

The attached patches were also for this issue. Disable dpm when rmmod amdgpu.

Please help to review.

Patch 1:
+ r = adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->hw_fini((void
*)adev);

(quoted diff) +5 -0
+    if (r)
+        DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+            adev->ip_blocks[AMD_IP_BLOCK_TYPE_SMC].funcs->name, r);
+
+    adev->ip_block_status[AMD_IP_BLOCK_TYPE_SMC].hw = false;

You can't use AMD_IP_BLOCK_TYPE_* as index. Some chips may not have the IP block. Maybe something like the attached patch. That said, I think longer term it makes more sense to allows the SOCs to specify the order for init, fini, etc. otherwise we'll have lots of variable logic in the common code.

Patch 2:
+ if (1 == PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device,
CGS_IND_REG__SMC, FEATURE_STATUS, AVS_ON)) {
+ PP_ASSERT_WITH_CODE((0 == smum_send_msg_to_smc(hwmgr-

Quoted 1 line

smumgr,

PPSMC_MSG_DisableAvfs)),

(quoted diff) +3 -0
+                    "Failed to disable AVFS!",
+                    return -1;);
+    }

Use a proper error code there like -EINVAL or something. With that fixed:

Alex

Quoted 35 lines

Best Regards
Rex

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Zhu, Rex
Sent: Wednesday, October 12, 2016 9:45 PM
To: Alex Deucher; Grazvydas Ignotas
Cc: amd-gfx list; Maling list - DRI developers
Subject: RE: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Hi Grazvydas and Alex,

We needed to disable dpm when rmmod amdgpu for this issue.

I am checking the function of disable dpm task.

Best Regards
Rex

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Wednesday, October 12, 2016 4:01 AM
To: Grazvydas Ignotas; Zhu, Rex
Cc: Maling list - DRI developers; amd-gfx list
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

+Rex to review this.

Alex

On Sun, Oct 9, 2016 at 3:23 PM, Grazvydas Ignotas <[email protected]>

Quoted 57 lines · wrote:
Quoted 57 lines

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:

$ modprobe amdgpu
$ rmmod amdgpu
$ modprobe amdgpu
...
DPM is already running right now, no need to enable DPM!
...
failed to send message 18b ret is 0
BUG: unable to handle kernel paging request at ffffed01fc9ab21f Call
Trace:
 smu7_set_power_state_tasks+0x499/0x1940 [amdgpu]
 phm_set_power_state+0xcb/0x120 [amdgpu]
 psm_adjust_power_state_dynamic+0x11e/0x1b0 [amdgpu]
 pem_task_adjust_power_state+0xb9/0xd0 [amdgpu]
 pem_excute_event_chain+0x7d/0xe0 [amdgpu]
 pem_handle_event_unlocked+0x49/0x60 [amdgpu]
 pem_handle_event+0xe/0x10 [amdgpu]
 pp_dpm_dispatch_tasks+0xe0/0x190 [amdgpu]
 amdgpu_pm_compute_clocks+0x10c/0xc60 [amdgpu]
 dce_v11_0_crtc_dpms+0x7d/0x150 [amdgpu]
 dce_v11_0_crtc_disable+0x90/0x4a0 [amdgpu]
 drm_helper_disable_unused_functions+0x67/0x80 [drm_kms_helper]
 amdgpu_fbdev_init+0x13e/0x170 [amdgpu]
 amdgpu_device_init+0x1aeb/0x2490 [amdgpu]
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +0 -0
index f6afa6a..327030b 100644
@@ -1166,8 +1166,8 @@ static int smu7_enable_dpm_tasks(struct

pp_hwmgr
*hwmgr)

        tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
        PP_ASSERT_WITH_CODE(tmp_result == 0,
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -3
-                       "DPM is already running right now, no need to enable DPM!",
-                       return 0);
+                       "DPM is already running",
+                       );
 
        if (smu7_voltage_control(hwmgr)) {
                tmp_result = smu7_enable_voltage_control(hwmgr);
--

2.7.4

Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CY4PR12MB1687EAFA6B672B00C4C608D4FBDC0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#13 lore raw

Hi,

Quoted 3 lines · Rex

The attached patches were also for this issue.
Disable dpm when rmmod amdgpu.

It works for modprobe-rmmod-modprobe test, thanks.

However with GPU passthrough (giving control of the GPU to a Windows virtual machine using iommu, then shutting down the VM and loading amdgpu) the problem is still there, same backtrace as in my commit message. It seems the Windows driver leaves DPM enabled on shutdown. With my patch the crash goes away.

It would be nice to have GPU passthrough working, this is the only issue that breaks it. Windows can drive the GPU after amdgpu fine already, only amdgpu has problems to run after Windows.

Gražvydas
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CANOLnOM3XD6vX6rOH8ngrMGuQ+hZG7nFUV9fA=0L9BVi13bdVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#15 lore raw

Hi Gražvydas,

Sorry for so late response.

I can reproduce this issue in gpu passthrough case.

When we forced power off the VM or forced reset the VM without shutting down the Os, the rmmod will not be called. So dpm was still running.

If we skipped the enable dpm tasks, some clock tables were not be initialized, so kernel panic when we visited those tables in set power state.

I will send the fix patch for review tomorrow.

Thanks.

Best Regards
Rex

-----Original Message-----
From: Grazvydas Ignotas [mailto:[email protected]]
Sent: Sunday, October 16, 2016 2:55 AM
To: Zhu, Rex
Cc: Alex Deucher; amd-gfx list; Maling list - DRI developers
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Hi,

Quoted 3 lines · Rex

The attached patches were also for this issue.
Disable dpm when rmmod amdgpu.

It works for modprobe-rmmod-modprobe test, thanks.

However with GPU passthrough (giving control of the GPU to a Windows virtual machine using iommu, then shutting down the VM and loading amdgpu) the problem is still there, same backtrace as in my commit message. It seems the Windows driver leaves DPM enabled on shutdown. With my patch the crash goes away.

It would be nice to have GPU passthrough working, this is the only issue that breaks it. Windows can drive the GPU after amdgpu fine already, only amdgpu has problems to run after Windows.

Gražvydas
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Edward O'Callaghan Reviewed-by Rex Zhu
#16 lore raw
In reply to Grazvydas Ignotas

Hi Gražvydas,

In GPU passthrough case, I can't find better solution than yours from driver. So will apply your patch and just update reproduce step.

Thanks.

Best Regards
Rex

-----Original Message-----
From: Zhu, Rex
Sent: Wednesday, October 19, 2016 10:00 PM
To: 'Grazvydas Ignotas'
Cc: Alex Deucher; amd-gfx list; Maling list - DRI developers
Subject: RE: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Hi Gražvydas,

Sorry for so late response.

I can reproduce this issue in gpu passthrough case.

When we forced power off the VM or forced reset the VM without shutting down the Os, the rmmod will not be called. So dpm was still running.

If we skipped the enable dpm tasks, some clock tables were not be initialized, so kernel panic when we visited those tables in set power state.

I will send the fix patch for review tomorrow.

Thanks.

Best Regards
Rex

-----Original Message-----
From: Grazvydas Ignotas [mailto:[email protected]]
Sent: Sunday, October 16, 2016 2:55 AM
To: Zhu, Rex
Cc: Alex Deucher; amd-gfx list; Maling list - DRI developers
Subject: Re: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Hi,

Quoted 3 lines · Rex

The attached patches were also for this issue.
Disable dpm when rmmod amdgpu.

It works for modprobe-rmmod-modprobe test, thanks.

However with GPU passthrough (giving control of the GPU to a Windows virtual machine using iommu, then shutting down the VM and loading amdgpu) the problem is still there, same backtrace as in my commit message. It seems the Windows driver leaves DPM enabled on shutdown. With my patch the crash goes away.

It would be nice to have GPU passthrough working, this is the only issue that breaks it. Windows can drive the GPU after amdgpu fine already, only amdgpu has problems to run after Windows.

Gražvydas

From abd4e20061e1086688e59ee54f13e64011d9253a Mon Sep 17 00:00:00 2001
From: Grazvydas Ignotas <[email protected]>
Date: Thu, 20 Oct 2016 15:51:25 +0800
Subject: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

Currently the driver crashes if smu7_enable_dpm_tasks() returns early, which it does if DPM is already active. It seems to be better just to continue anyway, at least I haven't noticed any ill effects. It's also unclear at what state the hardware was left by the previous driver, so IMO it's better to always fully initialize.

Way to reproduce:
with GPU passthrough.
forced power off the VM or forced reset the VM
without shutting down the Os.

Change-Id If334c979270406ee91c68168c503ee062166a5fb
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -2
index 51b65b1..9e49f27 100644
@@ -1168,8 +1168,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 
 	tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
 	PP_ASSERT_WITH_CODE(tmp_result == 0,
-			"DPM is already running right now, no need to enable DPM!",
-			return 0);
+			"DPM is already running",
+			);
 
 	if (smu7_voltage_control(hwmgr)) {
 		tmp_result = smu7_enable_voltage_control(hwmgr);
Signature · 1 line
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx