From patchwork Thu Sep 28 15:45:59 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: 146193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3421322vqu; Thu, 28 Sep 2023 09:05:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBGrScitcw8xQD3nBbh31TiRotsDv3Dt646hThMZU9yKg6dgWqBx74VNETiFS13S8bDbYr X-Received: by 2002:a17:90a:4a82:b0:268:5c3b:6f37 with SMTP id f2-20020a17090a4a8200b002685c3b6f37mr1675319pjh.0.1695917156672; Thu, 28 Sep 2023 09:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695917156; cv=none; d=google.com; s=arc-20160816; b=Hm9RKDcDWLt/FIjGkiSLwXiWWQ5VmqjjSmpIZS8YPgLGILBK9+2Ll4ahTdUhxvLxZa BziSrI+GGeJ+Myac8q23vc4lIfdbgGearyIdfAi46YqauC2Hk1SHlQEyX7/4bnQCBYFB pkwavfqw0nVccmKl/NjFcWC+e4r8dIPW4p8flZ+tvNrS3mwvI11bFGrIDucBf8yjAGSC qzXTWwsWlEpcOt/6ng2hFoJ/E1N0ABo3Fmilbq8ahivbqDVsMTyfz/oMEwChZeqmCnRo fA+SX6OYPTzyb9OJWX6816Vnc8NL1ZWiRAYAqECecstzTVsavxpDu9ze+wfNxI8h06GI Q3hg== 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=boKlSaSnVjguuXKmeMbDHWfKHHdsIgKiPx/LX6DazdI=; fh=O23KyOIh4SH8h6spjMbks53sBadQYO9XnI7E0pX/mPI=; b=M/Nt0g+d2+DCPltEd0JFEil8DRDEfZdBcNYe0GuaZiO+T15q/HrbfUsHibXnnGWV82 ZEXjdYaG8/5zwosvB1vKVhOZrwvIfOFjQ1/Duw41YE5PsqkLHT+EJs6QaiNjsERNm7GX tXiNv9iKzbbH+mYQdCy7YJTNPCuwfGE4cL5scVBKu3KVKCVjaN5Z1pY8e3BT62C1v1D4 IJFkJ2qZjTI8rRy7/Nb6V/ex/TV8nNal2q3vJNC0xeLxJViqsUf84ZUf8NuxonwkFLOv C5zThPNQsOSqNqHoFAj72fHH/HO6FKXyVqv3XzgakQpRyWoKcMjdEYM/sqVSHki26MJA DMSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id a1-20020a17090abe0100b002791b907f0csi1138381pjs.121.2023.09.28.09.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 09:05:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id F09D781C46E8; Thu, 28 Sep 2023 08:46:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232032AbjI1PqG (ORCPT + 21 others); Thu, 28 Sep 2023 11:46:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbjI1PqE (ORCPT ); Thu, 28 Sep 2023 11:46:04 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27B77AC; Thu, 28 Sep 2023 08:46:02 -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 80c322cf61eba005; Thu, 28 Sep 2023 17:46:00 +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 1EEE56655D6; Thu, 28 Sep 2023 17:46:00 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Daniel Lezcano , LKML , Linux PM , Srinivas Pandruvada , "Rafael J. Wysocki" , Zhang Rui Subject: [PATCH v1] ACPI: thermal: Mark uninitialized active trips as invalid Date: Thu, 28 Sep 2023 17:45:59 +0200 Message-ID: <5738410.DvuYhMxLoT@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: gggruggvucftvghtrhhoucdtuddrgedvkedrtddtgdeivdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeegfffhudejlefhtdegffekteduhfethffhieettefhkeevgfdvgfefieekiefgheenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepjedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghnihgvlhdrlhgviigtrghnoheslhhinhgrrhhordhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhg 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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 08:46:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778298028186518832 X-GMAIL-MSGID: 1778298028186518832 From: Rafael J. Wysocki After removing the valid flag from struct acpi_thermal_trip, the trip temperature value is used in validity checks, so it must be THERMAL_TEMP_INVALID for the active trip entries in struct acpi_thermal_trips that are not going to be used (because the corresponding objects are not present in the ACPI tables, for example). Accordingly, modify acpi_thermal_get_trip_points() to set the temperature value to THERMAL_TEMP_INVALID for trip point entries skipped by it after acpi_thermal_init_trip() has returned 'false' for an active trip. Fixes: 058f5e407deb ("ACPI: thermal: Drop valid flag from struct acpi_thermal_trip") Signed-off-by: Rafael J. Wysocki --- Commit 058f5e407deb mentioned above is present in the linux-next branch of linux-pm.git and acpi_thermal_init_trip() is introduced by https://patchwork.kernel.org/project/linux-pm/patch/1785516.VLH7GnMWUR@kreacher/ --- drivers/acpi/thermal.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-pm/drivers/acpi/thermal.c =================================================================== --- linux-pm.orig/drivers/acpi/thermal.c +++ linux-pm/drivers/acpi/thermal.c @@ -480,6 +480,9 @@ static int acpi_thermal_get_trip_points( } + while (++i < ACPI_THERMAL_MAX_ACTIVE) + tz->trips.active[i].trip.temperature = THERMAL_TEMP_INVALID; + return count; }