Re: [PATCH 2/2] PM / devfreq: Change to DEVFREQ_GOV_UPDATE_INTERVAL event name

From: Chanwoo Choi
Date: Wed Jan 29 2020 - 06:34:22 EST


On 1/29/20 8:28 PM, Lukasz Luba wrote:
> Hi Chanwoo,
>
> Apart from small mistakes in the commit message, looks good to me.
>
> On 1/29/20 11:20 AM, Chanwoo Choi wrote:
>> DEVFREQ_GOV_INTERVAL event indicates that update the interval
>> for polling mode of devfreq device. But, this event name doesn't
>> specify exactly what to do.
>>
>> Change DEVFREQ_GOV_INTERVAL event name to DEVFREQ_GOV_UPDATE_INTERVAL
>> which specifies what to do by event name.
>>
>> And modify the functio name for DEVFREQ_GOV_UPDATE_INTERVAL
>
> s/functio/function

I'll fix it.

>
>> with 'devfreq_' prefix + verb + obejct as following:
>
> 'obejct'?

I'll fix it to 'object'.

Thanks for the review.

>
>> - devfreq_interval_update -> devfreq_updatee_interval
>>
>> Signed-off-by: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
>> ---
>> Â drivers/devfreq/devfreq.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | 10 +++++-----
>> Â drivers/devfreq/governor.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ |Â 4 ++--
>> Â drivers/devfreq/governor_simpleondemand.c |Â 4 ++--
>> Â drivers/devfreq/tegra30-devfreq.cÂÂÂÂÂÂÂÂ |Â 4 ++--
>> Â 4 files changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>> index cceee8bc3c2f..8494c5f05a73 100644
>> --- a/drivers/devfreq/devfreq.c
>> +++ b/drivers/devfreq/devfreq.c
>> @@ -550,14 +550,14 @@ void devfreq_monitor_resume(struct devfreq *devfreq)
>> Â EXPORT_SYMBOL(devfreq_monitor_resume);
>> Â Â /**
>> - * devfreq_interval_update() - Update device devfreq monitoring interval
>> + * devfreq_update_interval() - Update device devfreq monitoring interval
>> ÂÂ * @devfreq:ÂÂÂ the devfreq instance.
>> ÂÂ * @delay:ÂÂÂÂÂ new polling interval to be set.
>> ÂÂ *
>> ÂÂ * Helper function to set new load monitoring polling interval. Function
>> - * to be called from governor in response to DEVFREQ_GOV_INTERVAL event.
>> + * to be called from governor in response to DEVFREQ_GOV_UPDATE_INTERVAL event.
>> ÂÂ */
>> -void devfreq_interval_update(struct devfreq *devfreq, unsigned int *delay)
>> +void devfreq_update_interval(struct devfreq *devfreq, unsigned int *delay)
>> Â {
>> ÂÂÂÂÂ unsigned int cur_delay = devfreq->profile->polling_ms;
>> ÂÂÂÂÂ unsigned int new_delay = *delay;
>> @@ -597,7 +597,7 @@ void devfreq_interval_update(struct devfreq *devfreq, unsigned int *delay)
>> Â out:
>> ÂÂÂÂÂ mutex_unlock(&devfreq->lock);
>> Â }
>> -EXPORT_SYMBOL(devfreq_interval_update);
>> +EXPORT_SYMBOL(devfreq_update_interval);
>> Â Â /**
>> ÂÂ * devfreq_notifier_call() - Notify that the device frequency requirements
>> @@ -1426,7 +1426,7 @@ static ssize_t polling_interval_store(struct device *dev,
>> ÂÂÂÂÂ if (ret != 1)
>> ÂÂÂÂÂÂÂÂÂ return -EINVAL;
>> Â -ÂÂÂ df->governor->event_handler(df, DEVFREQ_GOV_INTERVAL, &value);
>> +ÂÂÂ df->governor->event_handler(df, DEVFREQ_GOV_UPDATE_INTERVAL, &value);
>> ÂÂÂÂÂ ret = count;
>> Â ÂÂÂÂÂ return ret;
>> diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h
>> index 5ba3e051b1d0..c07ce77c253d 100644
>> --- a/drivers/devfreq/governor.h
>> +++ b/drivers/devfreq/governor.h
>> @@ -18,7 +18,7 @@
>> Â /* Devfreq events */
>> Â #define DEVFREQ_GOV_STARTÂÂÂÂÂÂÂÂÂÂÂ 0x1
>> Â #define DEVFREQ_GOV_STOPÂÂÂÂÂÂÂÂÂÂÂ 0x2
>> -#define DEVFREQ_GOV_INTERVALÂÂÂÂÂÂÂÂÂÂÂ 0x3
>> +#define DEVFREQ_GOV_UPDATE_INTERVALÂÂÂÂÂÂÂ 0x3
>> Â #define DEVFREQ_GOV_SUSPENDÂÂÂÂÂÂÂÂÂÂÂ 0x4
>> Â #define DEVFREQ_GOV_RESUMEÂÂÂÂÂÂÂÂÂÂÂ 0x5
>> Â @@ -61,7 +61,7 @@ void devfreq_monitor_start(struct devfreq *devfreq);
>> Â void devfreq_monitor_stop(struct devfreq *devfreq);
>> Â void devfreq_monitor_suspend(struct devfreq *devfreq);
>> Â void devfreq_monitor_resume(struct devfreq *devfreq);
>> -void devfreq_interval_update(struct devfreq *devfreq, unsigned int *delay);
>> +void devfreq_update_interval(struct devfreq *devfreq, unsigned int *delay);
>> Â Â int devfreq_add_governor(struct devfreq_governor *governor);
>> Â int devfreq_remove_governor(struct devfreq_governor *governor);
>> diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c
>> index 3d809f228619..1b314e1df028 100644
>> --- a/drivers/devfreq/governor_simpleondemand.c
>> +++ b/drivers/devfreq/governor_simpleondemand.c
>> @@ -96,8 +96,8 @@ static int devfreq_simple_ondemand_handler(struct devfreq *devfreq,
>> ÂÂÂÂÂÂÂÂÂ devfreq_monitor_stop(devfreq);
>> ÂÂÂÂÂÂÂÂÂ break;
>> Â -ÂÂÂ case DEVFREQ_GOV_INTERVAL:
>> -ÂÂÂÂÂÂÂ devfreq_interval_update(devfreq, (unsigned int *)data);
>> +ÂÂÂ case DEVFREQ_GOV_UPDATE_INTERVAL:
>> +ÂÂÂÂÂÂÂ devfreq_update_interval(devfreq, (unsigned int *)data);
>> ÂÂÂÂÂÂÂÂÂ break;
>> Â ÂÂÂÂÂ case DEVFREQ_GOV_SUSPEND:
>> diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c
>> index 0b65f89d74d5..28b2c7ca416e 100644
>> --- a/drivers/devfreq/tegra30-devfreq.c
>> +++ b/drivers/devfreq/tegra30-devfreq.c
>> @@ -734,7 +734,7 @@ static int tegra_governor_event_handler(struct devfreq *devfreq,
>> ÂÂÂÂÂÂÂÂÂ devfreq_monitor_stop(devfreq);
>> ÂÂÂÂÂÂÂÂÂ break;
>> Â -ÂÂÂ case DEVFREQ_GOV_INTERVAL:
>> +ÂÂÂ case DEVFREQ_GOV_UPDATE_INTERVAL:
>> ÂÂÂÂÂÂÂÂÂ /*
>> ÂÂÂÂÂÂÂÂÂÂ * ACTMON hardware supports up to 256 milliseconds for the
>> ÂÂÂÂÂÂÂÂÂÂ * sampling period.
>> @@ -745,7 +745,7 @@ static int tegra_governor_event_handler(struct devfreq *devfreq,
>> ÂÂÂÂÂÂÂÂÂ }
>> Â ÂÂÂÂÂÂÂÂÂ tegra_actmon_pause(tegra);
>> -ÂÂÂÂÂÂÂ devfreq_interval_update(devfreq, new_delay);
>> +ÂÂÂÂÂÂÂ devfreq_update_interval(devfreq, new_delay);
>> ÂÂÂÂÂÂÂÂÂ ret = tegra_actmon_resume(tegra);
>> ÂÂÂÂÂÂÂÂÂ break;
>> Â
>
>
> Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx>
>
>
> Regards,
> Lukasz
>
>


--
Best Regards,
Chanwoo Choi
Samsung Electronics