linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Yue Hu <zbestahu@gmail.com>
Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	linux-pm@vger.kernel.org, huyue2@yulong.com
Subject: Re: [PATCH] PM / devfreq: Drop the name check to request module in try_then_request_governor()
Date: Wed, 31 Jul 2019 14:55:39 +0900	[thread overview]
Message-ID: <cf760204-2504-cef9-09e7-19643986a902@samsung.com> (raw)
In-Reply-To: <20190731133808.00006f5b.zbestahu@gmail.com>

On 19. 7. 31. 오후 2:38, Yue Hu wrote:
> On Wed, 31 Jul 2019 09:33:06 +0900
> Chanwoo Choi <cw00.choi@samsung.com> wrote:
> 
>> On 19. 7. 30. 오후 7:08, Yue Hu wrote:
>>> From: Yue Hu <huyue2@yulong.com>
>>>
>>> No need to check specific governor name of `simple_ondemand` to request
>>> module, let's change the name string to `simpleondemand` to keep the
>>> consistency on loading module if needed.  
>>
>> NACK.
>>
>> hmm.... It is impossible to change the devfreq governor name
>> because there are many reason.
>>
>> The devfreq governor could be changed through the sysfs interface
>> on runtime. For a long time, many users or platforms change
>> the devfreq governor with the defined governor name through sysfs.
>> If it is just changed, it breaks ABI interface and cannot support
>> the compatibility. It is very critical problem. Please drop it.
> 
> Yes, needs update also if using sysfs. it's problem indeed.

No, It is impossible to update it. You have to change all kind of
platform in the world. We never know the all use-case in the world.
As I said, it break the ABI interface. 

> 
>>
>>
>> Maybe, you didn't check the usage of devfreq device driver
>> in the mainline kernel. Almost devfreq device using simple_ondemand
>> governor have to add the governor name with devfreq_add_device().
>> If changed the governor name, it cause the fault of device driver
>> using the devfreq framework with simple_ondemand.
> 
> Currently, seems no devfreq users use the simple_ondemand directly in
> mainline kernel.

You can find them in the mainline kernel as following:

drivers/gpu/drm/panfrost/panfrost_devfreq.c:160:&panfrost_devfreq_profile, "simple_ondemand", NULL);
drivers/gpu/drm/msm/msm_gpu.c:98:		&msm_devfreq_profile, "simple_ondemand", NULL);

drivers/scsi/ufs/ufshcd.c:1333:			DEVFREQ_GOV_SIMPLE_ONDEMAND,
drivers/devfreq/tegra20-devfreq.c:176:		DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL);
drivers/devfreq/rk3399_dmc.c:452:		DEVFREQ_GOV_SIMPLE_ONDEMAND,
drivers/devfreq/exynos-bus.c:437:		DEVFREQ_GOV_SIMPLE_ONDEMAND,

> 
> Maybe we can rename the governor file name to governor_simpleondemand.c,
> just not compatible to module name compared with this change.

The file name was already 'drivers/devfreq/governor_simpleondemand.c'.


> 
> Thanks.
> 
>>
>>
>>>
>>> Signed-off-by: Yue Hu <huyue2@yulong.com>
>>> ---
>>>  drivers/devfreq/devfreq.c | 6 +-----
>>>  include/linux/devfreq.h   | 2 +-
>>>  2 files changed, 2 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>>> index 784c08e..baff682 100644
>>> --- a/drivers/devfreq/devfreq.c
>>> +++ b/drivers/devfreq/devfreq.c
>>> @@ -246,11 +246,7 @@ static struct devfreq_governor *try_then_request_governor(const char *name)
>>>  	if (IS_ERR(governor)) {
>>>  		mutex_unlock(&devfreq_list_lock);
>>>  
>>> -		if (!strncmp(name, DEVFREQ_GOV_SIMPLE_ONDEMAND,
>>> -			     DEVFREQ_NAME_LEN))
>>> -			err = request_module("governor_%s", "simpleondemand");
>>> -		else
>>> -			err = request_module("governor_%s", name);
>>> +		err = request_module("governor_%s", name);
>>>  		/* Restore previous state before return */
>>>  		mutex_lock(&devfreq_list_lock);
>>>  		if (err)
>>> diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
>>> index 2bae9ed..41e8792 100644
>>> --- a/include/linux/devfreq.h
>>> +++ b/include/linux/devfreq.h
>>> @@ -17,7 +17,7 @@
>>>  #define DEVFREQ_NAME_LEN 16
>>>  
>>>  /* DEVFREQ governor name */
>>> -#define DEVFREQ_GOV_SIMPLE_ONDEMAND	"simple_ondemand"
>>> +#define DEVFREQ_GOV_SIMPLE_ONDEMAND	"simpleondemand"
>>>  #define DEVFREQ_GOV_PERFORMANCE		"performance"
>>>  #define DEVFREQ_GOV_POWERSAVE		"powersave"
>>>  #define DEVFREQ_GOV_USERSPACE		"userspace"
>>>   
>>
>>
> 
> 
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

  reply	other threads:[~2019-07-31  5:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190730100844epcas4p14dfa39fff2636e89c94033f154240db0@epcas4p1.samsung.com>
2019-07-30 10:08 ` [PATCH] PM / devfreq: Drop the name check to request module in try_then_request_governor() Yue Hu
2019-07-31  0:33   ` Chanwoo Choi
2019-07-31  5:38     ` Yue Hu
2019-07-31  5:55       ` Chanwoo Choi [this message]
2019-07-31  5:57         ` Yue Hu
2019-07-31  6:02           ` 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=cf760204-2504-cef9-09e7-19643986a902@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=huyue2@yulong.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=zbestahu@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).