platform/core/system/pass.git
4 years agopass: parser: Add support for parsing of scenario pass_level 16/224716/6
Chanwoo Choi [Tue, 28 Jan 2020 05:02:30 +0000 (14:02 +0900)]
pass: parser: Add support for parsing of scenario pass_level

PASS provides multiple modules like CPUHP (CPU Hotplug Manager), PMQoS,
Thermal Monitor and so on. Each module requires their own pass_level
in order to change h/w resources such as the number of online CPU,
the minimum/maximum frequency of GPU.

Prior to that, PASS supports only 'pass_level'. If user of PASS want to
set 'AppLaunch' scenario of PMQoS module, PMQoS only requires the range
of 'pass_level' like the minimum and maximum 'pass_level'. It is not enough
to meet the requirements from 'AppLaunch' scenario. Some scenario might
require the more detailed changes than already defined 'pass_level'.

In result of these requirements, add support for new 'scenario pass_level'
for only scenario such as AppLaunch of PMQoS and WarningAction of Thermal
Monitor. 'scenario pass_level' is possible to specify the detailed value
of h/w resources such as the minimum/maximum frequency (limit_min/max_fre),
the minimum/maximum number of online CPU (limit_min/max_cpu)
and fault_around_bytes for memorh h/w resource.

[Detailed new properties for 'scenario pass_level']
1.
- section name : [pass]
- property name : pass_num_scenario_levels
- property value type : integer
- mandatory or optional : mandatory

2.
- section name : [pass]
- property name : pass_init_scenario_levels
- property value type : integer
- mandatory or optional : mandatory

3.
- section name : [ScenarioLevel%d]
- properties name in section : pass_level and scenario pass_level
are to use common properties.

4.
- section name : [Scenario%d]
- property name : scenario_level
- property value type : integer, it denotes the index of scenario pass_level.
- mandatory or optional : mandatory

For example, usecase of scenario pass_level by AppLaunch PMQoS scenario.
[pass]
pass_num_scenario_levels=2
pass_init_scenario_levels=0

[ScenarioLevel0]
limit_min_freq=400000
limit_max_freq=1300000
limit_min_cpu=1
limit_max_cpu=4

[ScenarioLevel1]
limit_min_freq=800000
limit_max_freq=1300000
limit_min_cpu=4
limit_max_cpu=4

[PassScenario]
pass_scenario_support=yes
pass_num_scenarios=1

[Scenario0]
name=AppLaunch
support=yes
scenario_level=1

Change-Id: I8f058bf68278667ee68b821eb58c972aa298646f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agopass: parser: Verify properties of pass_level before using 15/224715/7
Chanwoo Choi [Tue, 28 Jan 2020 04:40:38 +0000 (13:40 +0900)]
pass: parser: Verify properties of pass_level before using

Prior to that there are no any restrictions about adding properties
to pass_level in the configuration file such as /etc/pass/pass-resource-*.conf
for each h/w resource.

Add some restrictions of pass_level as following:
- In case of CPU,
  If there is either limit_min_cpu or limit_max_cpu in pass_level,
  have to add both limit_min_cpu and limit_max_cpu to pass_level.
- In case of CPU/GPU/BUS,
  if there is either limit_min_freq or limit_max_freq in pass_level,
  have to add both limit_min_freq and limit_max_frewq to pass_level.

Change-Id: I899121c433432ad92800f741f2b8df78dc135de0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agopass: rescon: Add new 'limit_max_cpu' property for CPU h/w resource 14/224714/1
Chanwoo Choi [Tue, 28 Jan 2020 02:32:41 +0000 (11:32 +0900)]
pass: rescon: Add new 'limit_max_cpu' property for CPU h/w resource

'limit_max_cpu' means the maximum number of online CPU.
If pass_level contains 'limit_max_cpu' value, RESCON (Resource Controller)

And remove the wrong comment from 'limit_min_cpu' comment
because 'limit_max_cpu' and 'limit_min_cpu' are supported
for only PASS_RESOURCE_CPU_ID h/w resource.

Change-Id: Ice6033491532895c8f1e1a71d7229f9362b184bf
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agopass: thermal: Call resource monitor API directly without redundant function 12/224412/1 accepted/tizen/unified/20200214.050407 submit/tizen/20200213.105841
Chanwoo Choi [Mon, 10 Feb 2020 09:56:52 +0000 (18:56 +0900)]
pass: thermal: Call resource monitor API directly without redundant function

get_thermal_result() is called once. It is possible to be removed
instead of calling resmon (resouce monitor) API directly without
any middle step.

Change-Id: Ib058d540056fe1a8fc7b206fb98c096272c17121
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agopass: Clean-up minor indentaion to show the scenario name during init step 88/224288/4
Chanwoo Choi [Fri, 7 Feb 2020 10:57:02 +0000 (19:57 +0900)]
pass: Clean-up minor indentaion to show the scenario name during init step

Clean-up indentaion to show the scenario name during init step
without any behavior changes.

[Before]
I/PASS    ( 1110): pmqos.c: pmqos_init_done(498) > Support 'AppLaunch' scenario
I/PASS    ( 1110): pmqos.c: pmqos_init_done(498) > Support 'UltraPowerSaving' scenario
I/PASS    ( 1110): thermal.c: thermal_init_done(139) > Support 'Release' scenario
I/PASS    ( 1110): thermal.c: thermal_init_done(139) > Support 'Warning' scenario
I/PASS    ( 1110): thermal.c: thermal_init_done(139) > Support 'LimitAction' scenario
I/PASS    ( 1110): thermal.c: thermal_init_done(139) > Support 'Shutdown' scenario

[After]
I/PASS    ( 2109): pmqos.c: pmqos_init_done(498) > Support 'AppLaunch       ' pmqos scenario
I/PASS    ( 2109): pmqos.c: pmqos_init_done(498) > Support 'UltraPowerSaving' pmqos scenario
I/PASS    ( 2109): thermal.c: thermal_init_done(139) > Support 'Release     ' thermal scenario
I/PASS    ( 2109): thermal.c: thermal_init_done(139) > Support 'Warning     ' thermal scenario
I/PASS    ( 2109): thermal.c: thermal_init_done(139) > Support 'LimitAction ' thermal scenario
I/PASS    ( 2109): thermal.c: thermal_init_done(139) > Support 'Shutdown    ' thermal scenario

Change-Id: I08223949a76610352475592f02856f07c3f2c69a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agopass: thermal: Define thermal_update function to reduce duplicate code 87/224287/4
Chanwoo Choi [Fri, 7 Feb 2020 10:28:55 +0000 (19:28 +0900)]
pass: thermal: Define thermal_update function to reduce duplicate code

thermal_moitor_func() and thermal_get_scenario() functions contains
the same code for deciding the next thermal scenario by using the
thermal raw data. So that define thermal_update() function to reduce
duplicate code from both thermal_moitor_func() and thermal_get_scenario().

Change-Id: Ia0bfef053163a848e657efb36c2dccb232037a04
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agopass: thermal: Fix bug of interval update until changed first thermal scenario 86/224286/3
Chanwoo Choi [Fri, 7 Feb 2020 08:13:29 +0000 (17:13 +0900)]
pass: thermal: Fix bug of interval update until changed first thermal scenario

The commit 6e9640753a86 ("thermal: Support dbus activation for thermal f/w")
read the temperature and then updated the system early thermal scenario
on thermal_get_scenario() function. When updated the thermal scenario,
have to update the timer interval ('timer_interval_ms' property)
if each thernmal scenaior defines their own timer interval
in configuration file.

But, thermal_get_scenario() has missed the interval update for thermal
monitoring when detecting the ealy thermal scenario on initialization step.
Because each thermal scenario is able to have their own timer interval
('timer_interval_ms' property) for adjusting the timer interval of monitoring.

