Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1331732lqd; Thu, 25 Apr 2024 12:08:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCtf0cEnchLmHqY4is9sYSn77yst37IoWpBfySM1gcRE6jyJVh3Qi7OmWbaTT9tSJ2OWlt/Jfr80Vhy8xNju1XNfG6yrDaNMnoeLyXRw== X-Google-Smtp-Source: AGHT+IEuWwvFDKyJQt8VD3lgg7AMM2T20db/+jzTr+Q2XB4ACCLC07nqAjuuFSo7F7lYuezCjIGK X-Received: by 2002:a05:6214:584e:b0:6a0:a9dc:b117 with SMTP id ml14-20020a056214584e00b006a0a9dcb117mr447454qvb.0.1714072102161; Thu, 25 Apr 2024 12:08:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714072102; cv=pass; d=google.com; s=arc-20160816; b=mJaK4tQkUVkRvB+97FL5l/lynE/IWDI+SSJUOHTZGHjXKixFoLk2MD9fdTuCsXD+gO IXF6c8iZXQsuc0fEYVxyR/ZN90JuQgGKXvyPM7iP3YsGKIeRxD8CTKFx07cLSWRBRNQN Blu4Yah7KCZGIzmSR0/iTmtfmiczXg/Ot65L7SNKHRWK1+vSXVqTFRK2/XyJO1auexmO R4ua9EWjALmOM3i+S3PJJ49+jQLpjxAbrKrTfrFALncnPv/DMlJU7470KOGrWw8Hu/i9 KIZChuhtj57KY9HYu5sE+5fbHN+Ngq9MDzQJb6IdRod28DfXJbFqUzCzXC7aCuhh48Jc kG4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=T2JZsLZtrb0hcawqiq1YcV+2v35aTkjsu7g2fHzHFiE=; fh=wOhU+RfGR6AETSQpmLn4c4kjE8Q9JmYwekkxN+5ihyo=; b=O7iQCHr4b7u3mzvzITcQnVtZrTOGfGVZTz+F6L0MEiXpVYgG7UM7qzPByEHkkEGk36 k4FoQ90L2wtqTCtQPtDOs3zK0rpsGzq6LU+NVrWzZCQrjbQBTsvaCVfABvLhdnpo6bDI eBwx4TXkHsJnqgCXw/fO8D4Fe57r3sPBkYBWDZpEz70XbrxPYVCnLN6xtiSY9EnLj6ht S8oOeKXE8q8rjjjez2esoav69jYQ8107jaVZnnOHaZ4T8TBhHWgaYgK/wiG7+ngY+l0W ZT4gvgyRvpiITaiQ4dGl/dGnVNSLckY24V1f9TtikErtosoUbzgZyvdq+KJE9XHEQWE8 FWhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-159061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j10-20020a05621419ca00b006a0873eed9fsi8613172qvc.480.2024.04.25.12.08.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 12:08:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-159061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DCF651C20B97 for ; Thu, 25 Apr 2024 19:08:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 897F21514DD; Thu, 25 Apr 2024 19:08:14 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DAB439FCF; Thu, 25 Apr 2024 19:08:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714072094; cv=none; b=LHZbVzgFiXUp4jKIdWYr+VWQntKWogwcqhFFWpUGk3ERoOEHXVf9eEaC5iqqkr24Z9djEEN9C/d7d20eV0WmocT0oyS0I6eOSbzLXI7GGykodPPNFCcPfn8Ung7lxGiT7042KarQbvnP+rUkotCoRHo4UO3NBBpMgWvStHjPY/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714072094; c=relaxed/simple; bh=GzIuAu2wdC/XfK35nS2UyFarpW+pmbi1UNViZv7vvlQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VqfWkE6PFv6INscXwrUIQitRYd+43s4V4cgIPo9yHN6BE4BN/Z7WobG1qZuL4jvhwkvQnqm+lp9AmAbD8h1KkdihZUK56Gc4CbGiD7DuzZjsz30Bseo8mTiZ34lb5Lq0LZiux6pHwaR4WP7eJUho7YEfZtkLm33OoQOs0ODchb8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47BDE2F; Thu, 25 Apr 2024 12:08:40 -0700 (PDT) Received: from [10.57.75.39] (unknown [10.57.75.39]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 17D6E3F793; Thu, 25 Apr 2024 12:08:10 -0700 (PDT) Message-ID: <9edd1059-e9ad-466e-a302-8055a44ff56d@arm.com> Date: Thu, 25 Apr 2024 20:08:09 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] thermal/debugfs: Create records for cdev states as they get used To: "Rafael J. Wysocki" Cc: LKML , Linux PM , "Rafael J. Wysocki" , Daniel Lezcano References: <3297002.44csPzL39Z@kreacher> <10458619.nUPlyArG6x@kreacher> Content-Language: en-US From: Lukasz Luba In-Reply-To: <10458619.nUPlyArG6x@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/25/24 15:03, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Because thermal_debug_cdev_state_update() only creates a duration record > for the old state of a cooling device, if its new state is used for the > first time, there will be no record for it and cdev_dt_seq_show() will > not print the duration information for it even though it contains code > to compute the duration value in that case. > > Address this by making thermal_debug_cdev_state_update() create a > duration record for the new state if there is none. > > Fixes: 755113d76786 ("thermal/debugfs: Add thermal cooling device debugfs information") > Reported-by: Lukasz Luba > Signed-off-by: Rafael J. Wysocki > --- > drivers/thermal/thermal_debugfs.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > Index: linux-pm/drivers/thermal/thermal_debugfs.c > =================================================================== > --- linux-pm.orig/drivers/thermal/thermal_debugfs.c > +++ linux-pm/drivers/thermal/thermal_debugfs.c > @@ -433,6 +433,14 @@ void thermal_debug_cdev_state_update(con > } > > cdev_dbg->current_state = new_state; > + > + /* > + * Create a record for the new state if it is not there, so its > + * duration will be printed by cdev_dt_seq_show() as expected if it > + * runs before the next state transition. > + */ > + thermal_debugfs_cdev_record_get(thermal_dbg, cdev_dbg->durations, new_state); > + > transition = (old_state << 16) | new_state; > > /* > > > > Reviewed-by: Lukasz Luba