Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3155072rwe; Mon, 29 Aug 2022 06:49:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ycXCpLvPXJBkqYgy8zxB9MXfvSxiLhZL9Z0MusomPmIBFQkAejYp+jU0DrvJ+Cznef4Wk X-Received: by 2002:a05:6a00:a19:b0:535:49ee:da43 with SMTP id p25-20020a056a000a1900b0053549eeda43mr16793804pfh.53.1661780941883; Mon, 29 Aug 2022 06:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661780941; cv=none; d=google.com; s=arc-20160816; b=ssoab9dZwCE4cTf1mm8odacvHGYpOqQOszZR1XR4Z9CXsu98RThgWvb3akXDJV2zhW Bdbp97u+GTVcl7VVGleWQ0uSaYjuNv86G/auf7S18njCPYF//SwaKSryU6MorAnwwg97 TBlDknh61x70J3e3bY44Uqvr5z4To0mt3D+pu/fQhsTJcc2IAC1TZSX0IR49KoGrAXyz mitC3xGElcXV1JMowJscdzs1EftVmLnvKshTl6ODSXCHiAT3lDE7eS3VvAfou9Q6MEi5 FB7DT/UF8ba2twlyZQHBrAHeJ/xeBIHsg9fxhfQjkUBpR4DpKGWwzDCXVZWvFkZBdYTD PYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=UVKTlnEIoldY+2ikvWrlNXqFFlr5euSvQ86GnWaZaho=; b=YNwGO0N+0f7a7Vts3YUcAs1Yq5HTLzexs4ltGc+qJ+V6xEuFn3IqWh7/eNAjRNMzXo mWInREPC/WHavD1M3h/S2iSRBHvWjK0yO8ne/pE5p/f/2U790x8ZkAuOzx4p4/DY40Jl LdDI9VwNqCJEYX17h+4AM8MFdvfps1b5xPByOsdeX6hPpDaWdFPudS3CLY3/U2GHZ3SV eEsAZCY79cO9RbBmxz/Fht1WONxK11bGk4MdX9Kun79UkzaCxudxqLUR+envXEG6/Egq WPXA2rDB9CQlONk1pNsP/B3gvZWrnSBVCpyZMSnIYEyInk9gXU++FhiBw6bK7UnMLIFV g2vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YwxHVBDf; 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 t29-20020a056a00139d00b005363ccd9195si9915752pfg.264.2022.08.29.06.48.50; Mon, 29 Aug 2022 06:49:01 -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=@gmail.com header.s=20210112 header.b=YwxHVBDf; 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 S230076AbiH2Ng3 (ORCPT + 99 others); Mon, 29 Aug 2022 09:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbiH2NgN (ORCPT ); Mon, 29 Aug 2022 09:36:13 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 224757E33E; Mon, 29 Aug 2022 06:35:59 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 69so6064996pgb.13; Mon, 29 Aug 2022 06:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc; bh=UVKTlnEIoldY+2ikvWrlNXqFFlr5euSvQ86GnWaZaho=; b=YwxHVBDf26Yi73o5+r444WKY7QqwFOzTEnFjSo8Bow1lqIga+JCUW7EEEpDsZ6iPSK Z04YZvt1Pt6J6R1j5ZWOXINdtvMh1pKvRTW8x5OhmpXBkvTcaZo99jG0R4UChrIVPpD/ GN3nf064cXJje0jWsQM+sFauz1vZ72PjZOG8m93aXj5VevRQMfTGagenqg8i79vq41t+ 4EtR5LLe8uItIbwb9EYJ4VyQOrkBmI8ENvppF9JhEyUMFcTV0/F7ZyXRpsAeOX6AVX3f CfKEhMu3GIXMTbOOXnQ5LfMsYV0Xsrua1peWIMOdlhxqLg+MBpyOigdEcuY+NT3ev+xs cJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc; bh=UVKTlnEIoldY+2ikvWrlNXqFFlr5euSvQ86GnWaZaho=; b=r6XP28DAGdnVxZ1mFxBVXmqSpjnNAUPijebHWBFQGgZ+dwZt2Pcu4VT0TrZS4Yhw3s VsyN5wfzxsQyCe8XuQgvQJ4OHOL4feq9UD+SzvzReI4EoQmTDCTiiUhsWSr4G9E5bZxk 5yNciwzEZ5bK73u/PdDeDzBAUaSKHjtX480SIZVoMHkh1dgV+vPxRfF9Ow8tlpbW6M2J atLn9A3WpoGrg91vErzunusNwAE60HtaVlVeHHs/exqOBd7rNV8GE6BCroJlmCxXjGPE 68bIIF61OddUdjrWKZpkU+JdJMb9VmvJ6Fa9pLXGw5f55ZbQ7AurXzPB0BF4vkGwz6It g/hQ== X-Gm-Message-State: ACgBeo2iHFwllIFAyUeeLn4M7QJh7tq2wS5/WSMuEJjj/tuUUMZ9vj/4 ykV+R2P2xB2po7UL0NuQAjY= X-Received: by 2002:a63:6cc1:0:b0:42b:d2c5:74a2 with SMTP id h184-20020a636cc1000000b0042bd2c574a2mr6952942pgc.420.1661780158463; Mon, 29 Aug 2022 06:35:58 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 35-20020a630c63000000b0041c35462316sm6409401pgm.26.2022.08.29.06.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 06:35:57 -0700 (PDT) Sender: Guenter Roeck Date: Mon, 29 Aug 2022 06:35:56 -0700 From: Guenter Roeck To: "Luke D. Jones" Cc: hdegoede@redhat.com, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, platform-driver-x86@vger.kernel.org, markgross@kernel.org Subject: Re: [PATCH] asus-wmi: Increase FAN_CURVE_BUF_LEN to 32 Message-ID: <20220829133556.GA3766826@roeck-us.net> References: <20220828074638.5473-1-luke@ljones.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220828074638.5473-1-luke@ljones.dev> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Sun, Aug 28, 2022 at 07:46:38PM +1200, Luke D. Jones wrote: > 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 */ The pr_warn() should be here. If you want to have a message from the call in fan_curve_enable_store(), add dev_err() there. Guenter > return 0; > } >