All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evan Quan <evan.quan@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alexander.Deucher@amd.com, Evan Quan <evan.quan@amd.com>
Subject: [PATCH 6/7] drm/amd/pm: drop unnecessary manual mode check
Date: Wed, 7 Jul 2021 09:56:46 +0800	[thread overview]
Message-ID: <20210707015647.139127-6-evan.quan@amd.com> (raw)
In-Reply-To: <20210707015647.139127-1-evan.quan@amd.com>

As the fan control was guarded under manual mode before fan speed
RPM/PWM setting. Thus the extra check is totally redundant.

Change-Id: Ia9d776141ec4aa39255accbf00d7e7ed81c8424d
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index f0ae0920c07e..319bd7689df4 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -1194,9 +1194,6 @@ smu_v11_0_set_fan_speed_percent(struct smu_context *smu, uint32_t speed)
 	if (speed > 255)
 		speed = 255;
 
-	if (smu_v11_0_auto_fan_control(smu, 0))
-		return -EINVAL;
-
 	duty100 = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL1),
 				CG_FDO_CTRL1, FMAX_DUTY100);
 	if (!duty100)
@@ -1218,11 +1215,6 @@ int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
 {
 	struct amdgpu_device *adev = smu->adev;
 	uint32_t tach_period, crystal_clock_freq;
-	int ret;
-
-	ret = smu_v11_0_auto_fan_control(smu, 0);
-	if (ret)
-		return ret;
 
 	/*
 	 * crystal_clock_freq div by 4 is required since the fan control
@@ -1244,9 +1236,7 @@ int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
 				   CG_TACH_CTRL, TARGET_PERIOD,
 				   tach_period));
 
-	ret = smu_v11_0_set_fan_static_mode(smu, FDO_PWM_MODE_STATIC_RPM);
-
-	return ret;
+	return smu_v11_0_set_fan_static_mode(smu, FDO_PWM_MODE_STATIC_RPM);
 }
 
 int smu_v11_0_get_fan_speed_percent(struct smu_context *smu,
-- 
2.29.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2021-07-07  1:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  1:56 [PATCH 1/7] drm/amd/pm: correct the fan speed RPM setting Evan Quan
2021-07-07  1:56 ` [PATCH 2/7] drm/amd/pm: record the RPM and PWM based fan speed settings Evan Quan
2021-07-07  4:53   ` Chen, Guchun
2021-07-07  8:53   ` Lazar, Lijo
2021-07-07  1:56 ` [PATCH 3/7] drm/amd/pm: correct the fan speed PWM retrieving Evan Quan
2021-07-07  9:03   ` Lazar, Lijo
2021-07-07  1:56 ` [PATCH 4/7] drm/amd/pm: correct the fan speed RPM retrieving Evan Quan
2021-07-07  4:58   ` Chen, Guchun
2021-07-07  9:05   ` Lazar, Lijo
2021-07-07  1:56 ` [PATCH 5/7] drm/amd/pm: drop the unnecessary intermediate percent-based transition Evan Quan
2021-07-07  5:00   ` Chen, Guchun
2021-07-07  6:26   ` Nils Wallménius
2021-07-07  9:07   ` Lazar, Lijo
2021-07-07  1:56 ` Evan Quan [this message]
2021-07-07  1:56 ` [PATCH 7/7] drm/amd/pm: correct the address of Arcturus fan related registers Evan Quan
2021-07-07  9:10   ` Lazar, Lijo
2021-07-07  4:47 ` [PATCH 1/7] drm/amd/pm: correct the fan speed RPM setting Chen, Guchun
2021-08-11  7:58   ` Quan, Evan
2021-07-07  8:49 ` Lazar, Lijo
2021-08-11  7:57   ` Quan, Evan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210707015647.139127-6-evan.quan@amd.com \
    --to=evan.quan@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.