All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH v2 1/3] thermal/debugfs: Create records for cdev states as they get used
Date: Thu, 25 Apr 2024 20:08:09 +0100	[thread overview]
Message-ID: <9edd1059-e9ad-466e-a302-8055a44ff56d@arm.com> (raw)
In-Reply-To: <10458619.nUPlyArG6x@kreacher>



On 4/25/24 15:03, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> 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 <lukasz.luba@arm.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>   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 <lukasz.luba@arm.com>

  reply	other threads:[~2024-04-25 19:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 14:01 [PATCH v2 0/3] thermal/debugfs: Fix handling of cdev states and mitigation episodes in progress Rafael J. Wysocki
2024-04-25 14:03 ` [PATCH v2 1/3] thermal/debugfs: Create records for cdev states as they get used Rafael J. Wysocki
2024-04-25 19:08   ` Lukasz Luba [this message]
2024-04-25 14:04 ` [PATCH v2 2/3] thermal/debugfs: Pass cooling device state to thermal_debug_cdev_add() Rafael J. Wysocki
2024-04-25 20:32   ` Lukasz Luba
2024-04-25 14:05 ` [PATCH v2 3/3] thermal/debugfs: Avoid printing zero duration for mitigation events in progress Rafael J. Wysocki
2024-04-25 20:54   ` Lukasz Luba
2024-04-25 20:55 ` [PATCH v2 0/3] thermal/debugfs: Fix handling of cdev states and mitigation episodes " Lukasz Luba
2024-04-26  9:55   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9edd1059-e9ad-466e-a302-8055a44ff56d@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.