Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: asus-wmi: Increase FAN_CURVE_BUF_LEN to 32

Fix for TUF laptops returning with an -ENOSPC on calling
asus_wmi_evaluate_method_buf() when fetching default curves. The TUF method
requires at least 32 bytes space.

This also moves and changes the pr_debug() in fan_curve_check_present() to
pr_warn() in fan_curve_get_factory_default() so that there is at least some
indication in logs of why it fails.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20220828074638.5473-1-luke@ljones.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Luke D. Jones and committed by
Hans de Goede
a2bdf10c 6dd9eb95

+4 -5
+4 -5
drivers/platform/x86/asus-wmi.c
··· 108 108 #define WMI_EVENT_MASK 0xFFFF 109 109 110 110 #define FAN_CURVE_POINTS 8 111 - #define FAN_CURVE_BUF_LEN (FAN_CURVE_POINTS * 2) 111 + #define FAN_CURVE_BUF_LEN 32 112 112 #define FAN_CURVE_DEV_CPU 0x00 113 113 #define FAN_CURVE_DEV_GPU 0x01 114 114 /* Mask to determine if setting temperature or percentage */ ··· 2383 2383 curves = &asus->custom_fan_curves[fan_idx]; 2384 2384 err = asus_wmi_evaluate_method_buf(asus->dsts_id, fan_dev, mode, buf, 2385 2385 FAN_CURVE_BUF_LEN); 2386 - if (err) 2386 + if (err) { 2387 + pr_warn("%s (0x%08x) failed: %d\n", __func__, fan_dev, err); 2387 2388 return err; 2389 + } 2388 2390 2389 2391 fan_curve_copy_from_buf(curves, buf); 2390 2392 curves->device_id = fan_dev; ··· 2404 2402 2405 2403 err = fan_curve_get_factory_default(asus, fan_dev); 2406 2404 if (err) { 2407 - pr_debug("fan_curve_get_factory_default(0x%08x) failed: %d\n", 2408 - fan_dev, err); 2409 - /* Don't cause probe to fail on devices without fan-curves */ 2410 2405 return 0; 2411 2406 } 2412 2407