Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp300322lqj; Wed, 10 Apr 2024 10:45:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQsd+vqBT3BYMPiOcDd5CLDdnubGjryRmPlKRmLm0L9vhAXkMwU8itp5cUzW1rOQhwDIZXMXt2xtAszqvP3yXZ+uapY/3CZtN3ChBTpA== X-Google-Smtp-Source: AGHT+IGchHBRmWfnxlx6pTYNW2Q6f/Zcl2a/k6lNziS1iq4jFSGNAnSxJk9KjZhLLd+Bipx1oDut X-Received: by 2002:a17:906:c142:b0:a4e:2419:d51c with SMTP id dp2-20020a170906c14200b00a4e2419d51cmr3019491ejc.51.1712771125564; Wed, 10 Apr 2024 10:45:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712771125; cv=pass; d=google.com; s=arc-20160816; b=AN25DVyP+9SszUBQBJ7Oytkb1CRBiwqpqrtbJyKNfwCPXLoDrbussKSq+/qHdWi4Lz dyEVHK2THtmBvAf9sMyWa571GCzxCbyEqhZWvc+rDR0RGpdgn56NQYSqUWLjzKd9T3zd qmADxkKQo5BWKyby4OaLjzbjeuzmrQgm0L2GixoGs1DJE+GrfrQZy3UqrwOjV8ACaqdq LdHBhVOjEbwssY0r1KeQhzHVJKbFI7ZwRwtwU0MC4w1EaE24i79XHgihIj8VdCc5N65j 2LSBPjAtFjZNcPeJwis3MBP8sZ3/r8WsmLUgHufj2jUeo4WQ8aO00yuQGu573At7NYAZ 33DQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3lFRYFsqmjtA4ZrO5pwATdwLffWIok+YnSS+HkQPo0w=; fh=0I/rqIlL4373pOps8oaBYF1ECx5xbCzL9wLU5PgpMhU=; b=oIjl4whfUjd6Lh/fVMop14EzE/rZKpNDo1oB3og2TqMV/LnsxQUE0we96Bad2+q53Y ixMPo69VOlwfllT+o5TsHgte6WfC6gapUfqJZ0b9hAfdF2hZTg28FixH8uCpWxq2H8rI x5m+h8NvHwMpFb1qaIZ1/FbjZm415eOh1MFLiL3ewXrQHMJ4/nJZyzIMvFlzl+HjZ2+B fYyt0cKPrCdCfzi4LH1xKd0vOp90LhW5ozq99J6sqAJ+dwW4HWrwzpJOy4lXTfobg9+8 7t+2Fr1lpHq4mDJEciQE5zxDoW2L42gQOMOduAdFRazXwt63J60a2EFsIt8PuppY3qww sn4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=oxbOfCp3; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-139119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139119-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id oz18-20020a1709077d9200b00a5214ba906dsi534681ejc.553.2024.04.10.10.45.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 10:45:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=oxbOfCp3; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-139119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139119-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2346C1F242BE for ; Wed, 10 Apr 2024 17:45:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE2321802C6; Wed, 10 Apr 2024 17:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b="oxbOfCp3" Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32E9317F369; Wed, 10 Apr 2024 17:44:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771098; cv=none; b=LMGNZRPL1HkWjyS3bzqLgompBt/WIJH6vIysgtIf2PvE5xZZVDdM8ULLev6jXWTdMbG+RMW1RKl/OLfzdg2nMIppkna8+k2f+3T/+xF7yfku1jPknkI7Nlmm/xWxyQDB12RFQcKx4cn0baMigKg49cvUyZqgvGpSB3S0y0H8vEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771098; c=relaxed/simple; bh=J3FVnwDh/KGiA6tpfeXzIKlz2LWvlujkzxc+I0KPgFU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XxhlSZ+zWzhZbeqR99972jFZTxzK7w520UfGZXCpZ4Yly6JPtNt8PnpXSVYaeuyKPkJ9NijexG5TWOR8j+j2DDcloHZTtrDFbCZV8+nWXMfFUb0etrdi0cpT32t3KSFeZfY1qykKB+M7V1p7VCUs9FuqW6yYdPCyjYTyfQxQHes= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; dkim=fail (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b=oxbOfCp3 reason="signature verification failed"; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net 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 6.0.0) id 65631d58b4123eed; Wed, 10 Apr 2024 19:44:47 +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 cloudserver094114.home.pl (Postfix) with ESMTPSA id 59FAD66C66F; Wed, 10 Apr 2024 19:44:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1712771087; bh=J3FVnwDh/KGiA6tpfeXzIKlz2LWvlujkzxc+I0KPgFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oxbOfCp34dSikTSvRh20E+pQNQ5B0RJPEGlIv4//yecq30J08PCq7hJIfAZeWIzwm MbHIkinVq86zESqyD049uRYJ5CXO+Z953AhLmbEPVJWzaeRU6+yMoKwdvpMT6GZ0Tp bnDfOlfer4EWovhKfzbQOvjwaY8E8mHSnF1n4Vj+70jlQgSq6DDVEYnIOnjKgyeK5S uB/6xVcuPbxZdWoMWSkogMvL5gDsaGxFOW9IrwOG2qSKRCP50L5Wv/FLiR7gjx62v1 WB1qGUZXOVOj1HlD9vgxQK8LLL7QhVOF5IpI+UwJrle1CRCugEWcPc5dBkyWZIpDV9 PUip6MCY/oHTw== From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Daniel Lezcano , Lukasz Luba , Srinivas Pandruvada Subject: [PATCH v1 16/16] thermal: core: Relocate critical and hot trip handling Date: Wed, 10 Apr 2024 19:44:34 +0200 Message-ID: <9337957.rMLUfLXkoz@kreacher> In-Reply-To: <13515747.uLZWGnKmhe@kreacher> References: <13515747.uLZWGnKmhe@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: gggruggvucftvghtrhhoucdtuddrgedvledrudehiedguddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehluhhkrghsiidrlhhusggrsegrrhhmrdgtohhmpdhrtghpthhtohepshhr ihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 From: Rafael J. Wysocki Subject: [PATCH v1] Modify handle_thermal_trip() to call handle_critical_trips() only after finding that the trip temperature has been crossed on the way up and remove the redundant temperature check from the latter. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/thermal/thermal_core.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) Index: linux-pm/drivers/thermal/thermal_core.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_core.c +++ linux-pm/drivers/thermal/thermal_core.c @@ -350,10 +350,6 @@ void thermal_zone_device_critical_reboot static void handle_critical_trips(struct thermal_zone_device *tz, const struct thermal_trip *trip) { - /* If we have not crossed the trip_temp, we do not care. */ - if (trip->temperature <= 0 || tz->temperature < trip->temperature) - return; - trace_thermal_zone_trip(tz, thermal_zone_trip_id(tz, trip), trip->type); if (trip->type == THERMAL_TRIP_CRITICAL) @@ -405,10 +401,11 @@ static void handle_thermal_trip(struct t list_add_tail(&td->notify_list_node, way_up_list); td->notify_temp = trip->temperature; td->threshold -= trip->hysteresis; - } - if (trip->type == THERMAL_TRIP_CRITICAL || trip->type == THERMAL_TRIP_HOT) - handle_critical_trips(tz, trip); + if (trip->type == THERMAL_TRIP_CRITICAL || + trip->type == THERMAL_TRIP_HOT) + handle_critical_trips(tz, trip); + } } static void update_temperature(struct thermal_zone_device *tz)