Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp804178rwi; Wed, 19 Oct 2022 03:13:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GNaqX6115erlAD281jAT2dwNjPH1ps43rn6L6Q5U31zyLUMw9db0Put7FYv1gIJKrBN0C X-Received: by 2002:a17:907:8a23:b0:78d:b042:eece with SMTP id sc35-20020a1709078a2300b0078db042eecemr5863780ejc.494.1666174420863; Wed, 19 Oct 2022 03:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174420; cv=none; d=google.com; s=arc-20160816; b=EGAdqQUmvkgiURFVGH9S/GPkqXr4vyi6CZY2NlN3DsiKV7w+uIaZ6LTCvE2Tq4tsd7 Uqy5g3mMAkRWAKaPzCR0QcSMpYQpReCjQt5WsaMCgIfN0/5PJW0ThTIKhswlBsM0sSVP UnJBe2FIKkM2i2JVOkQU1wNAr3K7qNFgdBoZ4Qjf6+G5tKTr/qRa32oFIzFmukETtEKC OR3VVGVXH/05QuLRa2Owyg3K+vnGPU5pMv3/y6Kqsukxq01GDik6BS9O6eSEjLojR0vM B+1BaTzzpxCqm8/MNHHMm0XbZmjdn2JOlP8QT4wRi+Ob4sy4SttVLMojVEHPQyq7yM0p CX5g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U3i6e5mz9lTrz0/598WA8qjJGMH8CDQktUCuLIpeUqw=; b=j0lk44pRkSw2hxEC5wSvRxllN5bxdBjL/EdIUeDHALcW6vG8iupIpMop4iYYKi0Qwl FeFQwrDg6toJHpSiy72NZPy5gKWvUkw0WSCWWqsneQsmvy3hgIA+adhd9OnbZOfJUZF4 SGKtMGsmne+LHTXqIx6ne4yZfP99q3mPKtkrS3VKrfCCH6Aik3b7lPmvb3AboTMu1yA2 4PCsD1UKIFMSbt2cQO3RFh6smoF9ZK2WTqNIA3Fi6Fjvx9atQg5oWP6n8O9MRgPKFLOH +I9g8kiwT3c1ic1WlZBKUaDcaEEOYMxnGXTU6zRHlSqhyAU4YLLrnDxXKkkI+JVDnzUI eQxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ozFszcnr; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a170906441400b0078a00ad1e31si13101291ejo.687.2022.10.19.03.13.15; Wed, 19 Oct 2022 03:13:40 -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=@linuxfoundation.org header.s=korg header.b=ozFszcnr; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232486AbiJSJf5 (ORCPT + 99 others); Wed, 19 Oct 2022 05:35:57 -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: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 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 ‘quiet mode’ 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 = 0x00, HP_THERMAL_PROFILE_DEFAULT = 0x01, - HP_THERMAL_PROFILE_COOL = 0x02 + HP_THERMAL_PROFILE_COOL = 0x02, + HP_THERMAL_PROFILE_QUIET = 0x03, }; #define IS_HWBLOCKED(x) ((x & HPWMI_POWER_FW_OR_HW) != HPWMI_POWER_FW_OR_HW) @@ -1194,6 +1195,9 @@ static int hp_wmi_platform_profile_get(struct platform_profile_handler *pprof, case HP_THERMAL_PROFILE_COOL: *profile = PLATFORM_PROFILE_COOL; break; + case HP_THERMAL_PROFILE_QUIET: + *profile = PLATFORM_PROFILE_QUIET; + break; default: return -EINVAL; } @@ -1216,6 +1220,9 @@ static int hp_wmi_platform_profile_set(struct platform_profile_handler *pprof, case PLATFORM_PROFILE_COOL: tp = HP_THERMAL_PROFILE_COOL; break; + case PLATFORM_PROFILE_QUIET: + tp = HP_THERMAL_PROFILE_QUIET; + break; default: return -EOPNOTSUPP; } @@ -1263,6 +1270,8 @@ static int thermal_profile_setup(void) platform_profile_handler.profile_get = hp_wmi_platform_profile_get; platform_profile_handler.profile_set = hp_wmi_platform_profile_set; + + set_bit(PLATFORM_PROFILE_QUIET, platform_profile_handler.choices); } set_bit(PLATFORM_PROFILE_COOL, platform_profile_handler.choices); -- 2.35.1