From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.179 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796288403; b=gfUhX/98tGTnGmaeMOa/5Yjr3AehMzxxLMTRT+YaAqJrvqgrdFsMI0qoLdxYCIyR27Ip 1qrt1lXAnzGbPtAga0sDG9QQ0pwvz9NC9jOfvQ8P9lLAVxF8Iq6KEHvDb1vmb5SqScJwU KgFkifJjmIa41XLf06DT34MRCMlHfbe64CLbNjYuYUqnGcfB6P51FYIzrO5Sffb5y5hhy PNfNa1eko0hrgjOgg5ULUE5cJdKaEuBk9kSu6lamujfeAI9bmyKM4B70TD4aRuy+QdH48 DW51IldeJAFZ1P9owyGkZCFTGDXyZ23xWFDluWwGUh+Uc8V6His4D57S9UrYUgW7dNw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796288403; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=EReCOiYYecSqZ/590+WLX8okimeeffMnJWHkIpiAFkA=; b=M1AdJ/N3QDGyvlehC+kcv3VGxTH4lgautYNYeI3YLdMGNeMe6z16eQCH5QITGTaV9bp5 50eg2yu3wRpuB4CmjMTCaCZWvlYoc5yw+EY7MqcgmZRZiYa1uv+nJYFitF65+PpPTtT1P joipZdlMjqnKKGpQnREGm+IOD7wXjKarz6EJBFyESMziVHs0fGlWT0dfMevULAc+g7Bwb atefBWu2Ocm4UT+aWbxr0lIV0YOMb3zFx1SpnpmdvoRCBZTNZ0iZEt0PrEoxwqS/DKwOe 9IAT2uzP/8oOKmJJdvdPI9Onv46dOw1+vrpYdpFT1CwM5X4NxSWvZkaysCs3SIooiaQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rHajMeM9; arc=none smtp.remote-ip=209.85.214.179 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08839606A32D for ; Thu, 3 Dec 2026 09:00:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 08839606A32D 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.a=rsa-sha256 header.s=20260707 header.b=rHajMeM9 Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2f0464dd6b6so86767875ad.1 for ; Thu, 03 Dec 2026 01:00:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796288402; x=1796893202; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=EReCOiYYecSqZ/590+WLX8okimeeffMnJWHkIpiAFkA=; b=rHajMeM9+1T5cX3hbP70duYzrciiquOMQ5BVtfsMwfBD77BsHpe7SjviinS1LOgHry /wtJN4Kv1/i2Kl+fJbXzbAcyiybSvRo+orC++CLduUadPnaEkc3DTktt6rn61Ekd6bCe 7axru8S7ta9IvXqgoYqpu5uk39mO7Pyb05V3BzF/WB4LYNl6+FJx0ZgUItK/FN/M72Ib lGgqn0ZWQ3t0PvNshcuOfOyEtbK9S8f2xsoeRdRZLKSfiFmSaz0lSfGhB+ximFRNkd8z i+u1YXk8OdGutifnmVVKqN0gE26Y0W13s1RoI2X5UVOkxsgXHqbLXwdLi4ThWO2L5z4+ 9cyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796288402; x=1796893202; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EReCOiYYecSqZ/590+WLX8okimeeffMnJWHkIpiAFkA=; b=v+J1OX7BoMo0lQL3oTbel5DHIaPT7Bl6Q30VFjRncAGI+jyAm9bl2m64aNI4Tuaawo AyWKzBD572fHbOPZpYzQANi/SY6MQtYqbeDttqzfHI17HVY3INUjbqmZTMS0/ldg+mpr vxZ+9c+9SBw0KBFDTY1nIY8WS2Z3+tDtoOIk4oms4XyHF42JJL6uRjk9FHyg81ns4YwW A60XEi1KVvy3BHl4sK5UOA/VG1XFzO7TYgc4q9fXkVT0gMujTFYz4ropZZOl4MRfw9VG 5PcOK6GehL64deCaMs7fSo9Zg/4SrWAGn8tk+EUi3PZaJJR0AxE8r23gb/Ac2zpcRZZY jyWw== X-Forwarded-Encrypted: i=1; AL+hErF1duC3CNPSRspi5JMx2OQex0CAUrAny9QrBO8wmNI0Sr2B0Pc/f/8co8AEi/2IKSOR9YEaQ94BiZsdwqY=@vger.kernel.org X-Gm-Message-State: APuU4Z/1fZHZgkA3uWhdsO33YatujzlZIrz4pgegWfeF995GzIMpE41g 6CTV0/+Wl+1uOXWAYUHHFg3vuQJUFNMaaaTdaT+lOHy/9uPMwOoiI2wy X-Gm-Gg: AZFdTZeCw9q1bpXIit2DAQjM2u21oWhoJhgpmkTECdp7WhTxrm/izhruRGSIdqaKB7k vu3tFxfSbS8FZyi1LDbj1ThiN0YiCTRL0QJN7PiEBFg2kWIhVgUS10Kuge2Qb6wfpU1Rlf2msc2 Um8S0scRsB1lO1LU+YhoEiObKGcPqu/xLoubtnv7vugoI3E1sVQDxHOrWK6Fy7xm6T4nKegi7Hx sJxPOrW4hQycAK3uHUec6q6LiGG4eUEfhGCe7ioRu93iJbmT1YPR0x2SRz8aWko4OmFKJSxAW3i iQkO5Dgb0x/R3HpFJTtJfPX8nFcAWzSrfIJgGqscoAN4eryh3WfbfDiFFY+yPZoOHpvZnwKqCIH fvUko0Ts96LfZ0ccDN4OXMr90n0ZpV36dduJTZHCPC6odgXAac82rotPD0eVk0fda3Aa8gGIiY/ PqQpmua1b4YweK+0ajkI/f+KP6vD/tHBTWjd0BemNiHoS5X+0myJuznpTIpXaGKD1dug3M9R0za Eoz8zr+FVGpZeOQh7aZdX8FgaRXm1p/04rXSG/EA0DtRkgpOc+/99M3sx+doBoQ1Z9eE6QCozys gh8MOSCGgnIi4yjWtEDTIeF8RiSmdjjaVlTRRVBz/Jpb2E047IGeEDJh6K0K X-Received: by 2002:a17:902:d2c6:b0:2ef:f312:b842 with SMTP id d9443c01a7336-2f03f1b426emr449729815ad.46.1796288402124; Thu, 03 Dec 2026 01:00:02 -0800 (PST) Received: from localhost ([112.204.100.142]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2f03f147a9esm213845645ad.72.2026.12.03.00.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 01:00:01 -0800 (PST) From: Alex Yeo To: platform-driver-x86@vger.kernel.org Cc: alexyeo362@gmail.com, zepwu@foxmail.com, Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Kenneth Chan , linux-kernel@vger.kernel.org Subject: [PATCH v5 0/2] platform/x86: panasonic-laptop: add platform_profile support Date: Thu, 3 Dec 2026 16:58:53 +0800 Message-ID: <20261203085856.1005881-1-alexyeo362@gmail.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add platform_profile support for Panasonic Let's Note laptops. Patch 1 maps the firmware fan mode and TDP limit onto platform_profile for the models tested here. Patch 2, from Wu, adds the CF-SV1-2 quirk. Tested on CF-RZ6 (2016), CF-SV8 (2019), CF-QV9 (2020) and CF-SR4 (2024). CF-SV1-2 was tested by Wu. This patch series adds support for mapping firmware thermal and CPU power operating policy to platform_profile for Panasonic Let's Note laptops. This originally started as a hwmon and thermal patch, but further analysis had revealed that these are firmware power and thermal policies as opposed to fan control. Panasonic firmware exposes firmware operating policy through two methods: - Fan cooling policy (active/passive) - Processor TDP limit (capped/uncapped) At boot, firmware defaults to an active cooling policy with the CPU TDP capped. Vendor drivers / DPTF normally unlocks this on Windows. These 2 methods map to 4 possible distinct states. Only states that correspond to the platform_profile ABI are mapped and exposed as choices. Unmapped states will be returned as "custom" by the driver. State to platform_profile mapping: Profile | Fan Mode | TDP +--------------------------------+-----------+------------+ PLATFORM_PROFILE_COOL (SR4/SV1) | Active | Locked PLATFORM_PROFILE_BALANCED | Active | Locked PLATFORM_PROFILE_QUIET | Passive | Locked PLATFORM_PROFILE_PERFORMANCE | Active | Unlocked CUSTOM (unmapped on all) | Passive | Unlocked Across all of them, the fan and TDP modes are toggled by the same ACPI methods. However, there is a slight variation in its interpretation based on testing results. These methods are normally called by the DPTF/IPF _OSC handshake. Depending on the capability bits, the firmware will alter its thermal and power policy. \_SB.IETM Implementation A: - CF-RZ6 (2016) - CF-SV8 (2019) \_SB.IETM Implementation B: - CF-QV9 (2020) - CF-SR4 (2024) Models belonging to the same group share what appears to be identical AML code for the _OSC. This patch only exposes the ability to read and set these firmware toggles. The get() callback queries current firmware state and returns the mapped platform_profile. The set() callback sets the target state regardless of current state. Mappings in this patch are defined in the quirks struct. Activation of platform_profile is gated by DMI checks. By default, only balanced and performance profiles are defined. This is because the aggressive fan paired with the locked TDP on the SV1 and SR4 more appropriately correspond to the cool profile. Test results for the mappings are below. Test results: ================ (CPU PkgWatt: peak / sustained) (Sysbench CPU: all available threads) CF-RZ6: (i5-7Y57, Startup default: Balanced) Platform Profile | CPU PkgWatt | Sysbench CPU | Stress Temp (CPU) +-----------------+-----------------+----------------+-------------------+ BALANCED | 10.0W / 9.0W | 19712 | 57C PERFORMANCE | 18.9W / 14.9W | 29132 | 72C CF-SV8: (i5-8365U, Startup default: Balanced) Platform Profile | CPU PkgWatt | Sysbench CPU | Stress Temp (CPU) +-----------------+------------------+----------------+-------------------+ BALANCED | 9.9W / 9.9W | 44695 | 58C PERFORMANCE | 29.0W / 19.9W | 71747 | 81C CF-QV9: (i5-10310U, Startup default: Balanced) Platform Profile | CPU PkgWatt | Sysbench CPU | Stress Temp (CPU) +-----------------+------------------+----------------+-------------------+ BALANCED | 10.0W / 9.9W | 46545 | 59C PERFORMANCE | 18.9W / 14.9W | 57416 | 70C CF-SR4: (i5-1345U, Startup default: Cool) Platform Profile | CPU PkgWatt | Sysbench CPU | Stress Temp (CPU) +-----------------+------------------+----------------+-------------------+ COOL | 12.0W / 12.0W | 177139 | 66C QUIET | 12.0W / 12.0W | 176315 | 73C-75C PERFORMANCE | 29.6W / 21.3W | 247602 | 98C-100C CF-SR4 Notes: - QUIET: downclock/throttle at 75C, no increase in package_throttle_count - PERFORMANCE: stable boost clock, package_throttle_count increase Other notes: =============== Additional notes about thermald: During testing, I have observed that running thermald for the first time since boot will trigger an _OSC negotiation that will unlock CPU TDP for new models (IETM Implementation B). Once thermald is running, exits or runs again, these bits were not observed to change again during testing. Running thermald on older models (IETM Implementation A) does not touch the fan curve or TDP mode setting. Suspend: observed to not alter the values set prior to suspend The SV1 (CF-SV1-2) was tested by Wu. More details and data: https://github.com/numuly/cf-sv1-2-platform-profile-evidence Alex Yeo (1): platform/x86: panasonic-laptop: add platform_profile support Wu Zhipeng (1): platform/x86: panasonic-laptop: add CF-SV1-2 platform_profile entry --- v5: - rewritten as a series - commit message reformatted - rebased onto platform-drivers-x86/for-next - dropped RFC - CF-SV1-2 added as a separate patch v4: https://lore.kernel.org/platform-driver-x86/20261025191300.1259541-1-alexyeo362@gmail.com/ - Consolidated separate quirk structs for the RZ6, QV9 and SV8 into a quirk_default struct. v3: https://lore.kernel.org/platform-driver-x86/20261007190446.38862-1-alexyeo362@gmail.com/ - Removed sysfs.h import - Refactored platform profile probe function to use a different pattern (check warn_on, continue on double unset, then set) v2: https://lore.kernel.org/platform-driver-x86/20261006085021.853827-1-alexyeo362@gmail.com/ - Refactored code to use its own platform_driver - Removed DEFINE_FREE and its corresponding __free as its addition in this module is inappropriate - Removed pr_fmt line as its addition to this patch is inappropriate - Added DMI check during __init to prevent attempt of platform profile device loading on unsupported hardware - Fixed use of enums as truth values by adding explicit comparisons - Added *profile_pdev to keep track of new platform_driver - Removed extra spaces in the quirk definitions - Added helper function for calling EC methods for simplicity - Use ARRAY_SIZE() for for loops and added include for array_size.h - Refactored pcc_profile to be a pointer in platform profile set function - Use WARN_ON() when a malformed quirk is detected in the platform profile probe function - Avoid use of status as variable name if not acpi_status - Added Kconfig line for ACPI_PLATFORM_PROFILE - Removed bool .use_platform_profiles from the quirks struct as it is no longer needed as a result of the platform_driver being separate. - Moved DMI quirk matching in probe function before devm_kzalloc of driver struct v1: https://lore.kernel.org/platform-driver-x86/20260805180544.1134916-1-alexyeo362@gmail.com/ drivers/platform/x86/Kconfig | 1 + drivers/platform/x86/panasonic-laptop.c | 381 +++++++++++++++++++++++- 2 files changed, 381 insertions(+), 1 deletion(-) -- 2.56.1