Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1958903rdb; Tue, 3 Oct 2023 06:27:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpygdHwm7VQ0iskayKEo6hPoiGdHKJv/Wr33kaVu6WlehZ+PzYkHVRXl5kL22uQOS1LnV1 X-Received: by 2002:a05:6a00:852:b0:690:463a:fa9d with SMTP id q18-20020a056a00085200b00690463afa9dmr14806849pfk.22.1696339676004; Tue, 03 Oct 2023 06:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339675; cv=none; d=google.com; s=arc-20160816; b=STvMiB4oqNcCpb/ZEMd7nQ3LYpWYPSDuLj6MpV567so0yCuO5MO4QkCmBkTs4E07ss bCKlXV+uV3tonMVRI90rvns8h8hnC1Fo+cC0ybIsmOG0lMqxhrcSPqEH+zcTr0c3LbHc MRQrzGR+PM0G1OUGxKbgmZ4BLg9fI3ppV6cm2JxZLUTzZo8B0jyGjsVhXLS/qAYp3tQj 1mBZX9raJkhWxQPzeSTPismoa0amnMCuIjoFtzmHlWnOCVy/ImKjObkj0culHKHouM8A 6mwjWm6Csga03pQJYD1xo6yIfnqU/yGog2XFcVUMDTwPrCSS4XZvz0C9TQwmzZ5NLgZG rOhg== 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 :message-id:date:subject:cc:to:from; bh=Bz9DF2MFMY0nxUCOrYqmvw/dCxAuW7+RmK8iSBY+hZ0=; fh=99EXAs+vKBd0HJG3OZyygM2izuzSBDrYNgeLDvqQNA4=; b=PdHXYJo2DqOFQ5Ud81J+2vM9UMcDTaarmURgrYj037Y71kUtoT1MaeOsHue0lIIZFy 924C+dt5CAKa/xE/bbczn9HJ/1WCWJ7lLt932dd+nnueOp6ESsrad7KNKaPIbryn8uOU yntX4Vu1lAWG3+nvIaMiywpA30m7ZmQof805eml125tKwtzrphQc6N7BxhIj/08nv1ME Qj9eIeV+4yAFSUfa/mpyDXVIdscUcKpKjokHaT/iPfBW4M46T5mT7Af0GrNAGotkWpgC 7ZMI2UjIQ/3f4zdV1vKeU/lWDnufUrxlUSFkFpfJObENotSFOtUgKBIcvPYEPTlql5P8 d0XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 202-20020a6302d3000000b00563e25c07c0si1374038pgc.270.2023.10.03.06.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 06:27:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 39E2F80BF4E1; Tue, 3 Oct 2023 06:27:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237311AbjJCN1R (ORCPT + 99 others); Tue, 3 Oct 2023 09:27:17 -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 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 03 Oct 2023 06:27:49 -0700 (PDT) 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!