From patchwork Tue Oct 3 13:15:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 729173 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 E239BE7AD49 for ; Tue, 3 Oct 2023 13:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235914AbjJCN05 (ORCPT ); Tue, 3 Oct 2023 09:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235666AbjJCN04 (ORCPT ); Tue, 3 Oct 2023 09:26:56 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6561CCC; Tue, 3 Oct 2023 06:26:52 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 0c737ab238faee0f; Tue, 3 Oct 2023 15:26:50 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 532036659AF; Tue, 3 Oct 2023 15:26:50 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Linux ACPI , Daniel Lezcano , Zhang Rui , Srinivas Pandruvada , "Rafael J. Wysocki" Subject: [PATCH v2 0/6] thermal: Improve iteration over trip points Date: Tue, 03 Oct 2023 15:15:51 +0200 Message-ID: <4846448.GXAFRqVoOG@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrfeeigdeifecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeegfffhudejlefhtdegffekteduhfethffhieettefhkeevgfdvgfefieekiefgheenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepjedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghnihgvlhdrlhgviigtrghn oheslhhinhgrrhhordhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi All, This is a new version of https://lore.kernel.org/linux-acpi/4871671.31r3eYUQgx@kreacher which is being posted, because I've realized that the ACPI piece could be somewhat simpler. Namely, it is not really necessary to store the indices of active trip points in the ACPI thermal driver (so as to use them to invoke the appropriate ACPI methods), because they can be readily computed, but IMO it is better to make changes in more steps in order to use this observation. This is still true: It turns out that the notification-handling code in the ACPI thermal driver can be rearranged to iterate over trip points once, with the help of for_each_thermal_trip() called directly under the zone lock, so patch [1/6] adds a helper function for that. This time, however, more changes are made in order to use this new function in the ACPI thermal driver: * One function is relocated (so that the subsequent changes look cleaner) in patch [2/6]. * Two functions are merged into one (so as to prepare the code for the next change) in patch [3/4] * Patch [4/6] changes the ACPI thermal driver to use the function introduced in patch [1/6] and to reduce the number of trip point walks after a notification from the platform firmware from 2 to 1. Next, patch [5/6] drops thermal_zone_device_exec() that is not used any more and patch [6/6] changes the int340x thermal driver to also use the new helper to iterate over trip points, so it need not make risky assumptions regarding the core functionality. Please see the individual patch changelogs for details. Thanks! Reviewed-by: Daniel Lezcano Acked-by: Daniel Lezcano