Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2010133rwe; Sun, 28 Aug 2022 01:17:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Nif7c18I424itT+SvyMoFSuIotheV2s1kcZMdYOTwuDaST5RIhqjLIjhd9rLqQnycCKgf X-Received: by 2002:a05:6a00:810:b0:52e:7dc8:c868 with SMTP id m16-20020a056a00081000b0052e7dc8c868mr11364786pfk.36.1661674658454; Sun, 28 Aug 2022 01:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661674658; cv=none; d=google.com; s=arc-20160816; b=PcZVoqlA5cfBJFSvcvucbB5AkexLGjio5XlNNlF8uvIfV1bWFjNY8fowJbcVwS71ge tdcNW68F79oUpNUpj67GO0VnTixT9rdUjKFwAZrfc487xPRVZU4NzZkxAMD4kE6rDXwL Axtm958tlC8LoAsiq87fMBlXOqQSsCq1bgBIcX9/iwMehBNFlXbA7NyPITWVOHXXx161 wD4mSlom/SWoQId/yzU0eB2tmAPQLilc06UyiOleXOmEvT26MmnT+qBCt4c+dU0IBoUR CZbvlk5fIidDCx8d+MNg4sIRlwJ5FlVGrCQGQcH34RtRp9e8M2jLcJYj7us4Iey34/Qo YLgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=xmumsxBjbgYu7DsPGi9nc0Yk4a2Zt1uVg21vHFB9wxc=; b=BdkGL/ryUmaI/Qe+oCNwKYgWnIkePMDE71LFnUiQ6O+WwJ9JEUyyppCIqne4uUlRyt g5HsnQgWO4ESBAd7JWw2NhYBdkl6SjtHfypIpKmKvKV8uZwcKQUKwVGGftWDcVv38+/S 0olw05Xj/TXfuU3vhrZNzPJHfsbLwo2rQwr0pf9SkLOk3qKMrVxCBJW61EH9ijJUkWD6 KMOe0IJalPZXBArUVRsSkjb+6NNwZHLV9AUhwaI02EgUDsNTD5LXcu09vG3NIKaIOe+K cnhZtf1t6dn/jEEIm1C1W39yJ9Fs7t2KxWV3fsLU57+RThycD+5jQ26UELKaIASV5Mgi ArqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=aXN6PLz5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HpkWXBIs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j71-20020a638b4a000000b0042a08b6ae1fsi3206125pge.4.2022.08.28.01.17.27; Sun, 28 Aug 2022 01:17:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=aXN6PLz5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HpkWXBIs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232642AbiH1Hq6 (ORCPT + 99 others); Sun, 28 Aug 2022 03:46:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231990AbiH1Hqz (ORCPT ); Sun, 28 Aug 2022 03:46:55 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49EE3399E4; Sun, 28 Aug 2022 00:46:54 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 4770332007F0; Sun, 28 Aug 2022 03:46:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 28 Aug 2022 03:46:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1661672810; x=1661759210; bh=xmumsxBjbgYu7DsPGi9nc0Yk4 a2Zt1uVg21vHFB9wxc=; b=aXN6PLz5r7vKhbuALbBvp3rNQiRaJLQEkhzNcMLQw xt72NL2wUxTS+qC5lTzuPT48q2j8NEdgrJZIQEuYUCy3zznviT9ocrxNMIClT4Y8 kZ13y3gPAUA+R73gwiTUt1U3AdUybuEO6Mg7UANQndmti/T7lMGl0ynotiUW4ZEU hzng5/WZUm/ypUgg33mjLUtUE9zLlJT6JVYfby43ud67lxHDWa9BJGxSmySKtYH/ b0ucW7FCxhUzAp9yUL73Bbh7/Y2DGJvSRT23ekd0I0TKxhdrSWgYiv3E5jkmcJO8 XfCFmzYFEx6han27GH2dQzLNlxFakKEeg8UWulyMu4I3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1661672810; x=1661759210; bh=xmumsxBjbgYu7DsPGi9nc0Yk4a2Zt1uVg21 vHFB9wxc=; b=HpkWXBIs3kUyIyJ6pxAxWmlTe/UudOs6AIY2fTyXXtfOUR/sf12 fpUqX/Og5QswNA/lHmApML41gVcHczS4fLi++2nQIvtk+M9GIgHTiU1MTKv79dxr Pwqlclxjq+8n76g93H+nENe2muh+X6A996SgEGekzBYBB05dpkqieHnnUCp3VuM4 pxYEXySr7NnZkZLrkE6wXp/H2q7ckgE0DSMMQpW+Kmvxowum+I7T1koNKgQQtJiT h9m/7agzqzz2+jHZWZv/POgyew7uQeMPWq0iwY5YDuiA+Tbw3eMbAvkrO6GHAx4a pq1+5pf7eJNi0kTy/GWLFPHK1aFApPEta4A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejkedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgggfestdekre dtredttdenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvgeslhhj ohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpefgudejtdfhuddukefffeekiefftd dtvdfhgeduudeuffeuhfefgfegfeetvedvgeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Aug 2022 03:46:47 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, platform-driver-x86@vger.kernel.org, markgross@kernel.org, "Luke D. Jones" Subject: [PATCH] asus-wmi: Increase FAN_CURVE_BUF_LEN to 32 Date: Sun, 28 Aug 2022 19:46:38 +1200 Message-Id: <20220828074638.5473-1-luke@ljones.dev> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/platform/x86/asus-wmi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 3d9fd58573f9..11203213e00d 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -108,7 +108,7 @@ module_param(fnlock_default, bool, 0444); #define WMI_EVENT_MASK 0xFFFF #define FAN_CURVE_POINTS 8 -#define FAN_CURVE_BUF_LEN (FAN_CURVE_POINTS * 2) +#define FAN_CURVE_BUF_LEN 32 #define FAN_CURVE_DEV_CPU 0x00 #define FAN_CURVE_DEV_GPU 0x01 /* Mask to determine if setting temperature or percentage */ @@ -2383,8 +2383,10 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev) curves = &asus->custom_fan_curves[fan_idx]; err = asus_wmi_evaluate_method_buf(asus->dsts_id, fan_dev, mode, buf, FAN_CURVE_BUF_LEN); - if (err) + if (err) { + pr_warn("%s (0x%08x) failed: %d\n", __func__, fan_dev, err); return err; + } fan_curve_copy_from_buf(curves, buf); curves->device_id = fan_dev; @@ -2402,9 +2404,6 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available, err = fan_curve_get_factory_default(asus, fan_dev); if (err) { - pr_debug("fan_curve_get_factory_default(0x%08x) failed: %d\n", - fan_dev, err); - /* Don't cause probe to fail on devices without fan-curves */ return 0; } -- 2.37.2