All of lore.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,
	yurii.pavlovskyi@gmail.com, kristian@klausen.dk,
	andy@infradead.org, dvhart@infradead.org,
	corentin.chary@gmail.com, Leonid Maksymchuk <leonmaxx@gmail.com>
Subject: [PATCH v2 3/3] platform/x86: asus_wmi: Set default fan boost mode to normal
Date: Mon,  4 Nov 2019 23:39:07 +0200	[thread overview]
Message-ID: <20191104213907.18413-1-leonmaxx@gmail.com> (raw)
In-Reply-To: <20191104213417.18036-1-leonmaxx@gmail.com>

Set default fan boost mode to normal for multiple reasons:

1) existing code assumes that laptop started in normal mode and that is
   not always correct.
2) FX705DY/FX505DY starts in silent mode and under heavy CPU load it
   overheats and drops CPU frequency to 399MHz [1]. Setting fan mode to
   normal avoids overheating.

[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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index f4e5840..70c5fbb 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1674,6 +1674,18 @@ static int fan_boost_mode_write(struct asus_wmi *asus)
 	return 0;
 }
 
+static int fan_boost_mode_set_default(struct asus_wmi *asus)
+{
+	int result = 0;
+
+	if (asus->fan_boost_mode_available) {
+		asus->fan_boost_mode = ASUS_FAN_BOOST_MODE_NORMAL;
+		result = fan_boost_mode_write(asus);
+	}
+
+	return result;
+}
+
 static int fan_boost_mode_switch_next(struct asus_wmi *asus)
 {
 	u8 mask = asus->fan_boost_mode_mask;
@@ -2450,6 +2462,7 @@ static int asus_wmi_add(struct platform_device *pdev)
 	err = fan_boost_mode_check_present(asus);
 	if (err)
 		goto fail_fan_boost_mode;
+	fan_boost_mode_set_default(asus);
 
 	err = asus_wmi_sysfs_init(asus->platform_device);
 	if (err)
-- 
1.8.3.1


  parent reply	other threads:[~2019-11-04 21:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 21:34 [PATCH v2 0/3] asus_wmi: Support of ASUS TUF laptops on Ryzen CPUs Leonid Maksymchuk
2019-11-04 21:37 ` [PATCH v2 1/3] platform/x86: asus_wmi: Fix return value of fan_boost_mode_store Leonid Maksymchuk
2019-11-04 21:38 ` [PATCH v2 2/3] platform/x86: asus_wmi: Support fan boost mode on FX505DY/FX705DY Leonid Maksymchuk
2019-11-05  0:00   ` kbuild test robot
2019-11-05  0:00     ` kbuild test robot
2019-11-05  0:00     ` kbuild test robot
2019-11-06  7:04     ` Andy Shevchenko
2019-11-06  7:04       ` Andy Shevchenko
2019-11-07 17:15   ` Andy Shevchenko
2019-11-07 18:31     ` Leonid Maksymchuk
2019-11-04 21:39 ` Leonid Maksymchuk [this message]
2019-11-06  7:03   ` [PATCH v2 3/3] platform/x86: asus_wmi: Set default fan boost mode to normal Andy Shevchenko
2019-11-06  7:21 ` [PATCH v2 0/3] 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=20191104213907.18413-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 \
    --cc=yurii.pavlovskyi@gmail.com \
    /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.