Message ID | 20201007050703.20759-1-cw00.choi@samsung.com |
---|---|
Headers | show |
Series | PM / devfreq: Add governor feature and attribute flag | expand |
... > diff --git a/Documentation/ABI/testing/sysfs-class-devfreq b/Documentation/ABI/testing/sysfs-class-devfreq > index deefffb3bbe4..67af3f31e17c 100644 > --- a/Documentation/ABI/testing/sysfs-class-devfreq > +++ b/Documentation/ABI/testing/sysfs-class-devfreq > @@ -37,20 +37,6 @@ Description: > The /sys/class/devfreq/.../target_freq shows the next governor > predicted target frequency of the corresponding devfreq object. > > -What: /sys/class/devfreq/.../polling_interval > -Date: September 2011 > -Contact: MyungJoo Ham <myungjoo.ham@samsung.com> > -Description: > - The /sys/class/devfreq/.../polling_interval shows and sets > - the requested polling interval of the corresponding devfreq > - object. The values are represented in ms. If the value is > - less than 1 jiffy, it is considered to be 0, which means > - no polling. This value is meaningless if the governor is > - not polling; thus. If the governor is not using > - devfreq-provided central polling > - (/sys/class/devfreq/.../central_polling is 0), this value > - may be useless. > - > What: /sys/class/devfreq/.../trans_stat > Date: October 2012 > Contact: MyungJoo Ham <myungjoo.ham@samsung.com> > @@ -65,14 +51,6 @@ Description: > as following: > echo 0 > /sys/class/devfreq/.../trans_stat > > -What: /sys/class/devfreq/.../userspace/set_freq > -Date: September 2011 > -Contact: MyungJoo Ham <myungjoo.ham@samsung.com> > -Description: > - The /sys/class/devfreq/.../userspace/set_freq shows and > - sets the requested frequency for the devfreq object if > - userspace governor is in effect. > - > What: /sys/class/devfreq/.../available_frequencies > Date: October 2012 > Contact: Nishanth Menon <nm@ti.com> > @@ -109,6 +87,35 @@ Description: > The max_freq overrides min_freq because max_freq may be > used to throttle devices to avoid overheating. > > +What: /sys/class/devfreq/.../polling_interval > +Date: September 2011 > +Contact: MyungJoo Ham <myungjoo.ham@samsung.com> > +Description: > + The /sys/class/devfreq/.../polling_interval shows and sets > + the requested polling interval of the corresponding devfreq > + object. The values are represented in ms. If the value is > + less than 1 jiffy, it is considered to be 0, which means > + no polling. This value is meaningless if the governor is > + not polling; thus. If the governor is not using > + devfreq-provided central polling > + (/sys/class/devfreq/.../central_polling is 0), this value > + may be useless. > + > + A list of governors that support the node: > + - simple_ondmenad > + - tegra_actmon > + > +What: /sys/class/devfreq/.../userspace/set_freq > +Date: September 2011 > +Contact: MyungJoo Ham <myungjoo.ham@samsung.com> > +Description: > + The /sys/class/devfreq/.../userspace/set_freq shows and > + sets the requested frequency for the devfreq object if > + userspace governor is in effect. > + > + A list of governors that support the node: > + - userspace > + > What: /sys/class/devfreq/.../timer > Date: July 2020 > Contact: Chanwoo Choi <cw00.choi@samsung.com> > @@ -120,3 +127,6 @@ Description: > as following: > echo deferrable > /sys/class/devfreq/.../timer > echo delayed > /sys/class/devfreq/.../timer > + > + A list of governors that support the node: > + - simple_ondemand Hello, Chanwoo! Could you please explain the reason of changing the doc? It looks like you only added the lists of governors, but is it a really useful change? Are you going to keep these lists up-to-date?
... > @@ -1361,6 +1373,9 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, > goto out; > } > > + remove_sysfs_files(df, df->governor); > + create_sysfs_files(df, governor); > + > prev_governor = df->governor; > df->governor = governor; > strncpy(df->governor_name, governor->name, DEVFREQ_NAME_LEN); > @@ -1460,39 +1475,6 @@ static ssize_t target_freq_show(struct device *dev, > } The further code may revert df->governor to the prev_governor or set it to NULL. The create_sysfs_files(df->governor) should be invoked at the very end of the governor_store() and only in a case of success.
On 10/19/20 9:38 AM, Dmitry Osipenko wrote: > ... >> diff --git a/Documentation/ABI/testing/sysfs-class-devfreq b/Documentation/ABI/testing/sysfs-class-devfreq >> index deefffb3bbe4..67af3f31e17c 100644 >> --- a/Documentation/ABI/testing/sysfs-class-devfreq >> +++ b/Documentation/ABI/testing/sysfs-class-devfreq >> @@ -37,20 +37,6 @@ Description: >> The /sys/class/devfreq/.../target_freq shows the next governor >> predicted target frequency of the corresponding devfreq object. >> >> -What: /sys/class/devfreq/.../polling_interval >> -Date: September 2011 >> -Contact: MyungJoo Ham <myungjoo.ham@samsung.com> >> -Description: >> - The /sys/class/devfreq/.../polling_interval shows and sets >> - the requested polling interval of the corresponding devfreq >> - object. The values are represented in ms. If the value is >> - less than 1 jiffy, it is considered to be 0, which means >> - no polling. This value is meaningless if the governor is >> - not polling; thus. If the governor is not using >> - devfreq-provided central polling >> - (/sys/class/devfreq/.../central_polling is 0), this value >> - may be useless. >> - >> What: /sys/class/devfreq/.../trans_stat >> Date: October 2012 >> Contact: MyungJoo Ham <myungjoo.ham@samsung.com> >> @@ -65,14 +51,6 @@ Description: >> as following: >> echo 0 > /sys/class/devfreq/.../trans_stat >> >> -What: /sys/class/devfreq/.../userspace/set_freq >> -Date: September 2011 >> -Contact: MyungJoo Ham <myungjoo.ham@samsung.com> >> -Description: >> - The /sys/class/devfreq/.../userspace/set_freq shows and >> - sets the requested frequency for the devfreq object if >> - userspace governor is in effect. >> - >> What: /sys/class/devfreq/.../available_frequencies >> Date: October 2012 >> Contact: Nishanth Menon <nm@ti.com> >> @@ -109,6 +87,35 @@ Description: >> The max_freq overrides min_freq because max_freq may be >> used to throttle devices to avoid overheating. >> >> +What: /sys/class/devfreq/.../polling_interval >> +Date: September 2011 >> +Contact: MyungJoo Ham <myungjoo.ham@samsung.com> >> +Description: >> + The /sys/class/devfreq/.../polling_interval shows and sets >> + the requested polling interval of the corresponding devfreq >> + object. The values are represented in ms. If the value is >> + less than 1 jiffy, it is considered to be 0, which means >> + no polling. This value is meaningless if the governor is >> + not polling; thus. If the governor is not using >> + devfreq-provided central polling >> + (/sys/class/devfreq/.../central_polling is 0), this value >> + may be useless. >> + >> + A list of governors that support the node: >> + - simple_ondmenad >> + - tegra_actmon >> + >> +What: /sys/class/devfreq/.../userspace/set_freq >> +Date: September 2011 >> +Contact: MyungJoo Ham <myungjoo.ham@samsung.com> >> +Description: >> + The /sys/class/devfreq/.../userspace/set_freq shows and >> + sets the requested frequency for the devfreq object if >> + userspace governor is in effect. >> + >> + A list of governors that support the node: >> + - userspace >> + >> What: /sys/class/devfreq/.../timer >> Date: July 2020 >> Contact: Chanwoo Choi <cw00.choi@samsung.com> >> @@ -120,3 +127,6 @@ Description: >> as following: >> echo deferrable > /sys/class/devfreq/.../timer >> echo delayed > /sys/class/devfreq/.../timer >> + >> + A list of governors that support the node: >> + - simple_ondemand > > Hello, Chanwoo! > > Could you please explain the reason of changing the doc? It looks like > you only added the lists of governors, but is it a really useful change? > Are you going to keep these lists up-to-date? I think that is is useful. Because user cannot know why specific sysfs node (like 'timer') is absence according to governor. So, in order to remove the user confusion, better to add the information to documentation.
On 10/19/20 9:39 AM, Dmitry Osipenko wrote: > ... >> @@ -1361,6 +1373,9 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, >> goto out; >> } >> >> + remove_sysfs_files(df, df->governor); >> + create_sysfs_files(df, governor); >> + >> prev_governor = df->governor; >> df->governor = governor; >> strncpy(df->governor_name, governor->name, DEVFREQ_NAME_LEN); >> @@ -1460,39 +1475,6 @@ static ssize_t target_freq_show(struct device *dev, >> } > > The further code may revert df->governor to the prev_governor or set it prev_governor is better. I'll change it. > to NULL. The create_sysfs_files(df->governor) should be invoked at the > very end of the governor_store() and only in a case of success. OK. I'll add more exception handling code.
On 10/19/20 1:11 PM, Chanwoo Choi wrote: > On 10/19/20 9:39 AM, Dmitry Osipenko wrote: >> ... >>> @@ -1361,6 +1373,9 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, >>> goto out; >>> } >>> >>> + remove_sysfs_files(df, df->governor); >>> + create_sysfs_files(df, governor); >>> + >>> prev_governor = df->governor; >>> df->governor = governor; >>> strncpy(df->governor_name, governor->name, DEVFREQ_NAME_LEN); >>> @@ -1460,39 +1475,6 @@ static ssize_t target_freq_show(struct device *dev, >>> } >> >> The further code may revert df->governor to the prev_governor or set it > > prev_governor is better. I'll change it. > >> to NULL. The create_sysfs_files(df->governor) should be invoked at the Also, when creating and removing the sysfs files, devfreq instance is needed because of df->dev.kobj. So, *_sysfs_files need the two parameters. >> very end of the governor_store() and only in a case of success. > > OK. I'll add more exception handling code. > > -- Best Regards, Chanwoo Choi Samsung Electronics