platform/core/system/pass.git
6 years agopass: pmqos: Separate PMQoS's code from pass-gov.c (cpu hotplug) 01/168801/1
Chanwoo Choi [Mon, 29 Jan 2018 08:16:06 +0000 (17:16 +0900)]
pass: pmqos: Separate PMQoS's code from pass-gov.c (cpu hotplug)

PASS supports CPUHP (CPU hotplug manager) and PMQoS features until now.
The pass-gov.c contains the CPU hotplug manager feature and a little
of PMQoS's code. In order to remove the tightly coupled code,
move PMQoS's code from pass-gov.c to pass-pmqos.c.

Change-Id: I2811414fbe99cea04d9f111dc61ec0a2e05cb21c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoRemove dependency of unused packages 07/168507/2
Chanwoo Choi [Mon, 29 Jan 2018 06:14:11 +0000 (15:14 +0900)]
Remove dependency of unused packages

Remove the package dependency from PASS because they are not used.
- vconf, device-node, capi-base-common and eventsystem

Change-Id: I207b65070d979db917ce7aea730995ee795a46de
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoRemove unneeded README.error.code file 06/168506/1
Chanwoo Choi [Mon, 29 Jan 2018 00:25:39 +0000 (09:25 +0900)]
Remove unneeded README.error.code file

Change-Id: Iedcfaf37a3418710e3928848a7a975edca0fc3b9
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Replace pass_main() with main() expression 05/168505/1
Chanwoo Choi [Mon, 29 Jan 2018 00:29:20 +0000 (09:29 +0900)]
pass: Replace pass_main() with main() expression

PASS doesn't define the pass_main(). Instead, main() function name
is correct. Replace pass_main() with main() expression.

Change-Id: I6ff03c1069e452a0c7af75495ff9d8d08d4ccbea
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Remove unused script from makefile 41/168341/1
Seung-Woo Kim [Fri, 26 Jan 2018 02:04:37 +0000 (11:04 +0900)]
pass: Remove unused script from makefile

Except for pass-hal-devel package, PASS doesn't make the devel package
including the header file and library. Remove unused script related to
installing the header file.

Change-Id: Ic9b24b7f81319c0e55e70620f4dea847ecbafbf3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[cw00.choi: Apply patch and write the patch description]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Remove example code for hal implementation 38/168338/1
Chanwoo Choi [Fri, 26 Jan 2018 01:24:18 +0000 (10:24 +0900)]
pass: hal: Remove example code for hal implementation

Remove example code for hal implementation because example is not updated
constantly and pass-hal-standard.git has the well-made hal implementation
for all h/w resources which are controlled in PASS framework.

[1] https://git.tizen.org/cgit/platform/adaptation/pass-hal-standard/

Change-Id: I3ceb46aecfd11abebf2055d32e865e67d5bb7471
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Make include directory containing the exported header files 35/168335/1
Chanwoo Choi [Fri, 26 Jan 2018 00:57:48 +0000 (09:57 +0900)]
pass: Make include directory containing the exported header files

Existing *.[ch] files uses the following type in order to include
the header file which is located in the outside directory. But it is
not proper method for including the header file.
- #include "core/*.h:

Make 'include' directory containing the all exported header files
and move the exported header files under 'include/' as following:
- src/core/*.h   -> include/pass/log.h
- src/shared/*.h -> include/pass/*.h
- src/hal/hal.h  -> include/pass/hal/hal.h

Change-Id: I68f6ad4c711b50a1d48bee3785d5657a8b58c963
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Remove inefficient local variables 34/168334/1
Chanwoo Choi [Thu, 25 Jan 2018 23:58:40 +0000 (08:58 +0900)]
pass: hal: Remove inefficient local variables

Almost PASS hal function defines the 'res_type' and 'res_name'
local variables. It is not efficient method. Use the variable
of struct pass_resource directly instead of defining the separate
local variables on each hal functions.

Change-Id: Ia6719d65639777a4d90df0326adb0e2c66807e85
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Remove duplicate header file 33/168333/1
Chanwoo Choi [Thu, 25 Jan 2018 08:11:07 +0000 (17:11 +0900)]
pass: hal: Remove duplicate header file

Remove the duplicate hal/hal.h header file because pass/pass-hal.h
already includes the hal/hal.h header files.

Change-Id: I06f6b26835c9efcd663074d502d9f431ddb9422f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: parser: Clean-up internal parsing functions to improve readability 32/168232/5
Chanwoo Choi [Thu, 25 Jan 2018 02:47:06 +0000 (11:47 +0900)]
pass: parser: Clean-up internal parsing functions to improve readability

Clean-up the internal parsing functions to improve the readability
and consider the extensibility because 'parse_level' and 'parse_scenario'
will be used on other features. Describe what are modified as following:
- Remove 'pass_' prefix from internal function
- Rename from check_compatible() to compare_compatible_name()
- Split out parse_scenario() function from parse_pmqos()
- Remove unneeded strlen() in the compare_compatible_name()
- Remove unnedded semiconlon from switch statement

[Detailed description of internal functions]
- parse_core(): Parse 'Pass' section including info of CPUHP feature
- parse_pmqos(): Parse 'PassScenario' section including info of PMQoS feature
- parse_level(): Parse 'Level' section including info of each scenario
- parse_scenario(): Parse 'Scenario' section including info of each level

Change-Id: Ibc3d8a3a546b322ec610a5f84646ae46e545641c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: parser: Clean-up exported parsing function to improve readability 31/168231/1
Chanwoo Choi [Thu, 25 Jan 2018 01:49:46 +0000 (10:49 +0900)]
pass: parser: Clean-up exported parsing function to improve readability

Clean-up exported parsing function in order to improve readability and
keep the consistency. Describe the detailed clean-up as following:
- Reorder exported functions into pass-parser.c
- Change the function name to improve readability and keep the consistency
  like pass_get/put_resource_config() as following:
  pass_get_table() -> pass_get_each_resource_config()
  pass_put_table() -> pass_put_each_resource_config()
- Modify argument name from 'path_conf_path' to 'path'

Change-Id: Ic8d517855c95e1a29ba5d6e4b62693c7b150e223
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: parser: Simplify parsing function of 'Level' section 30/168230/1
Dongwoo Lee [Thu, 25 Jan 2018 00:34:13 +0000 (09:34 +0900)]
pass: parser: Simplify parsing function of 'Level' section

The pass_parse_level() function is used for parsing 'Level%d' section.
Simplify the function's definition as following. Now, PASS uses the 'level'
concept which indicating the basic unit in order to initialize the h/w resource.
In the next time, PASS will use both 'global level' and 'local level' concept.
The changed pass_parse_level() is better to support both 'global level' and
'local level'.

[Before]
- pass_parse_level(struct parse_result *result, void *user_data, int level)
[After]
- pass_parse_level(struct parse_result *result, struct pass_level level)

Change-Id: Ib98b419d14e46f36de559b0f2b32c9fe63fc5bf4
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
[cw00.choi: Apply dongwoo's patch and document the description]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: gov: Fix bug for governor state of each h/w resource 18/164618/2 accepted/tizen/unified/20171221.071205 submit/tizen/20171220.053323
Chanwoo Choi [Wed, 20 Dec 2017 04:47:22 +0000 (13:47 +0900)]
pass: gov: Fix bug for governor state of each h/w resource

The commit 6133e7040ab49 ("pass: gov: Move private structure
from pass.h to pass-gov.h") moved the 'gov_state' variable
from 'struct pass_policy' to 'struct pass_governor'. It was wrong
because each pass_policy should contain the their own state of governor.
So, this patch moves the 'gov_state' variable to the 'struct pass_policy'.

Change-Id: I840c3ccf727ede1fc94de489b13c1703dc0d5d57
Fixes: 6133e7040ab49 ("pass: gov: Move private structure from pass.h to pass-gov.h")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Fix wrong format string of variables in struct pass_cpu_stats 97/164597/1
Chanwoo Choi [Wed, 20 Dec 2017 01:55:00 +0000 (10:55 +0900)]
pass: hal: Fix wrong format string of variables in struct pass_cpu_stats

This patch fixes the wrong format string of variables in the
struct pass_cpu_stats from "%d" to "%u" because variables are
unsigned integer.

Change-Id: Iff5fceccd641a8146667e66322538464871f0e43
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Fix wrong format string of stat.load variable 96/164596/1
Jinhee Choi [Wed, 20 Dec 2017 01:52:30 +0000 (10:52 +0900)]
pass: hal: Fix wrong format string of stat.load variable

This patch fixes the wrong format string of stat.load variable
from "%d" to "%u" because stat.load[] variable is unsigned integer.

Change-Id: Ic8d28782b36690242a3503f6967e9fd8bf550f11
Signed-off-by: Jinhee Choi <jh106.choi@samsung.com>
[cw00.choi: Add the patch description'
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Replace struct pass_policy to pass_resource for representing h/w resource 40/163440/3
Chanwoo Choi [Mon, 6 Nov 2017 01:47:24 +0000 (10:47 +0900)]
pass: Replace struct pass_policy to pass_resource for representing h/w resource

The commit 86cd810d6e1ae ("pass: Add new helper function to handle
the h/w resource through hal interface") introduced the 'struct pass_resource'
which represents the each h/w resource such as CPU/GPU/BUS, memory and so on.

Before applied commit 86cd810d6e1ae, PASS used the 'struct pass_policy' which
represented the each h/w resource. So, this patch replaces 'struct pass_policy'
to 'struct pass_resource' for representing the each h/w resource.

Change-Id: I714c633255696af2cbf4719ce2892f15b37e1b25
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopmqos: Do not send DBus method return message when PMQoS is not started 46/160446/4 accepted/tizen/unified/20171123.065848 submit/tizen/20171123.001235
Wook Song [Thu, 16 Nov 2017 06:48:48 +0000 (15:48 +0900)]
pmqos: Do not send DBus method return message when PMQoS is not started

When the PMQoS module receives PMQoS requests via DBus methods
invocation before its initialization, the module displays out the
message about that the module is not started yet and it returns a DBus
message to the sender. The following log message is displayed in the
systemd journal because of this DBus method return message sending:

pass[2132]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Although this warning may not harm any parts of the system, it is fixed
by this patch as well.

Change-Id: I4f22e4b429c2dcbbd2f1834ec485dc06bfdf24a2
Signed-off-by: Wook Song <wook16.song@samsung.com>
6 years agopass: Consolidate the size of char arrary to the 255 byte 00/158900/1
Chanwoo Choi [Mon, 6 Nov 2017 01:40:00 +0000 (10:40 +0900)]
pass: Consolidate the size of char arrary to the 255 byte

The multiple modules define the char array with the different size.
It might make the confusion and overflow error. This patch consolidates
the size of char arrary to the 255 byte and changes the name of 'PASS_NAME_LEN'
to 'BUFF_MAX' in order to remove the unneeded 'PASS_*' prefix.

Change-Id: I2ee11313f10f52f5aa24628afbac9facd45b50ad
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Move local constatnt definition to the specific module 99/158899/1
Chanwoo Choi [Mon, 6 Nov 2017 01:29:38 +0000 (10:29 +0900)]
pass: Move local constatnt definition to the specific module

The some definitions were only used in the specific module.
They would be not included in the pass.h header file. This patch
moves the definition to the specific module.
- #define PASS_MIN_GOV_TIMEOUT 0.2 (pass-parser.c)
- #define PASS_CPU_STATS_DEFAULT 20 (pass.c)

Change-Id: Id3ce5c81198d74981a50541b6b71495c48bab3c3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Remove unneeded constant definition 98/158898/1
Chanwoo Choi [Mon, 6 Nov 2017 01:23:01 +0000 (10:23 +0900)]
pass: Remove unneeded constant definition

This patch removes the following unneeded definitions and clean-up
the unnecessary blank line from pass.h.
- #define PASS_RESOURCE_MAX 10
- #define PASS_CLUSTER_0 0
- #define PASS_CLUSTER_1 1

Change-Id: I6354067570995e03a5d077611c13781191ae85e8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: pmqos: Change name of 'struct pass_scenario_policy' to 'struct pass_pmqos' 54/158854/1
Chanwoo Choi [Fri, 3 Nov 2017 09:15:05 +0000 (18:15 +0900)]
pass: pmqos: Change name of 'struct pass_scenario_policy' to 'struct pass_pmqos'

The 'struct pass_scenario_policy' indicates the PMQoS module
and contains the scenario information. The 'pass_scenario_policy'
name is ambiguous for indicating the PMQoS module. So, this patch changes
the name from 'struct pass_scenario_policy' to 'struct pass_pmqos'
for the readability.

Also, this patch changes the variable name from 'list' to 'scenarios'.
The pmqos->scenarios is better than 'pmqos->list' in side of readability
in order to indicate the scenario list.

Change-Id: I402cec7ff1f922edbe67b8c216408ff702f2a2fb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: gov: Move private structure from pass.h to pass-gov.h 11/158611/2
Chanwoo Choi [Thu, 2 Nov 2017 06:37:16 +0000 (15:37 +0900)]
pass: gov: Move private structure from pass.h to pass-gov.h

The following private data are only used in the pass-gov*.c.
- enum pass_gov_state
- struct pass_governor

So, this patch moves them from pass.h to pass-gov.h in order
to prevent the unnecessary access to them.

Change-Id: Ia205a1f510eeea50a113fbefee7a48a499818246
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: rescon: Remove unneeded enumeration pass_cpu_state 10/158610/2
Chanwoo Choi [Thu, 2 Nov 2017 06:34:42 +0000 (15:34 +0900)]
pass: rescon: Remove unneeded enumeration pass_cpu_state

This patch removes the unnecessary enumeration pass_cpu_state.
Instead, this patch uses the integer (0 or 1) for cpu_up/down.

Change-Id: I12bbc54edff7047c06a18e5b04d03b8b807f15da
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Change name of 'struct pass_table' to 'struct pass_level' 09/158609/1
Chanwoo Choi [Thu, 2 Nov 2017 06:32:00 +0000 (15:32 +0900)]
pass: Change name of 'struct pass_table' to 'struct pass_level'

PASS used the 'Level' expression which indicates the basic unit.
The modules of PASS decide the next level and then resource-controller
module set the h/w resource according to the decided level.

Prior to that, PASS used the 'struct pass_table' name. It is not correct
and make the confusion possible. So, this patch changes the name
of 'struct pass_table' to 'struct pass_level'.

Change-Id: If0df603dbaf98aa22aad49af15636cd67b35692a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: parser: update pass->num_resources properly 19/158219/4
Seung-Woo Kim [Mon, 30 Oct 2017 10:34:33 +0000 (19:34 +0900)]
pass: parser: update pass->num_resources properly

During pass_resource_config(), if allocation of res is failed,
pass->num_resources is only updated. Also, after pass->res is
freed from pass_put_resource_config(), pass->num_resources is not
set to 0. Update pass->num_resources propery from both cases.

Change-Id: Idb72e0fe46889436ded7aa07e514e78e9594e2c6
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopmqos: update scenarios->num properly from pmqos_parse_scenario() 18/158218/4
Seung-Woo Kim [Mon, 30 Oct 2017 10:27:26 +0000 (19:27 +0900)]
pmqos: update scenarios->num properly from pmqos_parse_scenario()

If allocation of scenarios->list is failed, only scenarios->num is
updated. Update the scenarios->num propery.

Change-Id: Ia9b6c47f8449870ddefaca600ed5d0c1d9c47fe7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopmqos: clear freed scenario->list in pmqos_put_scenario() 17/158217/4
Seung-Woo Kim [Mon, 30 Oct 2017 09:52:18 +0000 (18:52 +0900)]
pmqos: clear freed scenario->list in pmqos_put_scenario()

Clear freed scenario->list in pmqos_put_scenario() to remove
possiblity of use-after-free.

Change-Id: I55266716473889ede04384ed3b8825eaf1dfc32b
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopmqos: fix wrong condition to clear in pmqos_put_scenario() 75/158575/1
Seung-Woo Kim [Thu, 2 Nov 2017 02:12:11 +0000 (11:12 +0900)]
pmqos: fix wrong condition to clear in pmqos_put_scenario()

There is wrong condition to check scenarios->list is null before
freeing it in pmqos_put_scenario(). Fix the wrong condition.

Change-Id: Ib759f0af452ed90512e8ed55f486943dd857b8ba
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopass: parser: update policy->scenario.num_scenarios properly 16/158216/2
Seung-Woo Kim [Mon, 30 Oct 2017 10:42:24 +0000 (19:42 +0900)]
pass: parser: update policy->scenario.num_scenarios properly

The policy->scenario.num_scenarios is not updated properly if
allocation of policy->scernario.list is failed. Also for case of
free it. Update policy->scenario.num_scenarios properly for both
cases.

Change-Id: I0fe18520ab304c57df9e1cac8713848da19055e4
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopass: parser: clear freed scenario.list in pass_put_table() 91/156991/7
Seung-Woo Kim [Mon, 23 Oct 2017 05:03:52 +0000 (14:03 +0900)]
pass: parser: clear freed scenario.list in pass_put_table()

Clear freed scenario.list in pass_put_table() to remove possibility
of use-after-free.

Change-Id: I959546e12c1f811313cd65b50b7bac18b9787d6d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopass: Remove use-after-free of policy->pass_table during pass_exit_resource() 15/158215/2
Seung-Woo Kim [Mon, 30 Oct 2017 09:46:32 +0000 (18:46 +0900)]
pass: Remove use-after-free of policy->pass_table during pass_exit_resource()

During the pass_exit_resource(), pass_put_table() frees the
g_pass->policy->pass_table, and after that, pass_hotplug_stop() is
called and uses the pointer. Remove the use-after-free by clearing
policy->pass_table from pass_put_table() instead of
__pass_governor_exit() and checking null from pass_hot_plug_stop().

Change-Id: I00d57320dd9ed9f0bcaed406f066bdce37215656
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopass: Release v1.0.0 62/158162/1
Chanwoo Choi [Tue, 24 Oct 2017 05:47:30 +0000 (14:47 +0900)]
pass: Release v1.0.0

Detailed description for this release:
- Provide first Tizen Power-Management framework (PASS)
- Support Scenario-based PMQoS (pmqos)
- Support CPU Hotplug Manager (cpuhp)
- Support Resource Controller (rescon)
- Support HAL interface (hal)

Change-Id: Ic4cf720bba3cde0f2806466c0e06088f892234d9
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agohal: Fix the TOCTOU issue by using the path on dlopen directly 91/152591/2 accepted/tizen/4.0/unified/20170929.075611 accepted/tizen/unified/20170928.072150 submit/tizen/20170927.080101 submit/tizen_4.0/20170927.080359 tizen_4.0.IoT.p1_release tizen_4.0.m2_release
Chanwoo Choi [Tue, 26 Sep 2017 11:11:44 +0000 (20:11 +0900)]
hal: Fix the TOCTOU issue by using the path on dlopen directly

Prior to that, pass_get_hal_info() checks whether filename is
accessible or not wiht access() and then load the library through
dlopen(). This sequence between access() and dlopen() has the
TOCTOU (Time of Check to Time Of Use) issue. So, this patch just
removes the calling of access() and then only use dlopen()
in order to TOCTOU issue.

Change-Id: I510eb7bcd2e91a5bacd743ef22af92298f72b4ae
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Fix the not-null terminated string 44/152544/4
Chanwoo Choi [Tue, 26 Sep 2017 09:54:59 +0000 (18:54 +0900)]
pass: Fix the not-null terminated string

The read() function doesn't add the '\0' character
to the end of string. So, this patch adds the '\0' char
on the last point of string if there is no error.

Change-Id: I1b3bf879b9c38f19edad8279d036c68655fae83b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Print thermal name for each resource 74/151574/2
Chanwoo Choi [Thu, 21 Sep 2017 07:49:21 +0000 (16:49 +0900)]
pass: Print thermal name for each resource

This patch just prints the thermal name for each resource
for starting PASS in order to provide the resource information.

Change-Id: I2824186649a784722d1647df2fea0082256a63a8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: pmqos: Fix the svace warning 31/149731/1 accepted/tizen/4.0/unified/20170919.170914 accepted/tizen/unified/20170915.194627 submit/tizen/20170915.013740 submit/tizen_4.0/20170915.014015
Chanwoo Choi [Wed, 13 Sep 2017 04:21:58 +0000 (13:21 +0900)]
pass: pmqos: Fix the svace warning

This patch fixes the following svace warning.

[Warning Info]
WID:31612805 locked has enum type which is not isomorphic with boolean type,
however it is used as a boolean expression

Change-Id: I428750f3b667b0178b8886976a2d34e4b906f5b6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agohal: Remove unused log macros 21/149421/1
Chanwoo Choi [Tue, 12 Sep 2017 04:26:14 +0000 (13:26 +0900)]
hal: Remove unused log macros

This patch just removes the unused log macros.

Change-Id: Id67b404ca11e5e17a1811de84569c51352d809fa
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Fix the checkpatch's warning to keep the coding style 69/149269/1
Chanwoo Choi [Tue, 12 Sep 2017 04:09:51 +0000 (13:09 +0900)]
pass: Fix the checkpatch's warning to keep the coding style

This patch just fixes the following checkpatch's warnings.

[Warning results from Tizen's checkpatch]
src/pass/pass-parser.c:
:210: ERROR: [IDT_M_TAB] code indent should use tabs where possible
:210: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
:480: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:483: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:615: ERROR: [SPC_M_OPR] spaces required around that '=' (ctx:WxV)

src/pass/pass.c
:355: ERROR: [IDT_M_TAB] please, no space before tabs
:366: ERROR: [IDT_M_TAB] please, no space before tabs

src/pass/pass-gov.c
:387: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/core/device-notifier.c
:32: ERROR: [BRC_M_FTN] open brace '{' following function declarations go on the next line

src/pmqos/pmqos.c
:92: WARNING: [BRC_R_SST] braces {} are not necessary
for any arm of this statement

src/shared/log.h
:28: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:29: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:30: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:31: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/pass/pass.h
:408: ERROR: [SPC_M_SEP] space prohibited after that open parenthesis '('
:408: ERROR: [SPC_M_SEP] space prohibited before that close parenthesis ')'
:409: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:409: ERROR: [SPC_M_OPR] space required after that ';' (ctx:VxV)
:409: ERROR: [SPC_M_SEP] space prohibited after that open parenthesis '('
:409: ERROR: [SPC_M_SEP] space prohibited before that close parenthesis ')'

src/core/config-parser.h
:40: ERROR: [IDT_M_TAB] please, no spaces at the start of a line

src/core/devices.h
:116: ERROR: [SPC_M_OPR] spaces required around that '?' (ctx:VxW)
:119: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:120: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:123: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:124: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/core/common.h
:115: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:115: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
src/core/common.h:116: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:116: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
src/core/common.h:117: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:117: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
src/core/common.h:118: ERROR: [IDT_M_TAB] code indent should use tabs where possible
src/core/common.h:118: ERROR: [IDT_M_TAB] please, no spaces at the start of a line

src/hal/hal-log.h
:29: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:30: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:31: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:32: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:33: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:34: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:35: ERROR: [SPC_M_KWD] space required before the open parenthesis '('
:36: ERROR: [SPC_M_KWD] space required before the open parenthesis '('

src/hal/hal.h
:26: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:26: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:26: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:Vx )
:29: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:31: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:31: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)
:31: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV)

Change-Id: I9bfb0db97b825e00d89487929037f833ecc0f156
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Remove the meaningless condition 88/147988/3 accepted/tizen/unified/20170913.070645 submit/tizen/20170911.052326
Chanwoo Choi [Wed, 6 Sep 2017 07:53:14 +0000 (16:53 +0900)]
pass: hal: Remove the meaningless condition

The function in the src/pass/pass-hal.c checks whehter
'res_name'/'res_thermal_name' are NULL or not. But,
those are always not NULL.

This patch removes the meaningless condition for res_name/res_thermal_name.

Change-Id: I5727a4520cbceb05f73321d97b5c3cf2a38d33c7
Reported-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Add new fault_around_bytes feature for memory h/w device 47/146347/4
Chanwoo Choi [Mon, 28 Aug 2017 03:02:59 +0000 (12:02 +0900)]
pass: Add new fault_around_bytes feature for memory h/w device

This patch adds the new 'fault_around_bytes'[1] feature
of the memory h/w device. When the page fault happens,
'fault_around_bytes' is used.

The 'fault_around_bytes' indicates the number of bytes to be mapped
around the fault. If the value is low, it is able to increase
the amount of empty memory on normal case. On the other hand,
if the value is high, it is able to improve the performance
by mapping the huge pages such as the app launching.

It can be adjusted on the fly according to the user requirements.

[1] https://lkml.org/lkml/2016/4/18/612

Change-Id: Ib33e071ac6f46dd746c00dd473bd48dfe48e1aea
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Add new struct pass_resource_memory to support memory h/w device 46/146346/3
Chanwoo Choi [Mon, 28 Aug 2017 02:47:16 +0000 (11:47 +0900)]
pass: Add new struct pass_resource_memory to support memory h/w device

This patch adds the new 'struct pass_resource_memory' in order to
manage the memory[1] h/w device according to the requirements.

If the new requirements arise in the future, the new functions
will be added in the struct pass_resource_memory.

[1] https://en.wikipedia.org/wiki/Computer_memory

Change-Id: Iccbb576757cf25f748fac6d03e3a5aebda5facd3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agohal: Define new struct pass_resource_memory for memory h/w device 45/146345/3
Chanwoo Choi [Mon, 28 Aug 2017 01:34:07 +0000 (10:34 +0900)]
hal: Define new struct pass_resource_memory for memory h/w device

This patch defines the new 'struct pass_resource_memory' in order to
manage the memory[1] h/w device. The struct pass_resource_memory
includes the functions to handle the 'fault_around_bytes'[2]
for memory device.

[1] https://en.wikipedia.org/wiki/Computer_memory
[2] https://lkml.org/lkml/2016/4/18/612

Change-Id: Ib5694331ce24700ec6b84802a807826ed57192f2
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Add description of properties in the PASS's level 70/147970/2
Chanwoo Choi [Wed, 6 Sep 2017 06:31:25 +0000 (15:31 +0900)]
pass: Add description of properties in the PASS's level

This patch adds the detailed description for properties
in the PASS's level and removes the unused 'comm_cond' variable.

Change-Id: Iee4e3ce9b3b789b5b2d84e3edb10b4122308e595
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agocore: Replace functionalities based on Ecore with ones based on GLib 51/144851/15
Wook Song [Fri, 4 Aug 2017 06:04:17 +0000 (15:04 +0900)]
core: Replace functionalities based on Ecore with ones based on GLib

Since Ecore library is tightly coupled with EFL which is a set of
graphics libraries, for the devices without GUI, so called 'headless
devices', even if the system only requires the functionalities provided
by Ecore, many unnecessary packages should be included in it. This could
make the size of the platform image bigger. For this reason, we decided
to reimplement all the functionalites based on Ecore of PASS using GLib.

This patch replaces the functionalites based on Ecore with ones based on
GLib. In detail, the ecore main loop is changed to the glib main loop
and the ecore timer-based task handling is now changed to the glib
timeout-based task handling mechanism. In addition, in order to support
DBus IPC, PASS uses gdbus now instead of edbus. The code based on gdbus
which was implemented the old-fashioned way is also refactored by this
patch.

Change-Id: I6660c7f84da0ba5adce5f765852b4d9d0af781e9
Signed-off-by: Wook Song <wook16.song@samsung.com>
6 years agohal: Remove unused version info 52/147652/1
Chanwoo Choi [Tue, 5 Sep 2017 05:20:58 +0000 (14:20 +0900)]
hal: Remove unused version info

This patch removes the unused version info

Change-Id: I406ec9fe5df88bfc95fb0d7d0578ea73d894e1f8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Skip exit process for uninitialized resources 62/146162/5 accepted/tizen/4.0/unified/20170901.202640 accepted/tizen/unified/20170829.053236 submit/tizen/20170828.071557 submit/tizen_4.0/20170901.015952
Dongwoo Lee [Fri, 25 Aug 2017 06:43:34 +0000 (15:43 +0900)]
pass: Skip exit process for uninitialized resources

Even in the case that the resource is not initialized due to any
reason, pass tries to exit that resource during service stop, and
thus it causes failure on exit process. To resolve it, this patch
adds the state of resource and set UNUSED state to resource on error
case. After that, exit process for the resource in UNUSED state will
be skipped.

Change-Id: Id635471d39b3d19378613935666cfd911813baf3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agopass: parser: Fix memory leakage for resource list 61/146161/2
Dongwoo Lee [Fri, 25 Aug 2017 06:12:02 +0000 (15:12 +0900)]
pass: parser: Fix memory leakage for resource list

Resource list is allocated during pass configuration is parsed. But,
nowhere is deallocation function for freeing it. To protect memory
leakage, resource will be freed properly.

Change-Id: I6125c06604e2b0c6824c258b2a4d4f6ce4a2d902
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agoCREDITS: Add main contributor info 62/145862/2 accepted/tizen/unified/20170824.172538 submit/tizen/20170824.064003
Chanwoo Choi [Thu, 24 Aug 2017 05:49:34 +0000 (14:49 +0900)]
CREDITS: Add main contributor info

Dongwoo Lee <dwoo08.lee@samsung.com> develops the PASS's features
and fixes the bugs. He is main contributor of PASS.

Change-Id: Ie140c688650fb94b9c35f2c9b69b96481f8b5fd2
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Fix the bug when putting the nonstandard resource 44/144844/1
Chanwoo Choi [Fri, 18 Aug 2017 05:08:13 +0000 (14:08 +0900)]
pass: hal: Fix the bug when putting the nonstandard resource

The commit 9eabff35831a ("pass: Add the support for new struct
pass_resource_nonstandard type") missed adding the 'break' when
putting the nonstandard resource. So, the error happen when
releasing the nonstandard resource.

This patch adds the missing 'break' to fix the bug.

Change-Id: I867c820411e34e42d3ebc4afd06f7f9c2071a5ec
Fixes: commit 9eabff35831a ("pass: Add the support for new struct pass_resource_nonstandard type")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agocore: Refactor macros which wrap the g_list functions in list.h 41/141041/7 accepted/tizen/4.0/unified/20170829.020255 accepted/tizen/unified/20170822.023808 submit/tizen/20170821.043932 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004
Wook Song [Thu, 27 Jul 2017 23:39:58 +0000 (08:39 +0900)]
core: Refactor macros which wrap the g_list functions in list.h

In list.h, there are a group of macro definitions started with the prefix
'DD_LIST'. Most of these macros are neither meaningful nor necessary
since they just wrap the corresponding g_list functions. For this
reason, this patch removes those wrapping macros. In addition, the
prefix 'DD_LIST' is ambiguous. This patch also changes the prefix
'DD_LIST' to more direct prefix "G_LIST".

Change-Id: Iaa1aa4b5ed89e62ab93c0f4569b735a8f807793c
Signed-off-by: Wook Song <wook16.song@samsung.com>
6 years agopass: hal: Replace the function to get initial maximum frequency 46/143146/5
Dongwoo Lee [Mon, 7 Aug 2017 05:53:09 +0000 (14:53 +0900)]
pass: hal: Replace the function to get initial maximum frequency

The current maximum frequency is used for saving initial data of
frequency. However, it is affected by other factor such as thermal
throttling, thus the initial value can be lower than expected.
To prevent this problem, the available maximum frequency will be
used to get initial frequency data.

Change-Id: If8d65da8896a547d66abc0c2e053585468d3c346
Reported-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agopass: hal: Add functions for getting available min/max frequency 45/143145/6
Dongwoo Lee [Mon, 7 Aug 2017 05:16:24 +0000 (14:16 +0900)]
pass: hal: Add functions for getting available min/max frequency

This patch adds the new functions to HAL dvfs callbacks to get
available minimum and maximum frequency. Available frequency means
that the frequency which can be set to the resource. Thus,
HAL implementation for these function should return the proper value
as following the resource's available frequency list.

Change-Id: Ie39eef51c115e12bb5c2f82d07c557328a8a0e2b
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agopass: Use error log macro with _E when error happen 81/142981/2
Chanwoo Choi [Tue, 8 Aug 2017 06:16:13 +0000 (15:16 +0900)]
pass: Use error log macro with _E when error happen

The PASS has the following log macros. When error happen,
the modules have to use the _E macro.
- _I : info
- _D : debug
- _E : error
- _W : warning

Change-Id: I02ac5b6ce4d59519964bc7af78910d8231d98535
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoshared: Remove unused log macro 80/142980/1
Chanwoo Choi [Tue, 8 Aug 2017 06:06:53 +0000 (15:06 +0900)]
shared: Remove unused log macro

This patch just removes the unused log macro.

Change-Id: Icf707417845f27c8905e6f538c0f864bf57c919b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopmqos: Move pass-pmqos.conf to scripts directory 51/142451/1
Chanwoo Choi [Fri, 4 Aug 2017 02:01:35 +0000 (11:01 +0900)]
pmqos: Move pass-pmqos.conf to scripts directory

The 'scripts' directory includes the configuration files.
So, this patch moves 'pass-pmqos.conf' from ./src/pmqos to ./scripts.

Change-Id: I2e056571a86173a7d0255bf40e8e06ab4b9689f3
Suggested-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agocore: Remove unused device-idler files 14/141514/3
Wook Song [Tue, 1 Aug 2017 02:10:15 +0000 (11:10 +0900)]
core: Remove unused device-idler files

The functions in the device-idler source and header files are not used
outside of them. Therefore, this patch removes these files and excludes
them from the build of PASS.

Change-Id: I78c3b39f898edf23ebe6da7625c7d4ff455bf98b
Signed-off-by: Wook Song <wook16.song@samsung.com>
6 years agopass: parser: Eliminate unnecessary whitespaces 18/141118/3
Wook Song [Fri, 28 Jul 2017 07:35:46 +0000 (16:35 +0900)]
pass: parser: Eliminate unnecessary whitespaces

This patch eliminates unnecessary whitespaces at pass_parse_level and
pass_resource_data.

Change-Id: Ib669f266d65f79bc5eaf1139f04417568a7fdaf6
Signed-off-by: Wook Song <wook16.song@samsung.com>
6 years agopass: hal: Fix build warning caused by a wrong scanf format specifier 43/141043/8
Wook Song [Fri, 28 Jul 2017 02:05:52 +0000 (11:05 +0900)]
pass: hal: Fix build warning caused by a wrong scanf format specifier

The original type of int64_t depends on whether 32-bit or 64-bit
environment. In detail, on the 32-bit environment, int64_t is long long
int while, on the 64-bit environment, it is long int. Therefore, using
%lld for the scanf format specifier of int64_t on the 64-bit environment
causes a build warning. This patch fixes the following build warning [1]
using the special purpose format specifier, SCNd64, for int64_t.

[1] "warning: format '%lld' expects
argument of type 'long long int *', but argument 3 has type 'int64_t *
{aka long int *}' [-Wformat=]"

Change-Id: I6a4cb301858635b2cef91fdee8d04540413f7bec
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopmqos: Fix build warning caused by mis-type casting 42/141042/7
Wook Song [Fri, 28 Jul 2017 01:23:39 +0000 (10:23 +0900)]
pmqos: Fix build warning caused by mis-type casting

This patch fixes a build warning caused by mis-type casting from a
pointer to a int type while building the package for aarch64. On the
32-bit environment, the size of a pointer is 4 bytes which is the same
size of a int type. However, on the other hand, on the 64-bit
environment, the size of a pointer is 8 bytes while the size of a int
type is still 4 bytes. This is the main reason of the build warning.

According to the booting_done_received function in sre/core/boot.c, a
pointer of the int variable, done, is passed as the first argument, a
void pointer, of the notifier call back functions. Therefore, such type
casting from a void pointer to int is unnecssary and seems to be buggy.
This patch modifies it to cast the type from void pointer to int
pointer.

Change-Id: I1dc9932b11a2800c56de23bbdb4a3dd66cee854f
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: rescon: Separate pass-rescon module from pass-gov module 21/139921/1 accepted/tizen/4.0/unified/20170816.011839 accepted/tizen/4.0/unified/20170816.014952 accepted/tizen/unified/20170804.025536 submit/tizen/20170802.103729 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
Chanwoo Choi [Fri, 14 Jul 2017 01:37:18 +0000 (10:37 +0900)]
pass: rescon: Separate pass-rescon module from pass-gov module

The existing pass-gov module has the three features as following:
- Resource Controller to change the current/min/max 'PASS Level' -> rescon.
- Resource Monitor to collect the current system status -> resmon.
- Runtime governor for CPU hotplug policy.

In order to make the pass-rescon as the separate module,
this patch creates the pass-rescon.c module from pass-gov module separately.

Change-Id: I2f4e96fa47e95b0f503638cf4c944699fbea44c5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Move get_time_ms() pass-hal.c to pass-pmqos.c 20/139920/1
Chanwoo Choi [Fri, 14 Jul 2017 02:47:55 +0000 (11:47 +0900)]
pass: hal: Move get_time_ms() pass-hal.c to pass-pmqos.c

The existing get_time_ms() is only used on pass-pmqos.c.
So, this patch moves the definition of get_time_ms()
from pass-hal.c to pass-pmqos.c.

Change-Id: Ic89cb705071633b5093722a4ab26e71133c444cb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: hal: Fix build warning of unused variable 19/139919/1
Chanwoo Choi [Thu, 20 Jul 2017 09:17:55 +0000 (18:17 +0900)]
pass: hal: Fix build warning of unused variable

The commit ac65764c65d8 ("pass: hal: Assign resource name directly
instead of copying it) doesn't remove the unused variable. This patch
removes the unused variable to remove the build warning.

Change-Id: Ice9fe962c6ad5a4ec3941baabe0323b1d6748858
Fixes: ac65764c65d8 ("pass: hal: Assign resource name directly instead of copying it)
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agopass: Fix bug to check return value of pass_get_resource() 18/139918/1
Chanwoo Choi [Fri, 14 Jul 2017 01:48:15 +0000 (10:48 +0900)]
pass: Fix bug to check return value of pass_get_resource()

The commit 0e039c5ce2677 ("pass: hal: Modify the definition of
pass_get/put_resource()") add the wrong code related to checking
the return value of pass_get_resource(). This patch fixes the bug
of checking the return value of pass_get_resource().

Change-Id: Ia9704ee96ddec0eecc183fad96fd8583a46b47f9
Fixes: 0e039c5ce2677 ("pass: hal: Modify the definition of pass_get/put_resource()")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoscripts: Apply dbus security policy using xml-based conf file 83/139783/2
Wook Song [Thu, 20 Jul 2017 09:52:51 +0000 (18:52 +0900)]
scripts: Apply dbus security policy using xml-based conf file

Until now, there is no specific dbus security policy in PASS. Therefore,
any processes which do not have the root or special privileges can send
dbus messages to the pass daemon. This could be a serious security hole.
In order to solve such problem, this patch applies a dbus security
policy by using the pass.conf file, which is formed in XML format.

From now, without the root privileges, it is not allowed to send dbus
messages to the pass daemon. Only dbus messages sent from the processes
whose user ids are *app_fw* to the pmqos interface can be received by
the pass daemon.

Change-Id: I583eb3a097e1181e9b02b896bd97d54771c63f9c
Signed-off-by: Wook Song <wook16.song@samsung.com>
6 years agopass: Restore resource state after PASS service is stopped 93/138593/12
Dongwoo Lee [Tue, 11 Jul 2017 08:00:44 +0000 (17:00 +0900)]
pass: Restore resource state after PASS service is stopped

The resource state can be changed during PASS operation, but it
should be restored to default state after PASS is over. To do this,
PASS saves initdata of each resource during initalization process
and restores it before putting resources.

Change-Id: If9f3d712cd3288d508187295c5b3def88043c509
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Wook Song <wook16.song@samsung.com>
7 years agocore: Remove unused /var/run/.pass.pid file 13/139413/2 accepted/tizen/unified/20170720.164745 submit/tizen/20170719.015733
Chanwoo Choi [Wed, 19 Jul 2017 01:27:29 +0000 (10:27 +0900)]
core: Remove unused /var/run/.pass.pid file

PASS stores the pid to the /var/run/.pass.pid. But it is not used
and it has the security issue if the path is symbolic link.

This patch removes the /var/run/.pass.pid file.

Change-Id: I816da948f9ebe9203119bc4b21041d0a926aa338
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: hal: Assign resource name directly instead of copying it
Dongwoo Lee [Mon, 17 Jul 2017 01:55:15 +0000 (10:55 +0900)]
pass: hal: Assign resource name directly instead of copying it

The resource name is copied from .rodata region, but it is local
variable and is not assigned to other structure or global variable.
Thus, we can easily assign the name instead of copying it.

Change-Id: I6f911d2e35ed52fb0d3a39700e3735d0986360da
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agocore: Remove unused log.c file 33/138833/3
Wook Song [Fri, 14 Jul 2017 04:04:25 +0000 (13:04 +0900)]
core: Remove unused log.c file

For the debugging purpose, in the log.c, there are several functions
which PASS does not use. This patch simply removes the log.c file and
elminates the DEBUG macro, which is not used anywhere but log.c.

Change-Id: Ib40c16f41fd2465bbf5bb48e16559ed7b1c7f209
Signed-off-by: Wook Song <wook16.song@samsung.com>
7 years agopass: hal: Check whether parameter is valid or not 03/138803/2
Chanwoo Choi [Fri, 14 Jul 2017 01:08:21 +0000 (10:08 +0900)]
pass: hal: Check whether parameter is valid or not

This patch checks whether the parameter is valid or not
in order to prevent the unexpected behavior.

Change-Id: Idb0a3c97f15a95231f39569ac528ab4b1001eded
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: hal: Permit zero value for setting dvfs data 98/138798/1
Dongwoo Lee [Thu, 13 Jul 2017 04:10:05 +0000 (13:10 +0900)]
pass: hal: Permit zero value for setting dvfs data

Now several set-functions cannot take zero for target value. However,
zero is acceptable value whether it is reasonable or not. Thus, zero
is permitted for function parameter, and functions will only reject
negative value.

Change-Id: Ic363abc239ab521577165768f1e41a61e502f4c3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agopass: Clean-up code to remove unneded prefix (pass_res -> res) 37/138637/1
Chanwoo Choi [Thu, 13 Jul 2017 05:20:00 +0000 (14:20 +0900)]
pass: Clean-up code to remove unneded prefix (pass_res -> res)

The pass core uses the 'pass_res' variable name to indicate the instance
of 'struct pass_resource'. 'pass_' prefix is not beneficial and not necessary.
This patch alters 'pass_res' to 'res' simply and use the 'res_type' name
insted of 'id' variable name in order to improve the understanding
what is meaning of variable.

Change-Id: Idf2a2a8ea1f48d1724d40dc50488097946113d57
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: Change the name of pass_resource_init/exit() 36/138636/1
Chanwoo Choi [Thu, 13 Jul 2017 04:29:52 +0000 (13:29 +0900)]
pass: Change the name of pass_resource_init/exit()

The defined function used the following format to make the function name:
- "pass_[verb]_[object]()"

In order to maintain the consistency, this patch changes the function name
as following:
- pass_resource_init() -> pass_init_resource()
- pass_resource_exit() -> pass_exit_resource()

Change-Id: I2438906539c14931681c5883d702dd05a786234f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: Remove unnecessary continue statement 53/138453/2
Dongwoo Lee [Wed, 12 Jul 2017 07:45:04 +0000 (16:45 +0900)]
pass: Remove unnecessary continue statement

There is continue statement at the end of while block which have no
meaning. Unnecessary continue statement will be removed.

Change-Id: Ifd014b397bfb867d9fbc13c78e39ee613601fec3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agopass: Put resource properly to prevent memory leak 10/138110/3
Dongwoo Lee [Tue, 11 Jul 2017 05:54:57 +0000 (14:54 +0900)]
pass: Put resource properly to prevent memory leak

There are two cases which can cause memory leak during pass init/exit:
 1. When resource initialization is failed, it just skips that
    resource without putting it.
 2. In the case of failure while freeing resources, it is also skipped
    putting that resource.

To prevent memory leak, the resource will be put on both cases.

Change-Id: I4008b7785e0dbbc318b38eb573bf739e0a848b6c
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agopass: hal: Rename 'pass_get_policy' to 'pass_get_tmu_policy' 33/137633/3
Wook Song [Fri, 7 Jul 2017 02:14:39 +0000 (11:14 +0900)]
pass: hal: Rename 'pass_get_policy' to 'pass_get_tmu_policy'

This patch renames a HAL interfaces named 'pass_get_policy' to
'pass_get_tmu_policy' because of the ambiguous meaning of its original
function name.

Change-Id: I533191deb87933e8c0d779883fb41f90ceb3d3e8
Signed-off-by: Wook Song <wook16.song@samsung.com>
7 years agohal: Remove author entry from struct pass_resource_info 35/137635/2 accepted/tizen/unified/20170711.180630 submit/tizen/20170710.060912
Chanwoo Choi [Fri, 7 Jul 2017 02:15:24 +0000 (11:15 +0900)]
hal: Remove author entry from struct pass_resource_info

This patch just removes the author entry because it is not good
to fix the specific person in charge of the h/w resource.
So, all files of pass git repo doesn't have the any author information
for each *.c file.

Change-Id: I1d6b4eaccf2c4410ac07681a327906195c6c818e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: hal: Use 'res_thermal_name' as the first argument for TMU HAL 32/137632/6
Wook Song [Fri, 7 Jul 2017 02:03:37 +0000 (11:03 +0900)]
pass: hal: Use 'res_thermal_name' as the first argument for TMU HAL

This patch makes the TMU HAL functions use 'res_thermal_name' as the
first argument, which is previously 'res_name'. This change will allow
the TMU HAL function bodies to be implemented without any hard-coded
sysfs node names.

Change-Id: I702d28bfab3b110a7bdba9c3bb7601bf0e250a23
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: parser: Add parsing of pass_res_thermal_name 31/137631/8
Wook Song [Thu, 6 Jul 2017 08:43:59 +0000 (17:43 +0900)]
pass: parser: Add parsing of pass_res_thermal_name

This patch adds a parsing mechanism for the new mandatory entry,
pass_res_thermal_name, in the PassResource section of the pass.conf
file. The value of this property will be used by the TMU HAL interfaces.

Change-Id: I4f063aea6941a82322c3c3a6f1fde153c97061bc
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: parser: Remove hard-coded length of path strings in pass_conf_data 54/137454/7
Wook Song [Thu, 6 Jul 2017 04:20:34 +0000 (13:20 +0900)]
pass: parser: Remove hard-coded length of path strings in pass_conf_data

This patch removes the hard-coded length of character arrays, which
indicates file paths, in the pass_conf_data structure.

Change-Id: I3fd48d645560b004a7609a90a97fcf8d4cd3ec32
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: Modify the definition of pass_resource_init/exit() 88/137488/5
Chanwoo Choi [Thu, 6 Jul 2017 05:38:22 +0000 (14:38 +0900)]
pass: Modify the definition of pass_resource_init/exit()

This patch uses the 'struct pass_resource *' on pass_resource_init/exit()
instead of 'struct pass_policy' because the 'struct pass_resource' indicates
each h/w resource. Also, this patch maintains the same format for argument
when calling the pass_resource_*() function.

[Before]
pass_resource_init(struct pass_policy *policy)
pass_resource_exit(struct pass_policy *policy)

[After]
pass_resource_init(struct pass_resource *pass_res)
pass_resource_exit(struct pass_resource *pass_res)

Change-Id: I457f02b6a67df5e5c8b484fdea5f83587a2f9b67
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: Handle each h/w resource as the independent element 87/137487/5
Chanwoo Choi [Thu, 6 Jul 2017 04:49:38 +0000 (13:49 +0900)]
pass: Handle each h/w resource as the independent element

PASS handles each h/w resource independently. When PASS fail
to initialize or load the library, it should not affect anything else.

So, this patch tries to initialize/exit each h/w resource continuously
when other h/w resource faild to initialize/exit because each h/w resource
is independent.

Change-Id: Ibc0d40347c6b6dbbf4c2576659d937e171fa362e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: hal: Modify the definition of pass_get/put_resource() 86/137486/5
Chanwoo Choi [Thu, 6 Jul 2017 04:45:42 +0000 (13:45 +0900)]
pass: hal: Modify the definition of pass_get/put_resource()

The existing pass_get/put_resource() handles the all of resources
with 'struct pass *pass' argument which includes the information
of all h/w resources.

So, this patch modifies the definition of pass_get/put_resrouce()
in order to handle the each h/w resource with 'struct pass_resource *'
argument. And this patch changes the log message in the pass_init/exit_done()
in order to keep the same log format.

And this patch removes the unnecessary log of pass_get/put_resource().

[Before]
- pass_get_resource(struct pass *pass)
- pass_put_resource(struct pass *pass)

[After]
- pass_get_resource(struct pass_resource *pass_res)
- pass_put_resource(struct pass_resource *pass_res)

Change-Id: I704d1b1d9bc2cfe84fd3af05fe12ab8364b21df7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoshared: Remove unused dbus inferface (sysnoti) 85/137485/2
Chanwoo Choi [Thu, 6 Jul 2017 05:49:13 +0000 (14:49 +0900)]
shared: Remove unused dbus inferface (sysnoti)

This patch removes the unused dbus interface (sysnoti).

Change-Id: I8f1b35d6def8a615502da0282ffad81f7b25a576
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoshared: Remove unused header file 84/137484/2
Chanwoo Choi [Thu, 6 Jul 2017 05:47:16 +0000 (14:47 +0900)]
shared: Remove unused header file

This patch removes the unused header file (deviced-priv.h).

Change-Id: If3651171e2d1b9ec19dccf07fd4c31f489f7aa51
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: gov: Set the raw data of PMQoS to HAL 78/136378/4 accepted/tizen/unified/20170706.193437 submit/tizen/20170705.081057
Chanwoo Choi [Tue, 27 Jun 2017 06:19:55 +0000 (15:19 +0900)]
pass: gov: Set the raw data of PMQoS to HAL

This patch calls the pass_set_pmqos_data() in order to set
the raw data from platform to HAL layer because of supporting
the backward compatibility.

Change-Id: I49b03382596f66682895b8cbd005cfeb7fd921cb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: Add the support for new struct pass_resource_nonstandard type 77/136377/4
Chanwoo Choi [Mon, 26 Jun 2017 08:56:28 +0000 (17:56 +0900)]
pass: Add the support for new struct pass_resource_nonstandard type

This patch support the new 'struct pass_resource_nonstandard'
in order to handle the nonstandard devices except for cpu/bus/gpu.
This h/w resource has the following functions:
- int set_pmqos_data(char *res_name, void *data)

And this patch adds the pass_set_pmqos_data() helper function
in order to bypass the PMQoS's data (scearnio name + 'Lock' or 'Unlock')
from platform to HAL layer. This function calls the .set_pmqos_data()
in the HAL pacakge.

Change-Id: I80f06f7e6bd29c30b9f7ace561642298636230f1
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: hal: Add description for helper functions 76/136376/3
Chanwoo Choi [Mon, 26 Jun 2017 09:00:34 +0000 (18:00 +0900)]
pass: hal: Add description for helper functions

This patch adds the simple description for helper functions
in order to improve the readability for the supported range of functions.

Change-Id: Ibbddda47c1f7560291d9fee709bb5da8573fcc93
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agohal: Add new struct pass_resource_nonstandard for nonstandard device 75/136375/3
Chanwoo Choi [Mon, 26 Jun 2017 08:21:20 +0000 (17:21 +0900)]
hal: Add new struct pass_resource_nonstandard for nonstandard device

This patch adds new 'struct pass_resource_nonstandard' in order to
support the nonstandard devices except for cpu/bus/gpu.

This patch just adds the following function in order to support
the backwards compatibility. This function will be removed
after finding the proper method.
- int (*set_pmqos_data)(char *res_name, void*) : Set PMQoS's data to HAL.

Change-Id: Ia0310c43226b0ab000c9470784e9d55ec507d119
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agohal: Add separate description for each struct pass_resource_* 74/136374/1
Chanwoo Choi [Tue, 27 Jun 2017 03:45:47 +0000 (12:45 +0900)]
hal: Add separate description for each struct pass_resource_*

This patch adds the seprate description for each h/w resource
in order to improve the readability of the meaning of struct pass_resource_*.

Change-Id: I44e6a2be7adc7a6e1136d9893f22a168de7588d2
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopmqos: Remove unsupported scenarios 73/136373/1
Chanwoo Choi [Tue, 27 Jun 2017 10:29:38 +0000 (19:29 +0900)]
pmqos: Remove unsupported scenarios

This patch removes the unsupported scenarios on platform.

Change-Id: I43f1a19d6332709005b8a493a3d44e6e45533c52
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: parser: Change pass_res_type in pass.conf from number to string 97/134897/2 submit/tizen/20170629.044637
Wook Song [Tue, 20 Jun 2017 08:10:07 +0000 (17:10 +0900)]
pass: parser: Change pass_res_type in pass.conf from number to string

This patch changes the type of the value of "pass_res_type" in each
PassResource section of the pass.conf file from a number to a meaningful
string like cpu, bus, and gpu.

Change-Id: I1d3a33d7a16b93f44b422ca470cd60c70198e3fc
Signed-off-by: Wook Song <wook16.song@samsung.com>
7 years agopmqos: Add 'scenario_max_timeout_ms' property to set the maximum timeout 55/134555/5
Chanwoo Choi [Mon, 19 Jun 2017 05:13:35 +0000 (14:13 +0900)]
pmqos: Add 'scenario_max_timeout_ms' property to set the maximum timeout

Each scenario wants to lock the h/w resources within their own timeout.
If the specific scenario wants to lock the h/w resources for so long time,
it is not reasonable. So, PMQoS core has the maximum timeout in order to
protect the excessive occupation of h/w resources.

This patch adds the new 'scenario_max_timeout_ms' property which means
the maximum timeout for the scenarios on specific h/w board. The owner
of PASS daemon can adjust the maximum timeout according to the h/w board.

Change-Id: Ic38137f667c34230b90e9217d33549d5859fd5fa
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: core: Remove unused udev module
Wook Song [Mon, 19 Jun 2017 03:57:31 +0000 (12:57 +0900)]
pass: core: Remove unused udev module

This patch removes currently unused udev module.

Change-Id: If230c74e12e42d253677c0e54aeb23ad66655f28
Signed-off-by: Wook Song <wook16.song@samsung.com>
7 years agopass: Remove unused pass.socket file
Chanwoo Choi [Fri, 16 Jun 2017 07:47:19 +0000 (16:47 +0900)]
pass: Remove unused pass.socket file

This patch just removes the unused pass.socket file.

Change-Id: I76a84018b81d0c6290d10a4b7becc8849709e7de
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: Change permission from root to 'system_fw' uid/gid
Chanwoo Choi [Thu, 15 Jun 2017 10:00:56 +0000 (19:00 +0900)]
pass: Change permission from root to 'system_fw' uid/gid

This patch changes the permission from root to 'system_fw' uid/gid for PASS.
Basically, Tizen has the policy to reduce the number of root daemon
to protect the security issues. If PASS has the system_fw uid, it is enough
to handle the h/w resources.

Change-Id: I48aef3da083b6f1f4160ed166fdad89293acc5b6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopass: gov: Fix build warnings caused by unused variables 30/133630/3 accepted/tizen/unified/20170615.020700 submit/tizen/20170614.020920
Wook Song [Tue, 13 Jun 2017 03:03:13 +0000 (12:03 +0900)]
pass: gov: Fix build warnings caused by unused variables

This patch fixes build warnings, which are caused by unused variables,
in the __pass_governor_init and __pass_governor_exit functions.

Change-Id: I9609991e1ef3e2b8136467171a595a68ec000bc3
Signed-off-by: Wook Song <wook16.song@samsung.com>
7 years agocore: edbus-handler: Eliminate unused code and dynamic memory allocation 29/133629/2
Wook Song [Tue, 13 Jun 2017 02:22:44 +0000 (11:22 +0900)]
core: edbus-handler: Eliminate unused code and dynamic memory allocation

This patch removes the unused code from edbus-handler. In addition,
dynamic memory allocation is also eliminated in order to avoid the
possibility of memory leak.

Change-Id: I7d16b4aac56e2cb59b920db52db6c70a5b445147
Signed-off-by: Wook Song <wook16.song@samsung.com>
7 years agopass: pmqos: Modify log when the received scenario is not supported 86/133486/4
Chanwoo Choi [Mon, 12 Jun 2017 11:03:15 +0000 (20:03 +0900)]
pass: pmqos: Modify log when the received scenario is not supported

This patch modifies the log when the received scenario is not supported
as following:

1. Remove 'Lock' and 'Unlock' word from scenario name.
- Before : "Unknown scenario (SIOPLock) for 'cpu0' resource"
- After  : "Unknown scenario (SIOP) for 'cpu0' resource"

2. Use 'Not supported' instead of 'cannot support'.
- Before : "cannot support 'AppLaunch' scenario for 'cpu0' resource"
- After  : "Not supported 'AppLaunch' scenario for 'cpu0' resource"

Change-Id: Ibeeb0f2fba3fc46e27fc1e2b16b74d167d83c3e7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopmqos: Fix bug of 'support' property of pass-pmqos.conf 75/133475/1
Chanwoo Choi [Mon, 12 Jun 2017 10:28:43 +0000 (19:28 +0900)]
pmqos: Fix bug of 'support' property of pass-pmqos.conf

This patch fixes the bug related to 'support' property of pass-pmqos.conf.

PASS PMQoS has the pass-pmqos.conf which contains the supported scenario
name and the number of supported scenarios. Each scenario has the 'support'
property indicating whether scenario is supported or not on platform.

If the 'support' property value is changed from 'yes' to 'no',
PASS shows the following error log during the init step.
[error log]
 edbus-handler.c: register_method(713) > fail to add method (null)!
 edbus-handler.c: register_edbus_method(862) > fail to register /Org/Tizen/System/Pass/Pmqos method(-22)
 pmqos.c: pmqos_init_done(395) > fail to init edbus method from conf(-22)

Change-Id: Icbb0d29c941345f21c3bcc4ae513ff73095a3aff
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agopmqos: Remove hard-coded scenario names 74/133474/1
Chanwoo Choi [Fri, 9 Jun 2017 08:49:53 +0000 (17:49 +0900)]
pmqos: Remove hard-coded scenario names

This patch removes the hard-coded scenario names and unused functions.
When you want to add or remove the scenarios, you have to modify
the /etc/pass/pass-pmqos.conf file without any changes of pmqos code.

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