Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5527065rwn; Mon, 12 Sep 2022 10:16:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR6hg9qZ6Z36qZiJTxb7jE3egukljlhByA+SC2FsuANGV+WSzTofFL1TKvUgv/3knWYYclKB X-Received: by 2002:a17:907:a424:b0:774:7eb9:9274 with SMTP id sg36-20020a170907a42400b007747eb99274mr14823944ejc.301.1663002992906; Mon, 12 Sep 2022 10:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663002992; cv=none; d=google.com; s=arc-20160816; b=ovLG0q7jbfvlSDtunjP29X//4w9pkTuwmBVVUTM/gaZJsKdqol5YyUj9UL2a5ALfrX iLjjfhQsPaCmYqVfcNoIV0V//I7IPay3R/z1tKc2r+bNRCwBhjqmdOvjgb+gU8J66MAM 7Mq0YSXaYjlFudXw+hUDCzWZfWRgdNw16uCmlK/GQ9FUc/TzYzNe/ptJkoO1rgnwamRe WcIpiHjc3ieeSDj7i4cKP5mB4hp0zxPCtTO6zBOnwgsAto4PFAd/OKkhlP5McfneCkHD Y9KZb7LeuQn7AtViGbJpHzcNvNBo1iTF7BaJPsqYlhkjmUH7fI59W/d/cHLYtezp5GuB fsQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=oMkhE0t6jKHS9gOEJlLL58JzB03vinVVkGANNn41C8M=; b=VTACI+lA35n/Dho3iLntrlb9Wv0Fzd/lYKg5Ptc6NslHUgBU/Ddu1/LZw+3t5yfKYL h4X3RKBdbCcm2jZYy+0tjI+jh5byyWH7EvkRUYHbJEWjTbhAhACUusjgbolBOtmf6ive KiX1yrqA1eRqHf/+C3+xZ2oJimvAMl0/FVAKLnryFPOXgcmz3s+5SqNLL10UdElGgv2j ZhW8KKYbXTM5oNXBYjP0tM0UQP1JP+sw97k2o2rk5oi+Xo42RdqJbS9ENrlYj5BlL1Sm o/gdCaouGFJtAxEaRX8Ck3bWO8xiZD8DRxtlqQQAac3rHYyg2F5++cqGjmh/xOcVqHR9 pZRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=F9q1avKp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j8-20020a50ed08000000b0044e86981ea9si4258160eds.390.2022.09.12.10.16.02; Mon, 12 Sep 2022 10:16:32 -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=F9q1avKp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbiILQg2 (ORCPT + 99 others); Mon, 12 Sep 2022 12:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbiILQgW (ORCPT ); Mon, 12 Sep 2022 12:36:22 -0400 Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDACC2229F; Mon, 12 Sep 2022 09:36:21 -0700 (PDT) Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-333a4a5d495so107821437b3.10; Mon, 12 Sep 2022 09:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=oMkhE0t6jKHS9gOEJlLL58JzB03vinVVkGANNn41C8M=; b=F9q1avKpewsEoOtSW75rKk+2Gta6Pz3azQ1CxJtytiuY/MJcMdnptlEuyK92IHBqCk 2QyM0WnbZ5HqcgLO6PnfXasiBWwYB/AzdsnEUnirYLjaV8DwzRQ4B9dl4djA6CnIklRo Km/J1SESc/d0kjVse9ZKZTaDFstTNMoYAWX6+cUBWUaaYjSQG0NtuH2bhbYmLy2F3wQ0 Ff9XuTw08txtQHuMleyvaavHiW4jY0/oXrXRQM8UAn5jC/v5xzBi3qt4dMd/ZSWABpD8 dlSDgUtM4kyx/LrsKN7WTR7iB0ucE2dZYGpikixl2ST1ggPJYAGP0oF5diX1ce6r1Z9C pZvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=oMkhE0t6jKHS9gOEJlLL58JzB03vinVVkGANNn41C8M=; b=fGY7UovW6KIi/nBeIfsMWkNaSOgjsyskKmbzRcZ/4EeJQgNDCewpBMxDabLyHEtRal F2kqfuGVQg+ctKHoFeP/pHjOWHEuf/a+9Ij4gz5oUnZymKl6WbbEifIQ1nf83oo0x78Z EsVEfyt7e/a018sxnObXGB3Ly5OorFt4AExgj2/pZaIm/svqHz/L+OJA0OeuBkPH0j4C ebSmZKBV2yJuCgAUQ75XOTX3UEpi5/B/GCtc0nzTnLX+ltOymMOdP1JaYCz7VpPNL8vj Wr8HNouMdidjMPzReDQHcj/sX4peKr65qLql5LccsHT4OTjkSElcKsvDLtLY8OPCZf4Q PhUw== X-Gm-Message-State: ACgBeo2RNjxCVS7LpEZfTVefDyra9I1bUQmnCUbQxnjz0AYK/Ow6gYu3 Yvz2RhmORR+w/Mryf0QH75Z1293w9Raua7n497M= X-Received: by 2002:a0d:e344:0:b0:324:37f6:85df with SMTP id m65-20020a0de344000000b0032437f685dfmr22902025ywe.517.1663000581069; Mon, 12 Sep 2022 09:36:21 -0700 (PDT) MIME-Version: 1.0 References: <20220906170239.30384-1-jorge.lopez2@hp.com> <1d2d7da9-3046-b5fc-da6f-7615aa8a8285@redhat.com> In-Reply-To: <1d2d7da9-3046-b5fc-da6f-7615aa8a8285@redhat.com> From: Jorge Lopez Date: Mon, 12 Sep 2022 11:36:10 -0500 Message-ID: Subject: Re: [PATCH v1 1/1] hp-wmi: Setting thermal profile fails with 0x06 To: Hans de Goede Cc: balalic.enver@gmail.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, markgross@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Hi Hans, On Fri, Sep 9, 2022 at 1:01 PM Hans de Goede wrote: > > Hi Jorge, > > On 9/6/22 19:02, Jorge Lopez wrote: > > Error 0x06 (invalid command parameter) is reported by hp-wmi module > > when reading the current thermal profile and then proceed to set it > > back. The failing condition occurs in Linux NixOS after user > > configures the thermal profile to =E2=80=98quiet mode=E2=80=99 in Windo= ws. Quiet Fan > > Mode is supported in Windows but was not supported in hp-wmi module. > > > > This fix adds support for PLATFORM_PROFILE_QUIET in hp-wmi module for > > HP notebooks other than HP Omen series. Quiet thermal profile is not > > supported in HP Omen series notebooks. > > > > Signed-off-by: Jorge Lopez > > Thank you for looking into this! > > > > > > > --- > > Based on the latest platform-drivers-x86.git/for-next > > --- > > drivers/platform/x86/hp-wmi.c | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wm= i.c > > index bc7020e9df9e..f5c13df35af0 100644 > > --- a/drivers/platform/x86/hp-wmi.c > > +++ b/drivers/platform/x86/hp-wmi.c > > @@ -177,7 +177,8 @@ enum hp_thermal_profile_omen_v1 { > > enum hp_thermal_profile { > > HP_THERMAL_PROFILE_PERFORMANCE =3D 0x00, > > HP_THERMAL_PROFILE_DEFAULT =3D 0x01, > > - HP_THERMAL_PROFILE_COOL =3D 0x02 > > + HP_THERMAL_PROFILE_COOL =3D 0x02, > > + HP_THERMAL_PROFILE_QUIET =3D 0x03, > > }; > > > > #define IS_HWBLOCKED(x) ((x & HPWMI_POWER_FW_OR_HW) !=3D HPWMI_POWER_F= W_OR_HW) > > @@ -1194,6 +1195,9 @@ static int hp_wmi_platform_profile_get(struct pla= tform_profile_handler *pprof, > > case HP_THERMAL_PROFILE_COOL: > > *profile =3D PLATFORM_PROFILE_COOL; > > break; > > + case HP_THERMAL_PROFILE_QUIET: > > + *profile =3D PLATFORM_PROFILE_QUIET; > > + break; > > default: > > return -EINVAL; > > } > > @@ -1216,6 +1220,10 @@ static int hp_wmi_platform_profile_set(struct pl= atform_profile_handler *pprof, > > case PLATFORM_PROFILE_COOL: > > tp =3D HP_THERMAL_PROFILE_COOL; > > break; > > + case PLATFORM_PROFILE_QUIET: > > + tp =3D HP_THERMAL_PROFILE_QUIET; > > + break; > > + > > default: > > return -EOPNOTSUPP; > > } > > @@ -1266,6 +1274,7 @@ static int thermal_profile_setup(void) > > } > > > > set_bit(PLATFORM_PROFILE_COOL, platform_profile_handler.choices); > > + set_bit(PLATFORM_PROFILE_QUIET, platform_profile_handler.choices)= ; > > In the commit msg you say that quiet profile is only supported on the non= Omen > models, should this then not be inside the else branch of the: > > if (is_omen_thermal_profile()) { ... } else { ... } > > just above this code block ? > > > set_bit(PLATFORM_PROFILE_BALANCED, platform_profile_handler.choic= es); > > set_bit(PLATFORM_PROFILE_PERFORMANCE, platform_profile_handler.ch= oices); > > You are correct. I will submit a new patch shortly. > > > Regards, > > Hans >