All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org, daniel.lezcano@linaro.org,
	viresh.kumar@linaro.org
Subject: Re: [RFC PATCH 3/5] thermal: support statistics table resizing at runtime
Date: Wed, 08 Apr 2020 11:45:20 +0200	[thread overview]
Message-ID: <s5himias43z.wl-tiwai@suse.de> (raw)
In-Reply-To: <20200408041917.2329-3-rui.zhang@intel.com>

On Wed, 08 Apr 2020 06:19:15 +0200,
Zhang Rui wrote:
> 
> Introduce thermal_cdev_stats_update_max() which can be used to update
> the cooling device statistics table when maximum cooling state of a
> cooling device is changed.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Just a couple of small nitpicking:

> @@ -787,6 +791,23 @@ void thermal_cdev_stats_update_cur(struct thermal_cooling_device *cdev,
>  	spin_unlock(&stats->lock);
>  }
>  
> +void thermal_cdev_stats_update_max(struct thermal_cooling_device *cdev)
> +{
> +	struct cooling_dev_stats *stats = cdev->stats;
> +	unsigned long cur_state, max_state;
> +
> +	if (!stats)
> +		return;
> +
> +	if (cdev->ops->get_max_state(cdev, &max_state))
> +		return;
> +
> +	if (cdev->ops->get_cur_state(cdev, &cur_state))
> +		return;
> +
> +	cooling_device_stats_resize(cdev, cur_state, max_state);
> +}

Don't we need to export this?

> @@ -946,7 +975,15 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev)
>  	cdev->stats = stats;
>  	spin_lock_init(&stats->lock);
>  
> -	ret = cooling_device_stats_resize(cdev);
> +	ret = cdev->ops->get_max_state(cdev, &max_state);
> +	if (ret)
> +		return;
> +
> +	/**
> +	 *  cooling device current state will be updated soon
> +	 *  during registration
> +	 **/

This comment style is confusing as if a kernel-doc.


thanks,

Takashi

  reply	other threads:[~2020-04-08  9:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08  4:19 [RFC PATCH 1/5] thermal: rename thermal_cooling_device_stats_update() Zhang Rui
2020-04-08  4:19 ` [RFC PATCH 2/5] thermal: create statistics table in two steps Zhang Rui
2020-04-08  4:19 ` [RFC PATCH 3/5] thermal: support statistics table resizing at runtime Zhang Rui
2020-04-08  9:45   ` Takashi Iwai [this message]
2020-04-09  2:57     ` Zhang Rui
2020-04-08  4:19 ` [RFC PATCH 4/5] thermal: Add a sanity check for invalid state at stats update Zhang Rui
2020-04-08  4:19 ` [RFC PATCH 5/5] ACPI: processor: do update when maximum cooling state changed Zhang Rui
2020-04-09 13:34   ` Daniel Lezcano
2020-04-10  8:02     ` Zhang Rui
2020-04-10 12:10       ` Daniel Lezcano
2020-04-12  6:13         ` Zhang Rui
2020-04-12 10:07           ` Daniel Lezcano
2020-04-13  2:01             ` Zhang Rui
2020-04-13 18:06               ` Daniel Lezcano
2020-04-16  4:46                 ` Zhang Rui
2020-04-16  7:58                   ` Daniel Lezcano
2020-04-17  2:09                     ` Zhang Rui
2020-04-10 14:10       ` Rafael J. Wysocki
2020-04-11  4:41         ` Zhang Rui
2020-04-13 16:16   ` kbuild test robot
2020-04-14 12:37   ` Dan Carpenter
2020-04-14 12:37     ` Dan Carpenter
2020-04-08  9:47 ` [RFC PATCH 1/5] thermal: rename thermal_cooling_device_stats_update() Takashi Iwai
2020-04-09  2:59   ` Zhang Rui
2020-05-06 12:07 ` Amit Kucheria

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=s5himias43z.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=viresh.kumar@linaro.org \
    /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.