linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: leonard.crestez@nxp.com, lukasz.luba@arm.com,
	enric.balletbo@collabora.com, hl@rock-chips.com,
	digetx@gmail.com, thierry.reding@gmail.com, jonathanh@nvidia.com,
	abel.vesa@nxp.com, cw00.choi@samsung.com, chanwoo@kernel.org,
	myungjoo.ham@samsung.com, kyungmin.park@samsung.com
Subject: [PATCH v2 0/2] PM / devfreq: Add governor flags
Date: Mon, 13 Jul 2020 17:31:11 +0900	[thread overview]
Message-ID: <20200713083113.5595-1-cw00.choi@samsung.com> (raw)
In-Reply-To: CGME20200713081943epcas1p451280630c83a47b2687ab84d28ccdea0@epcas1p4.samsung.com

Devfreq provides the multiple governors and sysfs interface for user.
But, some sysfs attributes are useful or not useful. Prior to that
the user can access all sysfs attributes regardless of availability.

So, clarify the access permission of sysfs attributes according to governor.
Provide the governor flag to specify what is necessary or not.
When adding the devfreq governor, governor can specify the available
attributes with DEVFREQ_GOV_ATTR_ATTR_* defintion as following.

[Definition for sysfs attributes]
- DEVFREQ_GOV_ATTR_GOVERNOR
- DEVFREQ_GOV_ATTR_AVAIL_GOVERNORS
- DEVFREQ_GOV_ATTR_AVAIL_FREQUENCIES
- DEVFREQ_GOV_ATTR_CUR_FREQ
- DEVFREQ_GOV_ATTR_TARGET_FREQ
- DEVFREQ_GOV_ATTR_MIN_FREQ
- DEVFREQ_GOV_ATTR_MAX_FREQ
- DEVFREQ_GOV_ATTR_TRANS_STAT
- DEVFREQ_GOV_ATTR_POLLING_INTERVAL
- DEVFREQ_GOV_ATTR_TIMER

Also, the devfreq governor is able to have the specific flag as follows
in order to implement the specific feature with DEVFREQ_GOV_FLA_*.
For exmaple, the devfreq deivce using passive governor cannot change
their own governor because passive governor requires the 'immutable'
feature with DEVFREQ_GOV_FLAG_IMMUTABLE.

[Definition for governor flag]
- DEVFREQ_GOV_FLAG_IMMUTABLE
: If immutable flag is set, governor is never changeable to other governors.
- DEVFREQ_GOV_FLAG_IRQ_DRIVEN
: Devfreq core won't schedule polling work for this governor if value is set.


Changes from v1:
- Rebase it on latest devfreq-next branch
- Fix typo issue of tegra30-devfreq.c and test it with COMPILE_TEST

Chanwoo Choi (2):
  PM / devfreq: Clean up the devfreq instance name in sysfs attr
  PM / devfreq: Add governor flags to clarify the features

 drivers/devfreq/devfreq.c                 | 186 +++++++++++++++++-----
 drivers/devfreq/governor.h                |  44 ++++-
 drivers/devfreq/governor_passive.c        |   3 +-
 drivers/devfreq/governor_performance.c    |   1 +
 drivers/devfreq/governor_powersave.c      |   1 +
 drivers/devfreq/governor_simpleondemand.c |   3 +
 drivers/devfreq/governor_userspace.c      |   1 +
 drivers/devfreq/tegra30-devfreq.c         |   6 +-
 8 files changed, 192 insertions(+), 53 deletions(-)

-- 
2.17.1


       reply	other threads:[~2020-07-13  8:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200713081943epcas1p451280630c83a47b2687ab84d28ccdea0@epcas1p4.samsung.com>
2020-07-13  8:31 ` Chanwoo Choi [this message]
     [not found]   ` <CGME20200713081943epcas1p2a618d5a2e87610be7442e1fa584076cf@epcas1p2.samsung.com>
2020-07-13  8:31     ` [PATCH v2 1/2] PM / devfreq: Clean up the devfreq instance name in sysfs attr Chanwoo Choi
2020-07-24  1:42       ` Chanwoo Choi
     [not found]   ` <CGME20200713081944epcas1p22871b6d8a9455226e6cccd08ac0baa73@epcas1p2.samsung.com>
2020-07-13  8:31     ` [PATCH v2 2/2] PM / devfreq: Add governor flags to clarify the features Chanwoo Choi
2020-07-13 10:37       ` Dmitry Osipenko
2020-07-13 12:26         ` Chanwoo Choi
2020-07-13 14:26           ` Dmitry Osipenko

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=20200713083113.5595-1-cw00.choi@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=abel.vesa@nxp.com \
    --cc=chanwoo@kernel.org \
    --cc=digetx@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=hl@rock-chips.com \
    --cc=jonathanh@nvidia.com \
    --cc=kyungmin.park@samsung.com \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=thierry.reding@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).