Re: drm/amd/pm: workaround for the wrong ac power detection on smu 13.0.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/24/2023 22:19, Kenneth Feng wrote:
workaround for the wrong ac power detection on smu 13.0.0

Signed-off-by: Kenneth Feng <kenneth.feng@xxxxxxx>

This workaround appears to be only necessary if you're missing these commits.

a7fbfd44c020 ("usb: typec: ucsi: Mark dGPUs as DEVICE scope")
95339f40a8b6 ("power: supply: Fix logic checking if system is running from battery")

If this is run on a kernel with those commits then it's going to be broken in reverse.

I suspect the reason that you want to do this workaround is because you're trying to run on a kernel without them and which you can't add them.

If that's the case I think a better/safer temporary workaround is to add a module parameter or a debugfs entry to use.

---
  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c       | 3 +--
  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 1 -
  2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
index 0232adb95df3..fd1798fd716e 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
@@ -1021,8 +1021,7 @@ static int smu_v13_0_process_pending_interrupt(struct smu_context *smu)
  {
  	int ret = 0;
- if (smu->dc_controlled_by_gpio &&
-	    smu_cmn_feature_is_enabled(smu, SMU_FEATURE_ACDC_BIT))
+	if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_ACDC_BIT))
  		ret = smu_v13_0_allow_ih_interrupt(smu);
return ret;
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
index 3903a47669e4..128468355375 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
@@ -2664,7 +2664,6 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {
  	.enable_mgpu_fan_boost = smu_v13_0_0_enable_mgpu_fan_boost,
  	.get_power_limit = smu_v13_0_0_get_power_limit,
  	.set_power_limit = smu_v13_0_set_power_limit,
-	.set_power_source = smu_v13_0_set_power_source,
  	.get_power_profile_mode = smu_v13_0_0_get_power_profile_mode,
  	.set_power_profile_mode = smu_v13_0_0_set_power_profile_mode,
  	.run_btc = smu_v13_0_run_btc,




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux