Chanwoo Choi [Wed, 25 Nov 2020 05:43:30 +0000 (14:43 +0900)]
pmqos: Edit the unproper expression of pmqos data structure
The pmqos module supports the multiple h/w resources like CPU, GPU, bus
and memory. In order to express the correct meaning, edit the unproper
expression of pmqos data structure from 'pmqos_cpu' and 'pmqos_data'
and change the local variable name from 'cpu' to 'pmqos'.
Change-Id: I25151a22b417c697b74758c531c5d11ab15e5430
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 28 Apr 2020 01:07:23 +0000 (10:07 +0900)]
PASS v1.1.0
In order to support 'scenario pass_level', the format of pass configuration
are changed. It affects the pass-hal packages. So, it needs to increse
the version up to prevent the confusion between pass and pass-hal packages.
- Changes from v1.0.0
1. Support 'scenario' pass_level' for PMQoS and Thermal Monitor
2. Support 'scenario' with maximum duration and 'mode' without maximum duration
3. Add new 'SetScenario' method
- org.tizen.system.pass.pmqos.SetScenario
4. Add new 'Doze' mode
Change-Id: I429e79171a22f7e1ce7b3248e04a0e1e1fe33f82
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 7 Aug 2020 04:08:23 +0000 (13:08 +0900)]
scripts: pmqos: Add new Doze mode
Add new Doze scenario which handles h/w resources like CPU frequency
when right after LCD off and before entering the suspend-to-RAM
for reducing the idle power-consumption.
[How to hanel 'Doze' mode]
- Enable 'Doze' mode
dbus-send --system --type=method_call --print-reply --reply-timeout=5000 \
--dest=org.tizen.system.pass /Org/Tizen/System/Pass/Pmqos \
org.tizen.system.pass.pmqos.SetScenario \
string:Doze int32:1;
- Disable 'Doze' mode
dbus-send --system --type=method_call --print-reply --reply-timeout=5000 \
--dest=org.tizen.system.pass /Org/Tizen/System/Pass/Pmqos \
org.tizen.system.pass.pmqos.SetScenario \
string:Doze int32:0;
Change-Id: I536acbb36f663e4ad0ffa474f0a0981351428f0e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 7 Aug 2020 02:16:25 +0000 (11:16 +0900)]
pmqos: Add support of 'mode' like UltraPowerSaving
Priot to that support only 'scenario' with the maximum duration time
in order to prevent the misuse of scenario from client. Additionally,
'mode' is required to change the system status until receiving
the unlock request without any maximum duration time.
So, make 'max_duration_ms' property optional. If some scenario in
/etc/pass/pass-pmqos.conf' don't have the 'max_duration_ms' property
it considers the 'mode'.
Difference of both scenario and mode as following:
1. 'scenario' with the maximum duration time like AppLaunch
- Lock case
a. Client send dbus signal with both 'scenario' name and duration
- Unlock case
a. Client send dbus signal with both 'scenario' name and 0
a. When timer with specific duration from client is expired,
unlock scenario automatically.
a. When timer with maximum duration is expired,
unlock scenario automatically.
2. 'mode' without any duration time like UltraPowerSaving
- Lock case
a. Client send dbus signal with both 'mode' name and 1
- Unlock case
a. Client send dbus signal with both 'mode' name and 0
Change-Id: I02cac0820b3085f7046689aecf8dc679f5f381c4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 6 Aug 2020 09:57:01 +0000 (18:57 +0900)]
pmqos: Add new SetScenario method for pmqos dbus interface
When add new scenario to pmqos, it have to edit the code.
It is not extensible. In order to improve the extensiblity
without code changes, add new SetScenario method for pmqos dbus interface
as following: When need to add new scenario, just add new scenario info.
to scripts/pass-pmqos.conf (/etc/pass/pass-pmqos.conf) without any code
changes.
[Interface for new SetScenario method of pmqos dbus]
- dbus interface : org.tizen.system.pass.pmqos.SetScenario
- parameter 1: scenario name like AppLaunch
- parameter 2: duration time like 3000 means 3 second
Change-Id: I5ee8da4ec62a9cf1d55ea51f6c7fb8ca9ce7b9e7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 6 Aug 2020 09:14:27 +0000 (18:14 +0900)]
pass: Adjust indentation to show current resource statues for readability
Adjust indentation to show current resource statues and remove unneeded
blank line for readability. And remove unneeded comment and blank line.
Change-Id: Ibb2e660374626b942a2dd14c3bdb59caa5725162
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 6 Aug 2020 08:40:28 +0000 (17:40 +0900)]
pmqos: Set max_duration_ms for each scenario
Until now, only support global max_duration_ms time. But, if each scenario
need to set the different maximum duration time, it is not supported.
Allow each scenario to set the default maximume duration time.
Change-Id: I6f294ab55d2157c251593c300cb04eefb598b751
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 7 Aug 2020 06:22:56 +0000 (15:22 +0900)]
pmqos: Fix issue when the part of scenario name is same with supported scenario
If the part of scenario name sent from client is same with among
the supported scenario name, strncmp() causes the issue.
In order to fix this issue, compare the full scenario name with strcmp():
Change-Id: Ibc712b0b4be2cb752506ac7094b27abd88e587b5
Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 7 Aug 2020 06:03:47 +0000 (15:03 +0900)]
pmqos: Fix wrong unlocked issue when pmqos list contains only one scenario
The pmqos list contains only one scenario like UltraPowerSaving
and when receiving the unmated scenario name like AppLaunch with unlock info
with that duration is zero, the last scenario will be unlocked.
In order to fix this issuse, correct the conditional statement.
Change-Id: Ica2a3a3f44d02dfd07e3cb57e1dab300decee9d0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 4 Aug 2020 02:05:41 +0000 (11:05 +0900)]
scripts: dbus: Allow root to use d-bus interface
Allow 'root' to use d-bus interface provided by PASS.
The 'root' have to control all d-bus interface without any restrictions.
Change-Id: I18d467f2745741c7c4b990b64210dfd16692d39c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 24 Feb 2020 11:05:21 +0000 (20:05 +0900)]
pass: parser: Clean-up code to remove warning from static code analyzer
Change-Id: I627fc5e55497a34b318273bbb06af2664cdc2b03
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 11 Feb 2020 07:49:47 +0000 (16:49 +0900)]
pass: parser: Rename parser API for the readability
Rename all parser API from "pass_*()" to "pass_parser_*()"
to improve the readability.
Change-Id: Iade47afa9463093698612bb2d81004ae918695f9
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 12 Feb 2020 09:05:47 +0000 (18:05 +0900)]
pass: hal: Rename HAL API for the readability
Rename all HAL API from "pass_*()" to "pass_hal_*()" to improve the
readability. Usually, PASS modules used their own prefix on function name
like 'pass_resmon_*', 'pass_rescon_*'. After that, anyone can know
the kind of PASS module of functions.
Change-Id: I275fc6154eeab2af1d0e6755c3e6ceae762548b6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 12 Feb 2020 08:59:54 +0000 (17:59 +0900)]
pass: thermal: Change local variable name for readability
Change local variable name for readability as following
without any behavior changes:
- curr_temp -> new_temp which is the measured temperature
- timer_interval -> new_timer_interval of new thermal scenario
- scenario -> new_scenario which is instance of new thermal scenario
- scenario_idx -> new_scenario_idx which is index of new thernal scenario
- timer_interval_of_scenario is removed due to unneeded
Change-Id: Ie9fed6c3be9e3ad490c2d0eec3a02c839ab6be7d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 11 Feb 2020 12:45:12 +0000 (21:45 +0900)]
pass: thermal: Add support for scenario_level for thermal scenario
Prior to that thermal monitor has been monitoring the temperature
and then decide current thermal scenario like 'Release', 'Warning'.
And send the broadcast dbus message to inform the current thermal scenario
to otther Tizen framework. It didn't support to change the value
of the h/w resource like frequency, the number of online CPU.
Finally, thermal monitor is able to change the value of h/w resource
according to their own 'scenario_level' value on each thermal scenario.
For example with following configuration example,
- If thermal monitor decide the current thermal scenario as 'Release',
'Release' sceanrio has 'scenario_level=0'. It means that set 'ScenarioLeve0'.
It allow max_freq as 1.3GHz and max_cpu as 4 core.
- If thermal monitor decide the current thermal scenario as 'Warning',
'Warning' sceanrio has 'scenario_level=2'. It means that set 'ScenarioLeve2'.
It allow max_freq as 768MHz and max_cpu as 2 core.
This feature is important for preventing the dangerous overheating of h/w
target and it is very easy to tune up the configuration of thermal monitor
by editing the configuration files under '/etc/pass' path.
[Example of configuraiton file for CPU h/w resource]
(snip)
[ScenarioLevel0]
limit_min_freq=768000
limit_max_freq=1300000
limit_min_cpu=0
limit_max_cpu=4
[ScenarioLevel2]
limit_min_freq=768000
limit_max_freq=768000
limit_min_cpu=0
limit_max_cpu=2
(snip)
[thermal.scenario0]
support=yes
name=Release
temperature=25
timer_interval_ms=5000
scenario_level=0 <- It means 'ScenarioLevel0' is used for 'Release'.
Allow max_freq as 1.3GHz and max_cpu as 4 core.
[thermal.scenario1]
support=yes
name=Warning
temperature=30
timer_interval_ms=3000
scenario_level=2 <- It means 'ScenarioLevel2' is used for 'Warning'.
Allow max_freq as 768MHz and max_cpu as 2 core.
Change-Id: I3a5ff802e68f1452e90d766cfe1f04b4554413fd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 28 Jan 2020 05:47:44 +0000 (14:47 +0900)]
pass: rescon: Add support for multiple 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 scenarios 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)_freq),
the minimum/maximum number of online CPU (limit_(min|max)_cpu)
and fault_around_bytes for memorh h/w resource.
In order to support the multiple scenario pass_level at the same time,
RESCON (Resource Controller) module adds new following functions and then
delete previous function.
PMQoS will use new functions for supporting the 'scenario pass_level'
and Thermal Monitor will use the new functions for 'scenario pass_level'
for constrainting the h/w resouece to prevent the dangerous overheating.
[Added new functions]
- int pass_rescon_sync(struct pass_resource *res);
- int pass_rescon_set_level_sync(struct pass_resource *res, int level);
- int pass_rescon_set_scenario_level_sync(struct pass_resource *res,
int scenario_level);
- int pass_rescon_unset_scenario_level_sync(struct pass_resource *res,
int scenario_level);
- int pass_rescon_set_scenario_level(struct pass_resource *res,
int scenario_level);
- int pass_rescon_unset_scenario_level(struct pass_resource *res,
int scenario_level);
[Deleted functions]
- int pass_rescon_set_level_scope(struct pass_resource *res, int new_level,
int min_level, int max_level, void *data);
[Deprecated functions. Because these functions are keeping
for the compatibility with legacy feature. It should be used on PMQoS module.]
- int pass_rescon_set_scenario_level_sync_with_data(struct pass_resource *res,
int scenario_level, void *data);
- int pass_rescon_unset_scenario_level_sync_with_data(struct pass_resource *res,
int scenario_level, void *data);
[Exmaple of multiple scenario pass_level on PMQoS and Thermal Monitor modules]
Case 1. AppLaunch scenario of PMQoS ,
- 'AppLaunch' scenario contains 'scenario_level=1' property as following:
[ScenarioLevel1]
limit_min_freq=1300000
limit_max_freq=1300000
limit_min_cpu=3
limit_max_cpu=4
- In result, RESCON (Resource Controller) set h/w resource as following:
The minimum frequency is 1300MHz.
The maximum frequency is 1300MHz.
The minimum number of online CPU is 3.
The maximum number of online CPU is 4.
-> It maintains 1300MHz and three online CPU.
Case 2. Warning scenario of Thermal Monitor,
- 'Warning' scenario contains 'scenario_level=2' property as following:
[ScenarioLevel2]
limit_min_freq=768000
limit_max_freq=1000000
limit_min_cpu=0
limit_max_cpu=2
- In result, RESCON (Resource Controller) set h/w resource as following:
The minimum frequency is 768MHz.
The maximum frequency is 1000MHz.
The minimum number of online CPU has no any constraint.
The maximum number of online CPU is 2.
-> It maintain 768MHz and doesn't turn on more than 2 CPU.
Case 3. AppLaunch scenario of PMQoS + Warning scenario of Thermal Monitor,
- 'AppLaunch' scenario contains 'scenario_level=1' property and
'Warning' scenario contains 'scenario_level=2' property as following:
[ScenarioLevel1]
limit_min_freq=1300000
limit_max_freq=1300000
limit_min_cpu=3
limit_max_cpu=4
[ScenarioLevel2]
limit_min_freq=768000
limit_max_freq=1000000
limit_min_cpu=0
limit_max_cpu=2
- In result, RESCON (Resource Controller) set h/w resource as following:
The minimum frequency is 1000MHz because MAX(1300000, 768000) cannot be
over thatn maximum frequency (1000MHz).
The maximum frequency is 1000MHz.
The minimum number of online CPU is 2.
The maximum number of online CPU is 2.
-> It maintain 1000MHz and doesn't turn on more than 2 CPU.
[ScenarioLevel0]
limit_min_freq=768000
limit_max_freq=1300000
limit_min_cpu=0
limit_max_cpu=4
[ScenarioLevel1]
limit_min_freq=1300000
limit_max_freq=1300000
limit_min_cpu=3
limit_max_cpu=4
[ScenarioLevel2]
limit_min_freq=768000
limit_max_freq=1000000
limit_min_cpu=0
limit_max_cpu=2
[PassScenario]
pass_scenario_support=yes
pass_num_scenarios=1
[Scenario0]
name=AppLaunch
support=yes
scenario_level=1 <- It indicates 'ScenarioLevel1' for AppLaunch scenario.
[thermal]
thermal_support=yes
thermal_number_of_scenario=2
thermal_timer_interval_ms=5000
[thermal.scenario0]
support=yes
name=Release
temperature=25
timer_interval_ms=5000
scenario_level=0
[thermal.scenario1]
support=yes
name=Warning
temperature=30
timer_interval_ms=3000
scenario_level=2 <- It indicates 'ScenarioLevel2' for Warning scenario.
Change-Id: I45e99b1794b85342f29bf0decec6a859f56f8f58
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>