public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leonid Maksymchuk <leonmaxx@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org,
	acpi4asus-user@lists.sourceforge.net, chiu@endlessm.com,
	kristian@klausen.dk, andy@infradead.org, dvhart@infradead.org,
	corentin.chary@gmail.com, Leonid Maksymchuk <leonmaxx@gmail.com>
Subject: [PATCH v5 2/2] platform/x86 asus_wmi: Set throttle thermal policy to default
Date: Sun, 24 Nov 2019 16:08:41 +0200	[thread overview]
Message-ID: <20191124140841.20929-1-leonmaxx@gmail.com> (raw)
In-Reply-To: <20191124140625.20736-1-leonmaxx@gmail.com>

ASUS TUF FX705DY/FX505DY starts in silent mode and under heavy
CPU load it overheats and drops CPU frequency to 399MHz and stays
at it until reboot [1]. Set throttle thermal policy to default
to avoid overheating and throttlig.

[1] Link: https://bugzilla.kernel.org/show_bug.cgi?id=203733

Signed-off-by: Leonid Maksymchuk <leonmaxx@gmail.com>
---
 drivers/platform/x86/asus-wmi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 88faea6..fe571d1 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1782,6 +1782,15 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus)
 	return 0;
 }
 
+static int throttle_thermal_policy_set_default(struct asus_wmi *asus)
+{
+	if (!asus->throttle_thermal_policy_available)
+		return 0;
+
+	asus->throttle_thermal_policy_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
+	return throttle_thermal_policy_write(asus);
+}
+
 static int throttle_thermal_policy_switch_next(struct asus_wmi *asus)
 {
 	u8 new_mode = asus->throttle_thermal_policy_mode + 1;
@@ -2552,6 +2561,8 @@ static int asus_wmi_add(struct platform_device *pdev)
 	err = throttle_thermal_policy_check_present(asus);
 	if (err)
 		goto fail_throttle_thermal_policy;
+	else
+		throttle_thermal_policy_set_default(asus);
 
 	err = asus_wmi_sysfs_init(asus->platform_device);
 	if (err)
-- 
1.8.3.1


  parent reply	other threads:[~2019-11-24 14:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24 14:06 [PATCH v5 0/2] platform/x86 asus_wmi: Support of ASUS TUF laptops on Ryzen CPUs Leonid Maksymchuk
2019-11-24 14:07 ` [PATCH v5 1/2] platform/x86 asus_wmi: Support throttle thermal policy Leonid Maksymchuk
2019-11-25 11:12   ` Andy Shevchenko
2019-11-24 14:08 ` Leonid Maksymchuk [this message]
2019-11-25 11:09 ` [PATCH v5 0/2] platform/x86 asus_wmi: Support of ASUS TUF laptops on Ryzen CPUs Andy Shevchenko

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=20191124140841.20929-1-leonmaxx@gmail.com \
    --to=leonmaxx@gmail.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=andy@infradead.org \
    --cc=chiu@endlessm.com \
    --cc=corentin.chary@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=kristian@klausen.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox