From nobody Sun Oct 19 06:04:48 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5C93C4332F for ; Wed, 19 Oct 2022 09:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233869AbiJSJf7 (ORCPT ); Wed, 19 Oct 2022 05:35:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233876AbiJSJ3n (ORCPT ); Wed, 19 Oct 2022 05:29:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80CD2EC52A; Wed, 19 Oct 2022 02:13:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B485617E6; Wed, 19 Oct 2022 09:12:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F7F9C433C1; Wed, 19 Oct 2022 09:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170777; bh=wLs1MRVkbxT3b8aKqZEYPEL1jHZDMLOF9qfa9pKqlWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ozFszcnrS6gLMqjii4plqaqLhhJVR79xdKRMs0SIO9zzObwONOJyjd+W82eQGOHcF GxYdO62yjFNVbS4O+HS6LHr+G38g5mTaKx9Z72Ouj3VD6OH0iSMa1mUX1aFJpACadM VFx1m8kG7pc63kJGpVY6SzeLmDaPlGfxQSE6q978= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jorge Lopez , Hans de Goede , Sasha Levin Subject: [PATCH 6.0 748/862] platform/x86: hp-wmi: Setting thermal profile fails with 0x06 Date: Wed, 19 Oct 2022 10:33:55 +0200 Message-Id: <20221019083322.982623777@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jorge Lopez [ Upstream commit 00b1829294b7c88ecba92c661fbe6fe347b364d2 ] 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 Windows. = 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 Link: https://lore.kernel.org/r/20220912192603.4001-1-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- 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-wmi.c index bc7020e9df9e..fc8dbbd6fc7c 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, }; =20 #define IS_HWBLOCKED(x) ((x & HPWMI_POWER_FW_OR_HW) !=3D HPWMI_POWER_FW_OR= _HW) @@ -1194,6 +1195,9 @@ static int hp_wmi_platform_profile_get(struct platfor= m_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,9 @@ static int hp_wmi_platform_profile_set(struct platfor= m_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; } @@ -1263,6 +1270,8 @@ static int thermal_profile_setup(void) =20 platform_profile_handler.profile_get =3D hp_wmi_platform_profile_get; platform_profile_handler.profile_set =3D hp_wmi_platform_profile_set; + + set_bit(PLATFORM_PROFILE_QUIET, platform_profile_handler.choices); } =20 set_bit(PLATFORM_PROFILE_COOL, platform_profile_handler.choices); --=20 2.35.1