From patchwork Tue May 28 14:57:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 800844 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 9D2C4170848; Tue, 28 May 2024 15:01:11 +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=1716908473; cv=none; b=EIc8UA6HM0UX9Lze3qHu5lhBOtEsObYviH5rDZvpvpdiQIUA8zDcr8FlW9lmSBDrqvrijrgHzfO3IjT5oOQ2BHh0V5jq7dpvg7ygn/NF3S9FXZaDg4bEJGxiNuWU19dqqRkkXJVGWqfjF4jARmX0SJh5bdqjLtBrib5yCR34aT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716908473; c=relaxed/simple; bh=7tfm79MQP2qGW3LgqSBxE0uv7WR1NeIzcGDtBjqkyOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NzjUXx+2DbpRPz1fuO3EYhm5SV6s1Lu8oYhrExnYgLe3FPlZZJ8rsvyIzRn54MjdANYQfkX2OLafWHs6LERAZCdQhyJIXJ64xHEfvRtx+z/As5mX4zxYfK5jfNOzaRs3yh8KYvsBpFFBt1EDjQYPpmyp2DnKbk+3G+o72rRY95M= 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=CrZWDXBH 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 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="CrZWDXBH" 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.1.0) id 8604d37985fdf45e; Tue, 28 May 2024 17:01:03 +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 5FEC96A5015; Tue, 28 May 2024 17:01:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1716908463; bh=7tfm79MQP2qGW3LgqSBxE0uv7WR1NeIzcGDtBjqkyOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CrZWDXBHBDbcm+99w/Qrn/dchEVeeQWOfYdH9nUQkxfdBesZyF4lyaL7EfKdmraM5 dLpYDl6S9q3SFbBEEzgTWrCXXEk3XtVcwsw+VacwjS22scWZmGedAvtxOxRap5zYwm 4s0DbJl2CnLvM41aGn0TsNd78iud9iDsUlyeugB6EXSJyz4yD404Cj00d9vgh/Ijnw P+UGshQ8x1V1leqD1DHtlRjai+4CYXdr6pXAD2DHVwAB/f0z9W8d/kCXdyzvt+5m9n dCQ7PrxA5nIrnzac+Wx5JLSYTHTvhEk8HkgSWng/xwuZ8ZeqK92+Fyagi6ztvl6ut2 MAFNfvePydwhA== From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , "Rafael J. Wysocki" , Lukasz Luba , Daniel Lezcano Subject: [PATCH v2 5/8] thermal/debugfs: Adjust check for trips without statistics in tze_seq_show() Date: Tue, 28 May 2024 16:57:13 +0200 Message-ID: <8389302.T7Z3S40VBb@kreacher> In-Reply-To: <5794974.DvuYhMxLoT@kreacher> References: <5794974.DvuYhMxLoT@kreacher> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: gggruggvucftvghtrhhoucdtuddrgedvledrvdejkedgheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhukhgrshiirdhluhgsrgesrghrmhdrtghomhdprhgtphhtthhopegurghnihgvlhdrlhgviigtrghnoheslhhinhgrrhhordhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 From: Rafael J. Wysocki Initialize the trip_temp field in struct trip_stats to THERMAL_TEMP_INVALID and adjust the check for trips without statistics in tze_seq_show() to look at that field instead of comparing min and max. This will mostly be useful to simplify subsequent changes. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- v1 -> v2: New patch. --- drivers/thermal/thermal_debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-pm/drivers/thermal/thermal_debugfs.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_debugfs.c +++ linux-pm/drivers/thermal/thermal_debugfs.c @@ -563,6 +563,7 @@ static struct tz_episode *thermal_debugf tze->duration = KTIME_MIN; for (i = 0; i < tz->num_trips; i++) { + tze->trip_stats[i].trip_temp = THERMAL_TEMP_INVALID; tze->trip_stats[i].min = INT_MAX; tze->trip_stats[i].max = INT_MIN; } @@ -818,7 +819,7 @@ static int tze_seq_show(struct seq_file trip_stats = &tze->trip_stats[trip_id]; /* Skip trips without any stats. */ - if (trip_stats->min > trip_stats->max) + if (trip_stats->trip_temp == THERMAL_TEMP_INVALID) continue; if (trip->type == THERMAL_TRIP_PASSIVE)