mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] platform/x86: asus-wmi: Add quirk wmi_ignore_fan
  2022-12-21 17:59 [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Thomas Weißschuh
@ 2022-12-21 17:59 ` Thomas Weißschuh
  2022-12-21 17:59 ` [PATCH 2/3] platform/x86: asus-wmi: Ignore fan on E410MA Thomas Weißschuh
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Weißschuh @ 2022-12-21 17:59 UTC (permalink / raw)
  To: Corentin Chary, Hans de Goede, Mark Gross, Luke D. Jones
  Cc: acpi4asus-user, platform-driver-x86, linux-kernel, Thomas Weißschuh

Some laptops have a fan device listed in their ACPI tables but do not
actually contain a fan.
Introduce a quirk that can be used to override the fan detection logic.

This was observed with a ASUS VivoBook E410MA running firmware
E410MAB.304.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/platform/x86/asus-wmi.c | 4 +++-
 drivers/platform/x86/asus-wmi.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6f81b2844dcb..4a289ca7e76c 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -2243,7 +2243,9 @@ static int asus_wmi_fan_init(struct asus_wmi *asus)
 	asus->fan_type = FAN_TYPE_NONE;
 	asus->agfn_pwm = -1;
 
-	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL))
+	if (asus->driver->quirks->wmi_ignore_fan)
+		asus->fan_type = FAN_TYPE_NONE;
+	else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL))
 		asus->fan_type = FAN_TYPE_SPEC83;
 	else if (asus_wmi_has_agfn_fan(asus))
 		asus->fan_type = FAN_TYPE_AGFN;
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 65316998b898..a478ebfd34df 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -38,6 +38,7 @@ struct quirk_entry {
 	bool store_backlight_power;
 	bool wmi_backlight_set_devstate;
 	bool wmi_force_als_set;
+	bool wmi_ignore_fan;
 	enum asus_wmi_tablet_switch_mode tablet_switch_mode;
 	int wapf;
 	/*

-- 
2.39.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device
@ 2022-12-21 17:59 Thomas Weißschuh
  2022-12-21 17:59 ` [PATCH 1/3] platform/x86: asus-wmi: Add quirk wmi_ignore_fan Thomas Weißschuh
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Weißschuh @ 2022-12-21 17:59 UTC (permalink / raw)
  To: Corentin Chary, Hans de Goede, Mark Gross, Luke D. Jones
  Cc: acpi4asus-user, platform-driver-x86, linux-kernel, Thomas Weißschuh

This series fixes issues experienced on a fanless ASUS VivoBook E410MA.

To: Corentin Chary <corentin.chary@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
To: Mark Gross <markgross@kernel.org>
To: "Luke D. Jones" <luke@ljones.dev>
Cc: acpi4asus-user@lists.sourceforge.net
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---
Thomas Weißschuh (3):
      platform/x86: asus-wmi: Add quirk wmi_ignore_fan
      platform/x86: asus-wmi: Ignore fan on E410MA
      platform/x86: asus-wmi: Don't load fan curves without fan

 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 drivers/platform/x86/asus-wmi.c    |  7 ++++++-
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)
---
base-commit: b6bb9676f2165d518b35ba3bea5f1fcfc0d969bf
change-id: 20221221-asus-fan-9aeac7d59c6c

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] platform/x86: asus-wmi: Ignore fan on E410MA
  2022-12-21 17:59 [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Thomas Weißschuh
  2022-12-21 17:59 ` [PATCH 1/3] platform/x86: asus-wmi: Add quirk wmi_ignore_fan Thomas Weißschuh
@ 2022-12-21 17:59 ` Thomas Weißschuh
  2022-12-21 17:59 ` [PATCH 3/3] platform/x86: asus-wmi: Don't load fan curves without fan Thomas Weißschuh
  2023-01-12 18:36 ` [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Weißschuh @ 2022-12-21 17:59 UTC (permalink / raw)
  To: Corentin Chary, Hans de Goede, Mark Gross, Luke D. Jones
  Cc: acpi4asus-user, platform-driver-x86, linux-kernel, Thomas Weißschuh

The ASUS VivoBook has a fan device described in its ACPI tables but does
not actually contain any physical fan.
Use the quirk to inhibit fan handling.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index c685a705b73d..5b603c686c8a 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -121,6 +121,10 @@ static struct quirk_entry quirk_asus_tablet_mode = {
 	.tablet_switch_mode = asus_wmi_lid_flip_rog_devid,
 };
 
+static struct quirk_entry quirk_asus_ignore_fan = {
+	.wmi_ignore_fan = true,
+};
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
 	pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -473,6 +477,15 @@ static const struct dmi_system_id asus_quirks[] = {
 		},
 		.driver_data = &quirk_asus_tablet_mode,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUS VivoBook E410MA",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "E410MA"),
+		},
+		.driver_data = &quirk_asus_ignore_fan,
+	},
 	{},
 };
 

-- 
2.39.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/3] platform/x86: asus-wmi: Don't load fan curves without fan
  2022-12-21 17:59 [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Thomas Weißschuh
  2022-12-21 17:59 ` [PATCH 1/3] platform/x86: asus-wmi: Add quirk wmi_ignore_fan Thomas Weißschuh
  2022-12-21 17:59 ` [PATCH 2/3] platform/x86: asus-wmi: Ignore fan on E410MA Thomas Weißschuh
@ 2022-12-21 17:59 ` Thomas Weißschuh
  2023-01-12 18:36 ` [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Weißschuh @ 2022-12-21 17:59 UTC (permalink / raw)
  To: Corentin Chary, Hans de Goede, Mark Gross, Luke D. Jones
  Cc: acpi4asus-user, platform-driver-x86, linux-kernel, Thomas Weißschuh

If we do not have a fan it does not make sense to load curves for it.
This removes the following warnings from the kernel log:

asus_wmi: fan_curve_get_factory_default (0x00110024) failed: -19
asus_wmi: fan_curve_get_factory_default (0x00110025) failed: -19

Fixes: a2bdf10ce96e ("platform/x86: asus-wmi: Increase FAN_CURVE_BUF_LEN to 32")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/platform/x86/asus-wmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 4a289ca7e76c..104188d70988 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -2438,6 +2438,9 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available,
 
 	*available = false;
 
+	if (asus->fan_type == FAN_TYPE_NONE)
+		return 0;
+
 	err = fan_curve_get_factory_default(asus, fan_dev);
 	if (err) {
 		return 0;

-- 
2.39.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device
  2022-12-21 17:59 [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Thomas Weißschuh
                   ` (2 preceding siblings ...)
  2022-12-21 17:59 ` [PATCH 3/3] platform/x86: asus-wmi: Don't load fan curves without fan Thomas Weißschuh
@ 2023-01-12 18:36 ` Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2023-01-12 18:36 UTC (permalink / raw)
  To: Thomas Weißschuh, Corentin Chary, Mark Gross, Luke D. Jones
  Cc: acpi4asus-user, platform-driver-x86, linux-kernel

Hi,

On 12/21/22 18:59, Thomas Weißschuh wrote:
> This series fixes issues experienced on a fanless ASUS VivoBook E410MA.
> 
> To: Corentin Chary <corentin.chary@gmail.com>
> To: Hans de Goede <hdegoede@redhat.com>
> To: Mark Gross <markgross@kernel.org>
> To: "Luke D. Jones" <luke@ljones.dev>
> Cc: acpi4asus-user@lists.sourceforge.net
> Cc: platform-driver-x86@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Thank you for your patch series, I've applied this series
to my fixes branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes

Note it will show up in my fixes branch once I've pushed my
local branch there, which might take a while.

I will include this patch in my next fixes pull-req to Linus
for the current kernel development cycle.

Regards,

Hans





> 
> ---
> Thomas Weißschuh (3):
>       platform/x86: asus-wmi: Add quirk wmi_ignore_fan
>       platform/x86: asus-wmi: Ignore fan on E410MA
>       platform/x86: asus-wmi: Don't load fan curves without fan
> 
>  drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
>  drivers/platform/x86/asus-wmi.c    |  7 ++++++-
>  drivers/platform/x86/asus-wmi.h    |  1 +
>  3 files changed, 20 insertions(+), 1 deletion(-)
> ---
> base-commit: b6bb9676f2165d518b35ba3bea5f1fcfc0d969bf
> change-id: 20221221-asus-fan-9aeac7d59c6c
> 
> Best regards,


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-12 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 17:59 [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Thomas Weißschuh
2022-12-21 17:59 ` [PATCH 1/3] platform/x86: asus-wmi: Add quirk wmi_ignore_fan Thomas Weißschuh
2022-12-21 17:59 ` [PATCH 2/3] platform/x86: asus-wmi: Ignore fan on E410MA Thomas Weißschuh
2022-12-21 17:59 ` [PATCH 3/3] platform/x86: asus-wmi: Don't load fan curves without fan Thomas Weißschuh
2023-01-12 18:36 ` [PATCH 0/3] platform/x86: asus-wmi: Fix issues on fanless device Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®