Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3363352rdh; Thu, 28 Sep 2023 09:27:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHktx2F1ZcBgdmH2Kwgml/0SQQOOwDRoIN9aisaEC0JuOtpn9uIPpnv3pJOJNbZ72/HnN8n X-Received: by 2002:a9d:66cf:0:b0:6c0:7bab:3457 with SMTP id t15-20020a9d66cf000000b006c07bab3457mr1809453otm.20.1695918429390; Thu, 28 Sep 2023 09:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695918429; cv=none; d=google.com; s=arc-20160816; b=GtZAVtCpB99Y9ouhH+eCYQ9MDksVcsfNnCdpL/3brKHioJx6DQPi+qu9SgCNRSd1OJ FmU518dyLpRzXTUk0NX82qu9tdWmODjVZQdk2KiolAb11hCjzxij2Gvg/eqkvIUOWIeZ YZF3C0RPh12x0KKFUF78fD3l9HNWQpuvdtyZ+i8bDCXbdUJMHM2ajHPocEk8Rg6FmPbP 47oVqz2biPDzTv05kfIai5Q5LQTIu19Isx97s9AJ7wxfV8eBLyiDQYeGKy/kdEa5x+R8 p0ihXN23SQNT6H8JVYUFH/H7K1M7H7Eb2HIaxturSlq8xScRgJol+66Jj21Mw83hrhMM 1tdQ== 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 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ay42-20020a056a00302a00b0068c7033a5f5si19165455pfb.74.2023.09.28.09.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 09:27:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 1902C808BCA4; Thu, 28 Sep 2023 08:46:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232025AbjI1PqF (ORCPT + 99 others); Thu, 28 Sep 2023 11:46:05 -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 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: gggruggvucftvghtrhhoucdtuddrgedvkedrtddtgdeivdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeegfffhudejlefhtdegffekteduhfethffhieettefhkeevgfdvgfefieekiefgheenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepjedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghnihgvlhdrlhgviigtrghnoheslhhinhgrrhhordhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 08:46:10 -0700 (PDT) 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; }