Linux Power Management development
 help / color / mirror / Atom feed
From: MyungJoo Ham <myungjoo.ham@samsung.com>
To: 최찬우 <cw00.choi@samsung.com>, 박경민 <kyungmin.park@samsung.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device
Date: Thu, 19 Nov 2015 10:10:58 +0000 (GMT)	[thread overview]
Message-ID: <932082455.1194101447927858604.JavaMail.weblogic@ep2mlwas06b> (raw)

> After probing the devfreq device driver, the value of both min_freq and
> max_freq are zero(0). So, this patch initializes the 'min_freq' and 'max_freq'
> field of devfreq device by using the freq_table array.
> 
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/devfreq/devfreq.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index c292ceb7ff19..0b24ae7b7a48 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -121,6 +121,11 @@ static void devfreq_set_freq_table(struct devfreq *devfreq)
>  		profile->freq_table[i] = freq;
>  	}
>  	rcu_read_unlock();
> +
> +	mutex_lock(&devfreq->lock);
> +	devfreq->min_freq = profile->freq_table[0];
> +	devfreq->max_freq = profile->freq_table[profile->max_state - 1];
> +	mutex_unlock(&devfreq->lock);
>  }

No, you should not do this.

It is allowed to use devfreq without both OPP and freq_table
assuming that the devfreq device may operate with very many
frequencies so that practically, we can virtually give it
any frequency numbers in a given range.
(cases where profile->max_state is 0 and it is not an error)

The value 0 is used for min/max_freq to declare
that min/max_freq is deactivated. Therefore, it is not
required to do so; they are not intended to show the hardware
configuration as well.

Cheers,
MyungJoo

             reply	other threads:[~2015-11-19 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 10:10 MyungJoo Ham [this message]
2015-11-19 10:37 ` [PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device Chanwoo Choi
  -- strict thread matches above, loose matches on Subject: below --
2015-11-19  8:17 [PATCH 0/6] PM / devfreq: Clean code and add set the freq_table array Chanwoo Choi
2015-11-19  8:17 ` [PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device Chanwoo Choi

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=932082455.1194101447927858604.JavaMail.weblogic@ep2mlwas06b \
    --to=myungjoo.ham@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox