From nobody Mon Dec 1 23:05:39 2025 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6BF133507E for ; Thu, 27 Nov 2025 15:16:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764256576; cv=none; b=IZXs37i0fhWRCK4zXUD+PXfmH8QgaCVUBjT7Uyhc4+8/jL9sm0IRDnx5jeA32vf4okAeMDnWi2sGbFX5rpr137zMpEAawEWmWXglZKmU/Yy5QqY0zk724sr0poUBPK9zQNmFN6WNNoAMvwrkFyBD9JtEmMjj5Ozr7/6klhmdDf0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764256576; c=relaxed/simple; bh=AWNkJhYiQSm4mam341FTvs4ijlPyZ/HkhkFPW01BwM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y7l0oxiHXn3Xq19YG34JzbSLN71wTvXXOfRXsyzbMQ3vWQ5Epxd/oh54Zp1ED533fVfNZhj6sRWfw25aSm/0n1rT/MqFKlM29qxfxGRZYRLwF36GMes1lAZcee55KnN6937jwsQDbJfi7dSIx3r7NPsgLQDZESeBHMPTCU1tO0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FVycLHNY; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FVycLHNY" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2958db8ae4fso9887515ad.2 for ; Thu, 27 Nov 2025 07:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764256573; x=1764861373; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FcvRrylsz8y/5M5RPfO3ICptGfI1sgN5Cn3FTmzcBZk=; b=FVycLHNY8xRLuaaqDGGv2Zi6HW4Sbk2XMb2nyCU+fm3HVx/BU3jtVS1KLz9TfScYPQ sypqfTAhS/chWJ5wOnypgCO1e7inaDPeuJAT7RM4s/UyL8pmlwNwOI91RxPJ8inoT1JT c+ash+G1ygFct5VJFbeI8BxQ43oXFc1qj7O4FQ9251vledxaVMmdGJKVKwTeFuYx7yWz Wnf4wCBgwnckcapMPU9KrB+3lN49FGHa+plG+kuHe0CXGOWWAhEMMxI9y/I0gcySYHhc Wwpl9ZHUctweesnOjP31F6ml9VbDiIgM+wlL4JW+dV41ZblrWSu5FMitKKgRtXwFD3+l n/uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764256573; x=1764861373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FcvRrylsz8y/5M5RPfO3ICptGfI1sgN5Cn3FTmzcBZk=; b=cmXi2B11l0tppR1lB4wkFPrEbGktsOjRoJybbq9jxxuGTIROER2qu7xdFdqV1nvHr+ KJnOkA9i8IT86Lo4cRXSpPmiPIByrgiyMjNSJUhiIArBbcj2HmZ5jEvi34Ho4unsSsZo k4qpAF3d4maMu02GpUfK1wDqy8+4GbQfYPPXQ12RCBMmNaskf+D+MkfzkS2v4J1gGte2 TVNjdzK+3b/QjeNw89HmKO4m8NEPgd0fzTs1Ktum8E3O+8Ql6VNaCqAMAT0+kwMvTZD2 mhnX/QxyjDIIwwq4n/7owYtiwbFRXXfMbvZfcbN8JcXfck1T0Seqy4JUsCqb5mt27xUy Pe7w== X-Forwarded-Encrypted: i=1; AJvYcCXFZX99VPwYZ/VnNW21F+CqhEzwQYrPaNYPisz4CaKW7LoHNiXdYodp9iBbX/uZI218Expv7TX6JYVrxBU=@vger.kernel.org X-Gm-Message-State: AOJu0YySCHadMWNwbEpk58lvo9Zqz9sBKg5hu1mbc7ntZqGSJ9FAwjEv TK3HrH04oC5gdzVzaPqHkCx9JRuU+G7sTjEGYuQ23vulwjrOvhx9jOIg X-Gm-Gg: ASbGncvwwSB9/hxdWf+fWgc8Sigjp+olQBeIb76lAUB/2aF/ydvPsL4IdVGa7AwPu/m /Z0fFgFOZMXBOKsi5hjjy56s8diApEIYGmeXBLodrVzkWZTZzqpvs+0p3L7DoaCMPQULNS0nV5g SWuRLqnuaD1efbE22JfFW/vv0efZ7AER3rjHDH5UlrQxgHQzyfthaV8f+YRmf/TOOr4JGO0HR3c OCVCeUstbeRvAGFMsnpmkS0bRTC42tBYLMDWGzzEuTvg4i0PW8VkvfToWF6F1/WjhiU8uxMexEe CHUBgQ4pMggPpPoC4eFmOrbBTAqwLOUWyMZwsr8QanNOunqjqxhPQbZwwBm09H08L/xc5Ti1cOz qkV5SdqcsZkOAwC8Z0EDl7jJHkP3ZMUfrBXlborhDGQQ1+rNEeoMO77bEKH9JosWaiZGJFk1T+7 01pqvpyLHmRze5/mciJVpJGeXEL180f8XKPSsRWppu0KwSMlDo4g11k/BB3TcZe4/c3FzudbkZO hWVMg== X-Google-Smtp-Source: AGHT+IFbJD3W3TjYyXHCl+ByEYJBSKUdDrYv+tvqK3Wa3b2N0x9VAT+uS1rulv/XgzRItzjJ76/F1g== X-Received: by 2002:a05:7022:438e:b0:11a:51a8:eca with SMTP id a92af1059eb24-11c9d812055mr17767856c88.18.1764256572310; Thu, 27 Nov 2025 07:16:12 -0800 (PST) Received: from bliptop (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11dcb067088sm5099656c88.10.2025.11.27.07.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Nov 2025 07:16:12 -0800 (PST) From: "Derek J. Clark" To: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Armin Wolf , Len Brown , "Rafael J . Wysocki" , Jonathan Corbet Cc: Mario Limonciello , Zhixin Zhang , Mia Shao , Mark Pearson , "Pierre-Loup A . Griffais" , Kurt Borja , "Derek J . Clark" , platform-driver-x86@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH v4 1/3] acpi: platform_profile - Add max-power profile option Date: Thu, 27 Nov 2025 07:16:03 -0800 Message-ID: <20251127151605.1018026-2-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251127151605.1018026-1-derekjohn.clark@gmail.com> References: <20251127151605.1018026-1-derekjohn.clark@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some devices, namely Lenovo Legion devices, have an "extreme" mode where power draw is at the maximum limit of the cooling hardware. Add a new "max-power" platform profile to properly reflect this operating mode. Reviewed-by: Mario Limonciello (AMD) Acked-by: Rafael J. Wysocki (Intel) Signed-off-by: Derek J. Clark Reviewed-by: Armin Wolf --- Documentation/ABI/testing/sysfs-class-platform-profile | 2 ++ drivers/acpi/platform_profile.c | 7 +++++-- include/linux/platform_profile.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-platform-profile b/Docum= entation/ABI/testing/sysfs-class-platform-profile index dc72adfb830a..fcab26894ec3 100644 --- a/Documentation/ABI/testing/sysfs-class-platform-profile +++ b/Documentation/ABI/testing/sysfs-class-platform-profile @@ -23,6 +23,8 @@ Description: This file contains a space-separated list of= profiles supported power consumption with a slight bias towards performance performance High performance operation + max-power Higher performance operation that may exceed + internal battery draw limits when on AC power custom Driver defined custom profile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profil= e.c index b43f4459a4f6..ea04a8c69215 100644 --- a/drivers/acpi/platform_profile.c +++ b/drivers/acpi/platform_profile.c @@ -37,6 +37,7 @@ static const char * const profile_names[] =3D { [PLATFORM_PROFILE_BALANCED] =3D "balanced", [PLATFORM_PROFILE_BALANCED_PERFORMANCE] =3D "balanced-performance", [PLATFORM_PROFILE_PERFORMANCE] =3D "performance", + [PLATFORM_PROFILE_MAX_POWER] =3D "max-power", [PLATFORM_PROFILE_CUSTOM] =3D "custom", }; static_assert(ARRAY_SIZE(profile_names) =3D=3D PLATFORM_PROFILE_LAST); @@ -506,7 +507,8 @@ int platform_profile_cycle(void) if (err) return err; =20 - if (profile =3D=3D PLATFORM_PROFILE_CUSTOM || + if (profile =3D=3D PLATFORM_PROFILE_MAX_POWER || + profile =3D=3D PLATFORM_PROFILE_CUSTOM || profile =3D=3D PLATFORM_PROFILE_LAST) return -EINVAL; =20 @@ -515,7 +517,8 @@ int platform_profile_cycle(void) if (err) return err; =20 - /* never iterate into a custom if all drivers supported it */ + /* never iterate into a custom or max power if all drivers supported it = */ + clear_bit(PLATFORM_PROFILE_MAX_POWER, data.aggregate); clear_bit(PLATFORM_PROFILE_CUSTOM, data.aggregate); =20 next =3D find_next_bit_wrap(data.aggregate, diff --git a/include/linux/platform_profile.h b/include/linux/platform_prof= ile.h index a299225ab92e..855b28340e95 100644 --- a/include/linux/platform_profile.h +++ b/include/linux/platform_profile.h @@ -24,6 +24,7 @@ enum platform_profile_option { PLATFORM_PROFILE_BALANCED, PLATFORM_PROFILE_BALANCED_PERFORMANCE, PLATFORM_PROFILE_PERFORMANCE, + PLATFORM_PROFILE_MAX_POWER, PLATFORM_PROFILE_CUSTOM, PLATFORM_PROFILE_LAST, /*must always be last */ }; --=20 2.51.2