[Example how to define the thermal scenario information for each h/w resource]
[thermal.scenario1]
support=no
name=Warning
temperature=65
timer_interval_ms=2000

So that in order to fix this bug, update the timer interval of monitoring
when changing the thermal scenario information.

Change-Id: Ib909539ffac357d7a804f726ae43e61a7a044d60
Fixes: 6e9640753a86 ("thermal: Support dbus activation for thermal f/w")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agopass: resmon: Fix unneeded g_list_remove call when updating timer interval 93/224393/2
Chanwoo Choi [Mon, 10 Feb 2020 07:31:44 +0000 (16:31 +0900)]
pass: resmon: Fix unneeded g_list_remove call when updating timer interval

The commit 204e36c7c18a ("pass: resmon: Add new Resource Monitor (resmon)
module") added 'resmon_timer_add()' function which support two case as
following:
- case 1: Create timer with timer interval and add created timer to timer_list
- case 2: Update timer interval of already created timer in timer_list

In case 2, resmon_timer_add() had a bug about freeing resource because
don't need to remove a timer from 'resmon->timer_list' by using g_list_remove.

So that in order to fix this issue, do refactor the body of resmon_timer_add().

Change-Id: Iee76e42dd1eb92675e626d91e25f0672477fc3cc
Fixes: 204e36c7c18a ("pass: resmon: Add new Resource Monitor (resmon) module")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agounittest: pass_gtest: Use dbus defintion 85/223785/2 accepted/tizen/unified/20200207.122419 submit/tizen/20200206.041536
Chanwoo Choi [Tue, 4 Feb 2020 03:27:59 +0000 (12:27 +0900)]
unittest: pass_gtest: Use dbus defintion

The supported dbus path/interface were defined in gdbus-defintion.sh.
So that use the dbus defintion to remove the potential error.

Change-Id: Icebefcbb58a7d135eda873ed827ea7c2d50e59b3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agounittest: pass_gtest: Fix thermal monitor dbus path 84/223784/2
Chanwoo Choi [Tue, 4 Feb 2020 02:28:57 +0000 (11:28 +0900)]
unittest: pass_gtest: Fix thermal monitor dbus path

The commit a33200bbbe14 ("pass: Change DBUS interface of thermal monitor")
changed the Thermal Monitor dbus path/interface as following:
In order to support the unittest of Thermal Monitor, fix the thermal monitor
dbus path.

[Before]
DBUS_THERMAL_INTERFACE "org.tizen.system.pass.monitor.thermal"
DBUS_THERMAL_PATH      "/Org/Tizen/System/Pass/Monitor/Thermal"
[After]
DBUS_THERMAL_INTERFACE "org.tizen.system.thermal"
DBUS_THERMAL_PATH      "/Org/Tizen/System/Thermal"

Change-Id: I6adb48a167bd72b91ba495d099bfa32071ba2b5f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agoscripts: Allow telephony to send thermal method_call 29/223729/2 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20200204.125925 accepted/tizen/5.5/unified/wearable/hotfix/20201027.113049 accepted/tizen/unified/20200204.125807 submit/tizen/20200204.012547 submit/tizen_5.5/20200204.013653 submit/tizen_5.5_wearable_hotfix/20201026.184304
Dongwoo Lee [Mon, 3 Feb 2020 08:49:03 +0000 (17:49 +0900)]
scripts: Allow telephony to send thermal method_call

To allow callmgr to send method_call dbus interface for themal,
this patch adds dbus policy.

Change-Id: Ifd06ad37299f6acef32a90b107f15c5ec8119467
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agopass: pmqos: remove possible stringop-overflow 52/222052/1 accepted/tizen/unified/20200113.130640 submit/tizen/20200110.040829
Seung-Woo Kim [Thu, 9 Jan 2020 08:36:10 +0000 (17:36 +0900)]
pass: pmqos: remove possible stringop-overflow

When parsing and trimming qos scenario name, there can be possible
stringop-overflow. To remove possible overflow, copy string with
strncpy() and then cut 'Lock' or 'Unlock'. Also, remove function,
is_pmqos_locked(), called only once.

Change-Id: I95a4bcde662c3d8390fab0dd661c9ecc84eb407a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agopass: resmon: Remove unnecessary check in exit 34/222034/1
Seung-Woo Kim [Thu, 9 Jan 2020 07:37:46 +0000 (16:37 +0900)]
pass: resmon: Remove unnecessary check in exit

After monitor->result is null-checked and it is re-checked.
Remove the unnecessary check routine in resmon_cpuhp_exit().

Change-Id: I345a497fa67ba4ee0334c24327d2f7ea74dd7996
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agothermal: Fix incompatible-pointer-types 21/222021/1
Seung-Woo Kim [Thu, 9 Jan 2020 05:21:30 +0000 (14:21 +0900)]
thermal: Fix incompatible-pointer-types

After the commit 6e9640753a86 ("thermal: Support dbus activation
for thermal f/w"), function pointer for register_notifier() and
unregister_notifier() type is incompatible. Fix the warning by
casting inside the function.

Change-Id: Iebc590cc1d3d9a7adaca1a896f6313a225ddb6ca
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agounittest: pass_haltests: Remove dangling-else warnings 16/222016/3
Seung-Woo Kim [Thu, 9 Jan 2020 04:57:35 +0000 (13:57 +0900)]
unittest: pass_haltests: Remove dangling-else warnings

The ASSERT_EQ() macro internal has 'if' statement, so gcc9 gives
dangling-else build warnings for single 'if' statement without
braces before ASSERT_EQ(). Remove The build warnings by adding
explict braces.

Change-Id: I56d955c71c58d2fbd99a18f0983bb5af88cd430e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agoCMakeLists: Fix cmake warnings 18/222018/1
Dongwoo Lee [Thu, 9 Jan 2020 05:12:25 +0000 (14:12 +0900)]
CMakeLists: Fix cmake warnings

Since cmake version 3.1, variable reference policy is changed, and
'PREFIX' defined for refer '/usr/' directory cause warnings during
dealing with internal scripts like below:

#if defined(__VISUALDSPVERSION__)
    /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__VISUALDSPVERSION__>>24)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__VISUALDSPVERSION__>>16 & 0xFF)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__VISUALDSPVERSION__>>8  & 0xFF)
#endif'

To fix it, this changes to not use PREFIX as pre-defined variable no
longer.

Change-Id: Ie62509318b84075b8a03be0e806696b2837ecbd9
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agopass: Add PMQoS as supported module for nonstandard resource 63/212563/2 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv accepted/tizen/5.5/unified/20191031.022608 accepted/tizen/5.5/unified/mobile/hotfix/20201027.090409 accepted/tizen/unified/20190826.000114 submit/tizen/20190823.053814 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 tizen_5.5.m2_release
Dongwoo Lee [Fri, 23 Aug 2019 04:58:35 +0000 (13:58 +0900)]
pass: Add PMQoS as supported module for nonstandard resource

Since PMQoS is not supported for the nonstandard resource, these
resourced such as trm cannot receive PMQoS events. This patch adds
PMQoS as supported module for nonstandard resource in order to
handle relevant events.

Change-Id: I8377fb4cc1a6a0bf1df7029c9efbbd433a5806a7
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agothermal: Support dbus activation for thermal f/w 10/210610/6 accepted/tizen/unified/20190731.112548 submit/tizen/20190730.044254
Dongwoo Lee [Tue, 23 Jul 2019 02:07:11 +0000 (11:07 +0900)]
thermal: Support dbus activation for thermal f/w

Since resource monitoring first announce the temperature state a
single seconds later after all initialization over, to support dbus
activation for thermal f/w, temperature should be set during
initialization. To support this feature, current temprature is
retrived in advance while thermal is initialized, and it will be
announced before sd_notify called.

Change-Id: I83dae123a51fbdd953fe467ae408cae1a100c059
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agocore: sd_notify() when all dbus name is owned 09/210609/3
Dongwoo Lee [Thu, 18 Jul 2019 01:51:12 +0000 (10:51 +0900)]
core: sd_notify() when all dbus name is owned

If pass is waken-up by thermal method call, sd_notify() should be
called after all dbus name is successfully owned including thermal
dbus. To handle this case, this patch refactors name acquired event
callback.

Change-Id: I88549a81aaa38082c3d7e53c995d9f62145a6266
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agocore: Add support for dbus activation for thermal 27/210827/1
Dongwoo Lee [Thu, 18 Jul 2019 01:51:12 +0000 (10:51 +0900)]
core: Add support for dbus activation for thermal

To support dbus activation by not only pass core but also thermal,
this patch adds dbus activation support.

Change-Id: I50e13d43df9c775ae177a455805af41921f00286
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agothermal: Change order of initialization 08/210608/2
Dongwoo Lee [Fri, 19 Jul 2019 03:33:55 +0000 (12:33 +0900)]
thermal: Change order of initialization

To prevent race condition, dbus object should be registered before
well-known name is acquired. This patch changes order of initilizing
to fit this precondition.

Change-Id: I9fe60af8ed542155d26cc9c8a5f88eade3b38bb5
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agocore: Remove unnecessary parameter for booting_done event 07/210607/1
Dongwoo Lee [Thu, 18 Jul 2019 01:58:28 +0000 (10:58 +0900)]
core: Remove unnecessary parameter for booting_done event

Even the late activation process is removed since commit cdf2e4d1139c
("core: Remove late activation process"), the 'boot_done' state is
still passed as a parameter for INIT_DONE event. So, this patch
removes the unnecessary parameter.

Change-Id: I3b7bf1d6cba8080618fd486c7ab5c2db775ae7de
fixes: cdf2e4d1139c ("core: Remove late activation process")
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agocore: Apply systemd-based dbus activation 48/210148/3
Hyotaek Shim [Mon, 15 Jul 2019 06:13:35 +0000 (15:13 +0900)]
core: Apply systemd-based dbus activation

To activate PASS service immediately when other service requests the
dbus methods of it, this patch applies systemd-based dbus
activation. In addition, to announce PASS startup completion to
systemd, this patch adds notification through 'sd_notify()' call.
Without it, systemd will block PASS activation.

Change-Id: I4bfd6fce55d83aee646405af7bafbc650cb177e5
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agocore: Add name acquired event handler parameter to dbus name own API. 47/210147/3
Dongwoo Lee [Mon, 15 Jul 2019 08:07:00 +0000 (17:07 +0900)]
core: Add name acquired event handler parameter to dbus name own API.

To register handler for name acquired event for dbus name own process,
this patch adds it as parameter.

Change-Id: I91ffaf85100e49a80e9654a039ff544b37e210b4
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agocore: Remove late activation process 46/210146/3
Dongwoo Lee [Tue, 16 Jul 2019 01:43:41 +0000 (10:43 +0900)]
core: Remove late activation process

Since commit 239483e1b802 ("Rearrange pass.service into
delayed.target"), there is no need to wait until systemd become ready
because PASS is now delayed target service and thus it is guaranted
that systemd is always prepared while pass is initialized. So, late
activation for waiting systemd 'booting done' event is now unncessary.
This patch remove callbacks for the event and relevant functions.

Change-Id: I40a775af04ea4c00c7f39bbba5d73d8b59481d39
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agoRearrange pass.service into delayed.target 26/210026/1
Hyotaek Shim [Mon, 15 Jul 2019 05:55:31 +0000 (14:55 +0900)]
Rearrange pass.service into delayed.target

Change-Id: I520a77645fa93c7ec99bc16cfc5f161b57ab9cb3
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agopass: thermal: Add GetCoolDownStatus DBUS method 39/208239/2 accepted/tizen/unified/20190627.014836 submit/tizen/20190624.013748
Dongwoo Lee [Thu, 20 Jun 2019 06:20:37 +0000 (15:20 +0900)]
pass: thermal: Add GetCoolDownStatus DBUS method

This patch adds a new DBUS method for providing the current status of
CoolDownMode.

 Method description:
 - Destination: org.tizen.system.thermal
 - Path: /Org/Tizen/System/Thermal
 - Interface: org.tizen.system.thermal.GetCoolDownStatus
 - Parameter: IN: none, OUT: string

Change-Id: I89be8758bda57f265f4cb6a03c1a3d6d559aa2f4
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: thermal: add separate dbus for thermal monitor 91/206791/5 accepted/tizen/unified/20190530.043119 submit/tizen/20190528.074510
Dongwoo Lee [Thu, 23 May 2019 06:56:18 +0000 (15:56 +0900)]
pass: thermal: add separate dbus for thermal monitor

This patch adds separate dbus for thermal monitor, and it owns
well-know name as "org.tizen.system.thermal".

Change-Id: I5a4126e5debb597e7cdb2e722772a4966eb329e0
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: thermal: Prevent memory leakage 90/206790/2
Dongwoo Lee [Tue, 30 Apr 2019 04:11:39 +0000 (13:11 +0900)]
pass: thermal: Prevent memory leakage

To prevent memory leakage, free allocated memory on error case.

Change-Id: If0c94bc23e47eafff594afb435b909b544708ac3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: thermal: Correct thermal action names 00/206800/1
Dongwoo Lee [Mon, 27 May 2019 07:07:05 +0000 (16:07 +0900)]
pass: thermal: Correct thermal action names

This patch correct thermal action names in comments in order to match
into previous changes.

Change-Id: I7931ddc9dc42bf364cb9f020741d063402004c33
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agoModify pass.conf to add org.tizen.system.thermal 34/206634/4
Hyotaek Shim [Wed, 22 May 2019 08:37:04 +0000 (17:37 +0900)]
Modify pass.conf to add org.tizen.system.thermal

Change-Id: Idb32f28286f7a4aa8fb44539b0e818c6c711cee1
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agopass: Change DBUS interface of thermal monitor 74/203374/1
Dongwoo Lee [Thu, 11 Apr 2019 07:44:13 +0000 (16:44 +0900)]
pass: Change DBUS interface of thermal monitor

This patch changes DBUS interface as following thermal interface
standard like below:
 - Interface: org.tizen.system.thermal
 - Path: /Org/Tizen/System/Thermal
 - Broadcast name: CoolDownModeChanged

Change-Id: Iedf5a1d78536a10829d37e84fadae0e51706f886
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: core: Remove unused structure 73/203373/1
Dongwoo Lee [Thu, 11 Apr 2019 07:52:36 +0000 (16:52 +0900)]
pass: core: Remove unused structure

Since commit 261812a0492a, struct device_ops default_ops is not used
anymore. This patch removes it to prevent build warning.

Change-Id: I933adf899125ff0f6b078cffb06f7fd6d0ec99ca
Fixes: 261812a0492a ("core: Remove unneeded codesa")
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: pmqos: print int64_t type on 32/64bit architecture properly 29/195629/1 accepted/tizen/unified/20181217.142346 submit/tizen/20181217.034218
Dongwoo Lee [Mon, 17 Dec 2018 02:06:10 +0000 (11:06 +0900)]
pass: pmqos: print int64_t type on 32/64bit architecture properly

Since int64_t is translating into 'long long int' on 32bit, but
'long int' on 64bit. So, "%lld" cannot satisfying both architectures.
This patch uses PRId64 instead of "%lld" to adjust the format string
as following the corresponding architecture.

Change-Id: Iac0d14ac1ccff7b6fba187fc3205e2c81271727b
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: Fix type-check errors on dlog output 85/195285/3 accepted/tizen/unified/20181213.142312 submit/tizen/20181213.021117
Dongwoo Lee [Wed, 12 Dec 2018 07:12:06 +0000 (16:12 +0900)]
pass: Fix type-check errors on dlog output

Change-Id: Ib465e5b2a0f77ec81943bebcbd38d4e31a688172
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agothermal: Add explicit type casting for string output 84/195284/3
Dongwoo Lee [Wed, 12 Dec 2018 07:39:25 +0000 (16:39 +0900)]
thermal: Add explicit type casting for string output

Change-Id: Ide6cf245737097dc9907943a5b9c04ed1de8b4b7
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agogdbus: Remove meaningless parameter for error description 83/195283/3
Dongwoo Lee [Wed, 12 Dec 2018 07:37:53 +0000 (16:37 +0900)]
gdbus: Remove meaningless parameter for error description

Variable arg has Gvariant* type, but format string is not used properly.
Even it changed to %p properly, just print out address of Gvariant
structure has no meaning. So, this patch get rid of this unnecessary
information.

Change-Id: I54229953dfd66c3ff3219cb08d578472cd1ddb60
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: Fix wrong format string 17/195117/1 accepted/tizen/unified/20181213.065307 submit/tizen/20181212.005204
Dongwoo Lee [Tue, 11 Dec 2018 01:42:57 +0000 (10:42 +0900)]
pass: Fix wrong format string

Change-Id: I5f58009a26e4a29dbf0031c67981961f5fa1fd91
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agopass: Fix typo 72/194572/1
Suchang Woo [Tue, 23 Oct 2018 08:14:07 +0000 (17:14 +0900)]
pass: Fix typo

Change-Id: I5cce6c6c2a697e78a5871ad8482b1e1c66209293
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
5 years agoscripts: pmqos: Add default maximum duration value to keep scenario 70/191670/1
Chanwoo Choi [Fri, 19 Oct 2018 08:02:51 +0000 (17:02 +0900)]
scripts: pmqos: Add default maximum duration value to keep scenario

PMQoS keeps the scenario during the required duration.
But if the required duration is over than defined maximum duration,
PMQoS changes the required duration value by using the defined maximum
duration value. So, specify the default mamximum duration value of PMQoS.

Change-Id: Ieab7d6acfd4bd1cdfff7a2d730776441588b805d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agocore: Remove unneeded codes 69/191669/1
Chanwoo Choi [Fri, 19 Oct 2018 08:01:32 +0000 (17:01 +0900)]
core: Remove unneeded codes

Change-Id: I6bc9acdc601e9d9d0b1ac9885c7cf952cde2467f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopass: Fix coverity and svace reported issue 04/191604/1
Chanwoo Choi [Fri, 19 Oct 2018 02:43:04 +0000 (11:43 +0900)]
pass: Fix coverity and svace reported issue

Change-Id: Ic36b58d4cf04023d733360f30cb186bd3a57ce2e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopass: Replace obsolescent ato[if] functions with strto[ld] 03/191603/1
Chanwoo Choi [Thu, 18 Oct 2018 07:40:04 +0000 (16:40 +0900)]
pass: Replace obsolescent ato[if] functions with strto[ld]

Replace obsolescent ato[if] functions with recommended strto[ld]
according to codingy guide[1].

[1] https://wiki.sei.cmu.edu/confluence/display/c/MSC24-C.+Do+not+use+deprecated+or+obsolescent+functions

Change-Id: I23342d7312c1fe77b3734cb23b57948ceac7832b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopass: resmon: Fix potential NULL dereference value 02/191602/1
Chanwoo Choi [Thu, 18 Oct 2018 05:54:46 +0000 (14:54 +0900)]
pass: resmon: Fix potential NULL dereference value

Fix potential NULL dereference value by checking the returned value
from memory allocation functions.

Change-Id: I040f75a36f5ec904da45cd89633bba38e206f5ed
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: pass_gtest: Send start d-bus message before testing restart operation 01/191601/1
Chanwoo Choi [Mon, 1 Oct 2018 06:48:45 +0000 (15:48 +0900)]
unittest: pass_gtest: Send start d-bus message before testing restart operation

The unittest of PASS tests the 'restart' opertion. It assume that PASS is
already started before testing the unittest. In order to clarify the test
condition of 'restart' operation, make the state of PASS always start state.
So, send start d-bus message before testing restart operation.

Change-Id: I38eb1b75074c7b47b65665cb687f6be2e1cfc8ce
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: pass_gtest: Fix typo and remove unneed blank line 00/191600/1
Chanwoo Choi [Mon, 1 Oct 2018 06:39:19 +0000 (15:39 +0900)]
unittest: pass_gtest: Fix typo and remove unneed blank line

Change-Id: Id0bdbcff81f741e3e39ea97efab1057e83fcff4c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: pass_haltests: Remove unreached return statement and unneeded if statement 99/191599/1
Chanwoo Choi [Mon, 1 Oct 2018 00:36:00 +0000 (09:36 +0900)]
unittest: pass_haltests: Remove unreached return statement and unneeded if statement

ASSERT_EQ() macro is able to check the 'return value' and then if 'return value'
is less than zero, print error message and exit the unittest. It means that
the separate 'if statement' for checking 'return value' is not neeeded
when using ASSERT_EQ().

Also, when using ASSERT_EQ() macro, the unittest don't need to call
'return statement' because ASSERT_EQ() return right now if 'return value'
is error. So, remove unreached return statement.

Change-Id: I2808d033e669a021a5b53226bf44c91241640c9a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopass: Add detailed description for all modules with doxygen style 98/191598/1
Chanwoo Choi [Wed, 12 Sep 2018 07:13:32 +0000 (16:13 +0900)]
pass: Add detailed description for all modules with doxygen style

PASS(Power Aware System Serivce) provides the multiple modules like CPUHP,
PMQoS, Thermal Monitor and defines the various structure/enumeration.
In order to improve the readability and the understanding of each unit,
add the detailed description for all modules/functions/structures/enumerations
by using doxygen[1] style.

[1] http://www.doxygen.nl/

Change-Id: I0444a95fb31b7a1ac20c451dda16dcc8791ae30a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: pass_haltests: Change name of hal unit tests 97/191597/1
Chanwoo Choi [Mon, 10 Sep 2018 06:37:55 +0000 (15:37 +0900)]
unittest: pass_haltests: Change name of hal unit tests

Change name of hal unit tests in order to improve readability.

Change-Id: Idbe24227edb172a9965a017ab75cfac6b4993fe3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: pass_gtest: Change name of unit tests 96/191596/1
Chanwoo Choi [Mon, 10 Sep 2018 06:15:24 +0000 (15:15 +0900)]
unittest: pass_gtest: Change name of unit tests

Change the name of unit tests in order to improve the readability.

Change-Id: Ia18c511a36cbcf2e8c26cf0159901aaab3f32ff8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: Rename haltest binary from pass_hal_gtest to pass_haltests 39/186739/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.021359 accepted/tizen/unified/20180814.063323 submit/tizen/20180814.043415 submit/tizen_5.0/20181101.000004
Chanwoo Choi [Tue, 14 Aug 2018 04:23:10 +0000 (13:23 +0900)]
unittest: Rename haltest binary from pass_hal_gtest to pass_haltests

Change-Id: I1b22c4d34c09dfe21ebcd83d111d09f3bb571154
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: pass_hal_gtest: Modify path of systemctl command 33/185833/1 accepted/tizen/unified/20180808.063338 submit/tizen/20180803.032812
Chanwoo Choi [Fri, 3 Aug 2018 01:54:22 +0000 (10:54 +0900)]
unittest: pass_hal_gtest: Modify path of systemctl command

To prevent malicious binary by changing path of systemctl,
modify path of systemctl command with absolute path.

Change-Id: I6a7bc842d43f954ac3ac9a1a43684d4de7167155
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopass: rescon: Fix issue of init_level setting and remove unneeded pass_hotplug 07/185807/5
Chanwoo Choi [Thu, 2 Aug 2018 07:40:51 +0000 (16:40 +0900)]
pass: rescon: Fix issue of init_level setting and remove unneeded pass_hotplug

RESCON (Resource Controller) module changes the value h/w resource
according to 'init_level' property getting from each h/w resource
configuration. Even if RESCON always is initialized before CPUHP init,
RESCON depends on CPUHP in order to get the limited number of online CPU.

Fix issue of init_level setting during init step by getting
limited_min_cpu value without CPUHP module. And remove unneeded pass_hotplug.

Change-Id: If7f13a7197fe93b41c23688d49370631d6d76e5e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: pass_gtest: Use gdbus-definition.h to remove local definition 06/185806/3
Chanwoo Choi [Thu, 2 Aug 2018 07:23:00 +0000 (16:23 +0900)]
unittest: pass_gtest: Use gdbus-definition.h to remove local definition

Remove local dbus definition and then use gdbus-definition.h which
contains dbus path/interface definition. And changes the path of
systemctl command.

Change-Id: Ic5ec5b36b5c36f9580be93fdc38a53cb15894102
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agogdbus: Separate gdubs-definition.h from gdbus-util.h 05/185805/2
Chanwoo Choi [Thu, 2 Aug 2018 07:17:51 +0000 (16:17 +0900)]
gdbus: Separate gdubs-definition.h from gdbus-util.h

gdbus-util.h contains the gdbus helper function and dbus path/interface
definitions. Some PASS modules only require the dbus path/interface
definitions with gdbus helper function. So, separate gdubs-definition.h
from gdbus-util.h.

Change-Id: I587c728d3d594adc65778e77bf7933a17acde4c1
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopackaging: Add pass-unittest package 17/184817/6 accepted/tizen/unified/20180724.073356 submit/tizen/20180724.000537
Chanwoo Choi [Mon, 23 Jul 2018 09:38:39 +0000 (18:38 +0900)]
packaging: Add pass-unittest package

Add pass-unittest-* package contains 'pass_gtest' command binary
which tests the external d-bus interface.

Change-Id: Ic3a022a63fb5ab1001c1e14544a261f45613a7ec
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopackaging: Add pass-haltests package 16/184816/6
Chanwoo Choi [Mon, 23 Jul 2018 01:46:26 +0000 (10:46 +0900)]
packaging: Add pass-haltests package

Add pass-haltests-* package contains 'pass_hal_gtest' command binary
which tests the HAL(Hardware Abstract Layer) interface.

Change-Id: I29687b0021c8a6cfd1d1b97560a25fbb3be70e89
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: Add testcase to verify pass daemon 15/184815/6
Dongwoo Lee [Mon, 23 Jul 2018 09:36:58 +0000 (18:36 +0900)]
unittest: Add testcase to verify pass daemon

This patch adds unittest based on gtest test suite.

Change-Id: I72a346720b32eb5941b1af9e4afb46533356bd24
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agounittest: Add testcase to verify PASS HAL interface 14/184814/6
Chanwoo Choi [Wed, 18 Jul 2018 11:11:56 +0000 (20:11 +0900)]
unittest: Add testcase to verify PASS HAL interface

PASS provides HAL(Hardware Abstract Layer) interface for CPU/GPU/Bus/memory
h/w resources and so on. Add testcase to verify PASS HAL interface.

Change-Id: I2c229b13e303f46007e32cc39f559fb29d8e1b78
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 years agopass: hal: Fix error number from EINVAL to EPERM/ENODEV 13/184813/2
Chanwoo Choi [Fri, 20 Jul 2018 04:23:11 +0000 (13:23 +0900)]
pass: hal: Fix error number from EINVAL to EPERM/ENODEV

All HAL functions return '-EINVAL' error number when error happen.
It is necessary to return more correct error value. Return -EPERM value
if HAL(Hardware Abstract Layer) function is not supported according to
h/w resource type and return -ENODEV value if HAL function is not implemented
on HAL package.

Change-Id: I0b0da7429f38aa0362293275849a713e6020a763
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agohal: Move LOG_TAG definition to makefile to remove the duplicate 24/184524/1
Chanwoo Choi [Tue, 17 Jul 2018 09:38:21 +0000 (18:38 +0900)]
hal: Move LOG_TAG definition to makefile to remove the duplicate

Each log header file defines LOG_TAG. It defines LOG_TAG on Makefile
in order to remove the duplicate definitions.

Change-Id: I3b4b08008e259fe3a0c8257ffaad0f291666a0c4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoRemove unused macro and definitions from CMakeLists.txt 23/184523/1
Chanwoo Choi [Wed, 18 Jul 2018 05:42:04 +0000 (14:42 +0900)]
Remove unused macro and definitions from CMakeLists.txt

Change-Id: Ib69cb04851a28a646f9682eebae5587a361c00a0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agogdbus: Move dbus interface definition to one header file 22/184522/1
Chanwoo Choi [Thu, 17 May 2018 04:02:10 +0000 (13:02 +0900)]
gdbus: Move dbus interface definition to one header file

Move dbus interface definition to gdbus-util.h header file
and clean-up code as following:
- Rename dbus definition from PASS_DBUS_BUS_NAME to DBUS_CORE_BUS_NAME
- Use ARRAY_SIZE() macro and then remove unnecessary following definitions:
  : DBUS_CORE_I_NUM_SIGNALS
  : DBUS_PMQOS_I_NUM_SIGNALS

Change-Id: Ic3f78d84b353bfe382330366d10292711de8c5fa
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopackaging: Remove unused libpass.manifest file 43/184343/1
Chanwoo Choi [Tue, 17 Jul 2018 09:12:13 +0000 (18:12 +0900)]
packaging: Remove unused libpass.manifest file

Change-Id: I62564514c93b12f7211f37427207aa898e315092
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agocore: Remove unused helper functions 62/180962/1
Chanwoo Choi [Fri, 1 Jun 2018 01:25:46 +0000 (10:25 +0900)]
core: Remove unused helper functions

Change-Id: I70c130c7715dab70f11294547889022a44ff93ce
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopackaging: Remove unneeded package's dependency 87/178687/1 accepted/tizen/unified/20180516.065450 submit/tizen/20180514.060515
Chanwoo Choi [Fri, 11 May 2018 08:50:33 +0000 (17:50 +0900)]
packaging: Remove unneeded package's dependency

Change-Id: I7a641708123de7f02c68aa36685e8cb1fa1aed3c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: thermal: Fix issue during stop PASS daemon 39/178439/1 accepted/tizen/unified/20180510.134400 submit/tizen/20180510.070432
Chanwoo Choi [Thu, 10 May 2018 05:06:50 +0000 (14:06 +0900)]
pass: thermal: Fix issue during stop PASS daemon

thermal->state indicates the "thermal_support" property in the configuration.
If user doesn't want to use thermal monitor with "thermal_support=no",
thermal->state is 0 (PASS_OFF). It is not error when thermal->state is zero.
Just return zero value instead of error.

Change-Id: I04f76774afb3b811d56dc0ebfb3f0888541e649f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoRemove dependency of unneeded libtzplatform-config package 31/178331/2
Chanwoo Choi [Wed, 9 May 2018 10:23:15 +0000 (19:23 +0900)]
Remove dependency of unneeded libtzplatform-config package

Change-Id: Ifd1a7b230ebd138bd3e991221bb7d066a02d0d01
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoscripts: Fix dbus issue to get dbus well-known name 18/178418/1
Chanwoo Choi [Thu, 10 May 2018 04:04:07 +0000 (13:04 +0900)]
scripts: Fix dbus issue to get dbus well-known name

The commit 83052f4b42d5 ("scripts: Simplify the deny permission
for PASS dbus interface") causes the dbus deny issue such as AppLaunch
request. Fix dbus issue to get dbus well-known name.

Change-Id: Id20941500249e6b6c753730fde336aedce4cfbdf
Fixes: 83052f4b42d5 ("scripts: Simplify the deny permission for PASS dbus interface")
Suggested-by: Sanghyeok Oh <sanghyeok.oh@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoscripts: Simplify the deny permission for PASS dbus interface 60/177260/2 accepted/tizen/unified/20180430.072116 submit/tizen/20180427.074549
Chanwoo Choi [Wed, 25 Apr 2018 08:15:45 +0000 (17:15 +0900)]
scripts: Simplify the deny permission for PASS dbus interface

Prior to that PASS denies the each d-bus interface for pmqos/pass core.
Deny the parent dbus interface instead of each d-bus interface
when user is not root and unauthorized user.

Change-Id: I29a400178535222de637738d44e0269e0b282c72
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Remove duplicate free operation of monitor instance 42/174942/6 accepted/tizen/unified/20180410.063557 submit/tizen/20180409.024353
Chanwoo Choi [Wed, 4 Apr 2018 04:05:54 +0000 (13:05 +0900)]
pass: resmon: Remove duplicate free operation of monitor instance

Change-Id: Ibbaa488ec6d42e1f566ec9bab847411fed992ba0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: thermal: Add support of Thermal Monitor of each h/w resource 70/174370/7
Chanwoo Choi [Thu, 22 Mar 2018 10:57:07 +0000 (19:57 +0900)]
pass: thermal: Add support of Thermal Monitor of each h/w resource

In order to use Thermal Monitor, each h/w resource (e.g. CPU/GPU) monitors
the thermal information with timer-based and uevent-based resource monitors.

If the monitored temperature is included in the range of defined
thermal scenario, it send the notification to Thermal Monitor module.
The pass-thermal.c is the developerment for each h/w resource.

Change-Id: I0dbf77202e1c3d7bc54803b064c9d29d687b661b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: parser: Add support of thermal monitor for each h/w resource 69/174369/7
Chanwoo Choi [Thu, 22 Mar 2018 10:56:26 +0000 (19:56 +0900)]
pass: parser: Add support of thermal monitor for each h/w resource

In order to use/support Thermal Monitor, each h/w resource (e.g., CPU/GPU)
have to write the configuration such as thermal scenario name, temperature
and timer interval for each thermal scenario. Parse the property for
Thermal Monitor.

Change-Id: I3aa08bcfbbb037897fff42cfe24aabc732610e05
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: pmqos: Group the private data of PMQoS module into struct pmqos 68/174368/7
Chanwoo Choi [Thu, 22 Mar 2018 10:30:54 +0000 (19:30 +0900)]
pass: pmqos: Group the private data of PMQoS module into struct pmqos

PASS uses the 'scenario' expression which indicates the unique user-scnaerio
or the specific situation. 'struct pass_pmqos' is used to handle 'scenario'.

'struct pass_pmqos' is used on multiple modules and then it might have
both common variables and specific variables used on particular PASS module.

So, group the private data of PMQOS module into the 'struct pmqos'.

Change-Id: I65111779ecd2dca7ff2ecbc5ace1d6e16f1824c8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agothermal: Add new Thermal Monitor module 66/174366/7
Chanwoo Choi [Thu, 22 Mar 2018 09:34:13 +0000 (18:34 +0900)]
thermal: Add new Thermal Monitor module

PASS can monitor the various h/w resource such as CPU/GPU and so on.
The thermal information is one of them. Require the thermal monitoring
and then notify the meaningful data of thermal. So, Thermal Monitor
is required.

Thermal Monitor supports the configuration file in order to define
the thermal scenarios (e.g., ReleaseAction, ShutdownAction) according to
the user definition. It is very flexible to define the multiple thermal
scenarios. Thermal Monitor monitors the thermal information using
following two methods:
- uevent-based thermal monitoring (interrupt method)
- timer-baesd thermal monitoring (polling method)

[d-bus interface]
- d-bus interface: "org.tizen.system.pass.monitor.thermal"
- d-bus method : "thermal_scenario"
- configuration : /etc/pass/pass-thermal.conf

Change-Id: I63c138d33350f6e17f9ad9bb73bd837b4f2a278e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoscripts: Add pass-thermal.conf configuration 67/174367/6
Chanwoo Choi [Tue, 20 Mar 2018 06:29:31 +0000 (15:29 +0900)]
scripts: Add pass-thermal.conf configuration

Thermal Monitor is able to define the multiple scenario indicating
the thermal status. Thermal Monitor uses the defined scenarios
when reporting the current system status according to raw temperature.

pass-thermal.conf contains the supported scenarios of Themral Monitor.
It will be located in "/etc/pass/pass-thermal.conf"

Change-Id: I98e4a109b47f1a4d398dfbf1cc4cdb08efa596e7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agocore: gdbus: Add new gdbus function to send broadcast signal 64/174364/5
Chanwoo Choi [Tue, 20 Mar 2018 07:59:34 +0000 (16:59 +0900)]
core: gdbus: Add new gdbus function to send broadcast signal

Add new following new function in order to send broadcast signal
through d-bus interface:
- int pass_gdbus_send_broadcast_signal(char *path, char *interface,
char *method, GVariant *arg)

Change-Id: I4e08a984f234fb4557e94f446e2d0aea86afc768
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agocore: device-notifier: Add new DEVICE_NOTIFIER_THERMAL 63/174363/5
Chanwoo Choi [Thu, 22 Mar 2018 09:31:31 +0000 (18:31 +0900)]
core: device-notifier: Add new DEVICE_NOTIFIER_THERMAL

DEVICE_NOTIFIER_THERMAL is used to notify the thermal level.

Change-Id: I46e19f32b347ce70626876be5f8e8f7993795879
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agocore: device-notifier: Remove unused notifier definition 62/174362/5
Chanwoo Choi [Thu, 22 Mar 2018 08:02:45 +0000 (17:02 +0900)]
core: device-notifier: Remove unused notifier definition

DEVICE_NOTIFIER_POWER_OFF notifier definition is not used. Remove it.

Change-Id: I30ab609c55aa0f43b8b1a4fefcb6db2a716161a5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopmqos: Clean-up code and remove unnecessary function 61/174361/5
Chanwoo Choi [Wed, 28 Mar 2018 12:31:59 +0000 (21:31 +0900)]
pmqos: Clean-up code and remove unnecessary function

Clean-up code and just remove unnecessary get_methods_from_conf().

Change-Id: I158603675172f32d01151b7269a73ba69d002258
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Save updated timer interval 60/174360/1
Chanwoo Choi [Fri, 30 Mar 2018 06:52:57 +0000 (15:52 +0900)]
pass: resmon: Save updated timer interval

RESMON provides the update function of 'timer interval' on the runtime.
Should save the updated 'timer interval' value to 'struct resmon'.

Change-Id: Ice3deb34889343dfbcb555cb31fcfff37d6cf2a6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: cpuhp: Fix error when exiting the CPUHP module 12/172812/3
Chanwoo Choi [Fri, 16 Mar 2018 04:56:48 +0000 (13:56 +0900)]
pass: cpuhp: Fix error when exiting the CPUHP module

If resource configuration doesn't specify the use of CPUHP,
pass_cpuhp_init() have to be skipped. But, the commit eac3132aeb70 ("pass:
cpuhp: Replace legacy monitoring with RESMON (Resource Monitor)") didn't
handle it rightly. If CPU h/w resource doesn't use the CPUHP governor
(radiation or step cpuhp governor), have to skip the exit sequence of CPUHP.

Change-Id: I2c97873eebfa1e441807b615637786ebda5ed8b8
Fixes: eac3132aeb70 ("pass: cpuhp: Replace legacy monitoring with RESMON (Resource Monitor)
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Add uevent-based RESMON_SRC_THERMAL source 67/172667/4
Chanwoo Choi [Thu, 8 Mar 2018 11:00:30 +0000 (20:00 +0900)]
pass: resmon: Add uevent-based RESMON_SRC_THERMAL source

RESMON_SRC_THERMAL indicates the thermal monitoring for h/w resource
such as CPU, GPU and so on. The uevent-based RESMON_SRC_THERMAL uses
the uevent from kernel. When receving the uevent, RESMON_SRC_THERMAL
reads the temperature of h/w resource and then pass it to consumer
of resource monitor.

It is standard Linux Kernel interface which provides the thermal information
through thermal framework of Linux Kernel.

[Description of RESMON_SRC_THERMAL resource-monitor]
- The kind of resource data
: temperature of h/w resource (unit is centigrade)
: (e.g., 47000 means 47.0 degrees centigrade)

- The 'subsystem' name for uevent-based RESMON_SRC_THERMAL
: "thermal"

- Path of RESMON_SRC_THERMAL monitoring
: cat /sys/class/thermal/thermal_zone[X]/temp

- Result of RESMON_SRC_THERMAL monitoring
$ cat /sys/class/thermal/thermal_zone0/temp
47000

For exmaple on TM2 board,
: thermal_zone0 for ARM big core on TM2
: thermal_zone2 for ARM GPU on TM2
: thermal_zone3 for ARM LITTLE core on TM2

Change-Id: Ib66abc11b16c1e17084bc9b89e06c4fb81e6f897
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Add uevent-based resource monitor 66/172666/4
Chanwoo Choi [Tue, 13 Feb 2018 06:31:06 +0000 (15:31 +0900)]
pass: resmon: Add uevent-based resource monitor

Resource-Monitor provides two monitoring method as following:
- Timer-based resource monitor like polling method. There are both oneshot
  and periodic timer and it requires the interval as the mandatory.
- Uevent-based resource monitor like interrupt method. It notifies the result
  of monitoring when receiving the uevent from Kernel.

Add the support of uevent-based resource monitor which uses the libudev.h
library in order to handle the uevent from kernel.

[Function description]
- Uevent-based resource monitor
int pass_resmon_register_uevent()
int pass_resmon_unregister_uevent()

Change-Id: I3c9362298f5e096600989d5aaa2c6720346b9c5c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Initialize only supported module according to h/w resource 51/170451/4
Chanwoo Choi [Mon, 12 Feb 2018 06:12:12 +0000 (15:12 +0900)]
pass: Initialize only supported module according to h/w resource

PASS handlse the h/w resource such as CPU, BUS, GPU, Memory and so on.
Also, PASS provides the multiple module such as CPUHP, PMQoS, Rescon, Resmon
and Parser. All modules provided by PASS are not used for each h/w resource.

Each h/w resource must need to have the supported module list and then
initialize/exit the module according to the defined their own list.

Change-Id: I0453a7cb247fcd52fdd2f18953d7df1d1406114e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: rescon: Set default pass level when initializing RESCON 65/172665/2
Chanwoo Choi [Thu, 15 Mar 2018 01:00:11 +0000 (10:00 +0900)]
pass: rescon: Set default pass level when initializing RESCON

Before developed the RESCON (resource controller), CPUHP (cpu hotplug manager)
controls the level directly. CPUHP decides the next level and then ask them
to RESCON in order to control the h/w resource.

So, set default pass level when initializing RESCON in pass_resmon_init()
instead of CPUHP.

Change-Id: I0a8f86b7a781d4cf13e021f9a29537738a8fd70a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: cpuhp: Replace legacy monitoring with RESMON (Resource Monitor) 50/170450/4
Chanwoo Choi [Mon, 12 Feb 2018 05:06:54 +0000 (14:06 +0900)]
pass: cpuhp: Replace legacy monitoring with RESMON (Resource Monitor)

PASS CPUHP (CPU Hotplug Manager) module requires the CPU resource
monitoring in order to check the current system status and then
decide the optimal amount of CPU resource. It makes the balance
between the ondemand peformanace and required low-power consumption.

But, CPUHP used the legacy and too tightly coupled monitoring code.
So, replace the legacy method for resource monitoring with RESMON
(Resource Monitor). CPUHP will use the RESMON_CPUHP type instead of
old method.

Change-Id: I1dbbafceeb1c747383fdbfe0aa33c3e84fe02a68
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Add timer-based RESMON_SRC_THERMAL source 49/170449/4
Chanwoo Choi [Tue, 13 Feb 2018 13:34:01 +0000 (22:34 +0900)]
pass: resmon: Add timer-based RESMON_SRC_THERMAL source

RESMON_SRC_THERMAL indicates the thermal monitoring for h/w resource
such as CPU, GPU and so on. It is used to decide the current system status
like 'Low, Normal, High, Critical and Danger according to temperature of
h/w resource'. Also, other subsystems and user-processes can use
the temperature information.

It is standard Linux Kernel interface which provides the thermal infomation
through Thermal framework of Linux Kernel.

[Description of RESMON_SRC_THERMAL resource-monitor]
- The kind of resource data
: temperature of h/w resource (unit is centigrade)
: (e.g., 47000 means 47.0 degrees centigrade)

- Path of RESMON_SRC_THERMAL monitoring
: cat /sys/class/thermal/thermal_zone[X]/temp

- Result of RESMON_SRC_THERMAL monitoring
$ cat /sys/class/thermal/thermal_zone0/temp
47000

For exmaple on TM2 board,
: thermal_zone0 for ARM big core on TM2
: thermal_zone2 for ARM GPU on TM2
: thermal_zone3 for ARM LITTLE core on TM2

Change-Id: Ia6272621caea45a3c117d4d5bb9512ccafb9947a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Add timer-based RESMON_SRC_CPUHP source 48/170448/4
Chanwoo Choi [Tue, 13 Feb 2018 07:00:39 +0000 (16:00 +0900)]
pass: resmon: Add timer-based RESMON_SRC_CPUHP source

RESMON_SRC_CPUHP indicates the CPU resource monitoring for CPUHP (CPU Hotplug
Manager) module. RESMON_CPUHP contains the CPU's information. They are used
to decide the current system status on CPUHP.

Unfortunately, it is nonstandard linux kernel interface which is developed
for only CPUHP module. It should be replaced with standard linux kernel
interface on later.

[Description of RESMON_CPUHP resource-monitor]
- The kind of resource data
: time (time unit is millisecond)
: old CPU frequency (Minimum/Maximum is different accroding to h/w board)
: new CPU frequency (Minimum/Maximum is different accroding to h/w board)
: the number of nr_running tasks in the same cluster (100 means the one task)
: each CPU's utilization (Minimum is 0 and maximum is 100)

- Path of RESMON_SRC_CPUHP monitoring
: /sys/kernel/debug/cpufreq/cpu0/load_table

- Result of RESMON_SRC_CPUHP monitoring
$ cat /sys/kernel/debug/cpufreq/cpu0/load_table
Time(ms)   Old Freq(Hz) New Freq(Hz) NR_running CPU0 CPU1 CPU2 CPU3
3417690    500000       500000       300        10   4    0    0
3417770    500000       500000       182        10   4    0    0

Change-Id: Idcb3384e507f08aac282e0f0629a5666d7e0dd75
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Add resmon source's skeleton code 47/170447/3
Chanwoo Choi [Tue, 13 Feb 2018 07:17:16 +0000 (16:17 +0900)]
pass: resmon: Add resmon source's skeleton code

The RESMON (resource monitor) module will monitor the various h/w resource
such as CPU, GPU, Memory, Network, Filesystem and so on. Each h/w resource
requires the common monitoring API like timer hanlding function. Add resmon
source's skeleton code.

RESMON makes the following two files to implement ths resource monitor:
- pass-resmon.c : Implment pass_resmon_init/exit() and common monitoring API
  which are used for all resource monitoring. It contains the exported API of
  both timer-based and uevent-baed resource monitor.

- pass-resmon-impl.c : Implement the h/w resource monitoring through HAL
  (Hardware Abstract Layer). Each resource-monitor would collect the data of
  h/w resource with their own method. For example, some resource-monitor just
  reads the value from fixed sysfs interface. On the other hand, other
  resource-monitor parses the multiple data and then make the meaningfull data
  from raw data.

Change-Id: I1a83c8ead16e6cba48e5ce191d55b5bde497afae
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: resmon: Add new Resource Monitor (resmon) module 46/170446/3
Chanwoo Choi [Fri, 2 Feb 2018 05:14:28 +0000 (14:14 +0900)]
pass: resmon: Add new Resource Monitor (resmon) module

PASS required the resource monitoring in order to decide the current system
status. Even if it was required, PASS had not supported the separate
resource monitor module.

Add Resource Monitor (resmon) module to support the resource monitoring.
Other modules in PASS are able to use resmon in order to monitor/collect
the resource data such as frequency, utilization, file/memory's usage and so on.

Resource-Monitor provides two monitoring method as following:
- Timer-based resource monitor like polling method. There are both oneshot
  and periodic timer and it requires the interval as the mandatory.
- Uevent-based resource monitor like interrupt method. It notifies the result
  of monitoring when receiving the uevent. But, uevent-based resource monitor
  will be implemented on later.

[Function description]
- Timer-based resource monitor
int pass_resmon_update_timer_interval()
int pass_resmon_register_timer()
int pass_resmon_unregister_timer()

Change-Id: I4ec40f570fa0083a0fc22754174e63033cd99836
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: cpuhp: Remove possible null deference 21/172221/1 accepted/tizen/unified/20180313.061035 submit/tizen/20180313.020130
Seung-Woo Kim [Tue, 13 Mar 2018 01:49:02 +0000 (10:49 +0900)]
pass: cpuhp: Remove possible null deference

From cpuhp_governor_timer_cb(), it checks null value of res after
deference it. Remove the possible null deference.

Change-Id: I236d93ec9829f4019fd25f7d6f16fa2d77f6761e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopass: Remove inclusion of unneeded header file 45/170445/2
Chanwoo Choi [Mon, 12 Feb 2018 06:12:43 +0000 (15:12 +0900)]
pass: Remove inclusion of unneeded header file

PASS core doesn't call the exported API of resource-controller module
except for init/exit().

Change-Id: I2ed6e5cb7032c9a70a5190e8c28c6af3c5205bfa
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoRemove unnecessary CREDITS 30/170930/1
Chanwoo Choi [Tue, 13 Feb 2018 07:22:35 +0000 (16:22 +0900)]
Remove unnecessary CREDITS

CREDITS includes the developer's information. But it is not necessary.
Can check the contributor through git log. Also, CREDITS is not standard format.

Change-Id: I9554918fae7b393c51bafa37ac41eea7e96f5193
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Remove unreachable code of dbus_cb_core_stop() 05/170405/1 accepted/tizen/unified/20180221.061150 submit/tizen/20180221.002730
Chanwoo Choi [Tue, 20 Feb 2018 01:33:04 +0000 (10:33 +0900)]
pass: Remove unreachable code of dbus_cb_core_stop()

The pass_exit_done() always returns zero. It means that pass_exit_done()
doesn't need to return any value and it makes the unreachable code of
dbus_cb_core_stop(). Replace return type from int to void of pass_exit_done()
to remove unreachable code of dbus_cb_core_stop().

Change-Id: Ia6ee0bc8b85719e396714454f3b3cc452020b37e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: cpuhp: Remove unnecessary struct pass_freq_policy and level_up_threshold 44/169044/2
Chanwoo Choi [Fri, 2 Feb 2018 04:39:40 +0000 (13:39 +0900)]
pass: cpuhp: Remove unnecessary struct pass_freq_policy and level_up_threshold

Remove unnecessary struct pass_freq_policy and level_up_threshold.
Instead, add max_freq which contains the maximum frequency among PASS's levels
to struct pass_cpuhp. The max_freq is used to calculate the busy cpu on CPUHP's
governor.

Change-Id: I3cab9c13baa927cf0ecd5a9220ba8ab8c8db30dd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: cpuhp: Replace 'governor' with 'cpuhp' expression 43/169043/2
Chanwoo Choi [Fri, 2 Feb 2018 04:26:37 +0000 (13:26 +0900)]
pass: cpuhp: Replace 'governor' with 'cpuhp' expression

PASS uses 'CPUHP' indicating 'CPU Hotplug Manager' module.
'governor' is too abstract and old expression. Replace 'governor'
with 'cpuhp' expression in order to improve the readability.

Change-Id: Ib7c6509e200cd7603739bace6bcf913bea22475b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: pmqos: Remove unneeded header file of PMQoS 32/169032/2
Chanwoo Choi [Fri, 2 Feb 2018 01:37:24 +0000 (10:37 +0900)]
pass: pmqos: Remove unneeded header file of PMQoS

PMQoS's init/exit functions are only called in the PASS core (pass.c).
It means that these functions are not library. Remove header file
of PMQoS module and then uses the 'extern' to call PMQoS's init/exit functions.

Change-Id: I37abc63dadf55402c3f30a316102c604b899d8b8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: rescon: Set init_level for init step to write the required level 42/169042/1
Chanwoo Choi [Fri, 2 Feb 2018 03:53:52 +0000 (12:53 +0900)]
pass: rescon: Set init_level for init step to write the required level

The existing exported pass_rescon_set_level() controls the level
if required new level is different from current level. But, the init step
of ResCon (Resource Controller) always have to set the init_level
according to each resource's configuration file.

To support following two cases, add internal rescon_set_level() function
which doesn't check the available range of required level. Define internal
function instead of adding new exported function or changing the defintion
of existing function.
- case1: Change PASS level always if required.
- case2: Change PASS level if current level is different from required level.

Functions to control the h/w resource by PASS level.
- exported function : pass_rescon_set_level ()
- internal function : rescon_set_level ()

Change-Id: I912f8fbc5465f622a1191880e759f469477d6169
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: rescon: Move initialization code to guarantee the independnecy 31/169031/2
Chanwoo Choi [Fri, 2 Feb 2018 00:54:02 +0000 (09:54 +0900)]
pass: rescon: Move initialization code to guarantee the independnecy

Each module have to initialize/control their own variables
included in module structure. Move initialization code of ResCon
(Resource Controller) from pass.c/pass-gov.c to pass-rescon.c
in orer to guarantee the independnecy among modules.

Change-Id: I4568e2bfe3c6b6ba37b0161dce802bbcef4d6ba6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>