[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGTfZH2BmZ1_sev87Z7BYRHnVBkAKB3yyOWmsryx+yg36Tu7NA@mail.gmail.com>
Date: Mon, 23 Nov 2015 17:51:27 +0900
From: Chanwoo Choi <cwchoi00@...il.com>
To: "myungjoo.ham@...sung.com" <myungjoo.ham@...sung.com>
Cc: 박경민 <kyungmin.park@...sung.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
Subject: Re: [PATCH 4/6] PM / devfreq: Set the freq_table of devfreq device
On Mon, Nov 23, 2015 at 4:29 PM, MyungJoo Ham <myungjoo.ham@...sung.com> wrote:
>>
>> This patch initialize the freq_table array of each devfreq device by using
>> the devfreq_set_freq_table(). If freq_table is NULL, the devfreq framework
>> is not able to support the frequency transtion information through sysfs.
>>
>> The OPP core uses the integer type for the number of opps in the opp list
>> and uses the 'unsigned long' type for each frequency. So, this patch modifies
>> the type of some variable as following:
>> - the type of freq_table : unsigned int -> unsigned long
>> - the type of max_state : unsigned int -> int
>>
>> Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
> []
>> +/**
>> * devfreq_update_status() - Update statistics of devfreq behavior
>> * @devfreq: the devfreq instance
>> * @freq: the update target frequency
>> @@ -477,7 +516,12 @@ struct devfreq *devfreq_add_device(struct device *dev,
>> devfreq->previous_freq = profile->initial_freq;
>> devfreq->data = data;
>> devfreq->nb.notifier_call = devfreq_notifier_call;
>> + mutex_unlock(&devfreq->lock);
>>
>> + if (devfreq->profile->max_state <= 0 && !devfreq->profile->freq_table)
>> + devfreq_set_freq_table(devfreq);
>> +
>> + mutex_lock(&devfreq->lock);
>
> Anyway, what about modifying the block above as:
>
> + if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
> + mutex_unlock(&devfreq->lock);
> devfreq_set_freq_table(devfreq);
> + mutex_lock(&devfreq->lock);
> + }
>
>> devfreq->trans_table = devm_kzalloc(dev, sizeof(unsigned int) *
>> devfreq->profile->max_state *
>> devfreq->profile->max_state,
> []
>
> If that's not a problem, I'll squash
> https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/commit/?h=for-rafael&id=55df2b43cdb5ac82d26b64d739f3d758c9b7486c
> with the given patch.
I agree. Thanks for fixing this.
Regards,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists