Remove unused set_pmqos_data() and not-supported PASS_RESOURCE_NONSTANDARD_ID 27/315727/1 accepted/tizen/unified/20241205.060806 accepted/tizen/unified/x/20241218.032842 accepted/tizen/unified/x/asan/20241224.004616
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 2 Dec 2024 08:53:26 +0000 (17:53 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 4 Dec 2024 08:37:48 +0000 (17:37 +0900)
Remove unused set_pmqos_data() and not-supported PASS_RESOURCE_NONSTANDARD_ID
because it doesn't need to be used anymore.

Change-Id: Ic6f0e98d644b21cfabee132e3b4b19de6ea225ad
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
18 files changed:
packaging/pass.spec
src/pass/pass-hal.c
src/pass/pass-hal.h
src/pass/pass-parser.c
src/pass/pass-rescon.c
src/pass/pass.c
src/pass/pass.h
tests/haltest/power-haltests.cpp
tests/pass-unittests.cc
tests/unittest/pass-hal-and-parser/hal-api-power-mock.cpp
tests/unittest/pass-hal-and-parser/hal-api-power-mock.hpp
tests/unittest/pass-hal-and-parser/pass-hal-and-parser-unittests.cc
tests/unittest/pass-rescon/pass-hal-mock.cpp
tests/unittest/pass-rescon/pass-hal-mock.hpp
tests/unittest/pass-rescon/pass-rescon-unittests.cc
tests/unittest/pass-resmon/pass-hal-mock.cpp
tests/unittest/pass-resmon/pass-hal-mock.hpp
tests/unittest/pass-resmon/pass-resmon-unittests.cc

index 0784256f457d306b860bb9bbe1f62af743c9923a..4fb2a866eb39f7b904f41913ef4f2c6767509e3c 100644 (file)
@@ -8,7 +8,7 @@
 
 Name:       %{daemon_name}
 Summary:    Power Aware System Service
-Version:    2.0.0
+Version:    2.0.1
 Release:    1
 Group:      System/Kernel
 License:    Apache-2.0
index fbbea840ceef905dc961f127631ab1a4c30d4887..7b3840a74a89b14757de66f6c96e9187c4b240ec 100644 (file)
@@ -583,23 +583,6 @@ int pass_hal_get_fault_around_bytes(struct pass_resource *res)
                                        res->config_data.res_name);
 }
 
-/**
- * @brief      Deprecated - set pmqos_data for nonstandard h/w resource
- * @param      [in] res Instance of h/w resource
- * @return     @c 0 on success, otherwise error value
- * @retval     -22 Invalid argument (-EINVAL)
- * @retval     -1 Operation not permitted (-EPERM)
- * @retval     -19 Operation not supported (-ENOTSUP)
- */
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data)
-{
-       if (!res || !data)
-               return -EINVAL;
-
-       return hal_power_misc_set_pmqos_data(res->config_data.res_type,
-                                       res->config_data.res_name, data);
-}
-
 /**
  * @brief      Save the initial state of DVFS(Dynamic Voltage and Frequency
  *             Scaling) resource before PASS (Power Aware System Service)
@@ -908,7 +891,6 @@ int pass_hal_save_initdata(struct pass_resource *res)
                }
                /* fall through */
        case PASS_RESOURCE_BATTERY_ID:
-       case PASS_RESOURCE_NONSTANDARD_ID:
                ret = pass_hal_save_battery_initdata(res);
                if (ret < 0) {
                        _E("Failed to save battery initdata for '%s' resource",
@@ -972,7 +954,6 @@ int pass_hal_restore_initdata(struct pass_resource *res)
                }
                /* fall through */
        case PASS_RESOURCE_BATTERY_ID:
-       case PASS_RESOURCE_NONSTANDARD_ID:
                ret = pass_hal_restore_battery_initdata(res);
                if (ret < 0) {
                        _E("Failed to restore battery initdata for '%s' resource",
index 459f04fb66bfe2409c78cd87202759b16d2bcfc0..bcb00ef72b8b17aa8e80d04425b7559dd07b5443 100644 (file)
@@ -109,17 +109,4 @@ int pass_hal_set_online_max_num(struct pass_resource *res, int num);
 int pass_hal_get_fault_around_bytes(struct pass_resource *res);
 int pass_hal_set_fault_around_bytes(struct pass_resource *res,
                                int fault_around_bytes);
-
-/***
- * Functions for Nonstandard H/W resources
- */
-/*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data);
-
 #endif /* __PASS_HAL__ */
index ae9fc90c07c3eaa51d8376978959b7e2fa804ce9..d2542a4c4126758b3c3792243c0491cab5cf27ea 100644 (file)
@@ -711,8 +711,6 @@ static int parse_resource_data(struct pass *pass, int id, json_object *obj)
                config_data->res_type = PASS_RESOURCE_DISK_ID;
        else if (!strncmp(device_type, PASS_RESOURCE_NETWORK_NAME, strlen(device_type)))
                config_data->res_type = PASS_RESOURCE_NETWORK_ID;
-       else if (!strncmp(device_type, PASS_RESOURCE_NONSTANDARD_NAME, strlen(device_type)))
-               config_data->res_type = PASS_RESOURCE_NONSTANDARD_ID;
        else {
                _E("Unknown 'device_type' property value (%s)\n", device_type);
                return -EINVAL;
index a42f4219dd84a5a927caa54fee12dc4eb35601ce..3e57f59ed699edc9bb8d89cf16fedda09273b76f 100644 (file)
@@ -244,7 +244,6 @@ static int rescon_update(struct pass_resource *res)
                limit_min_freq = adjusted_level.limit_min_freq;
                /* fall through */
        case PASS_RESOURCE_BATTERY_ID:
-       case PASS_RESOURCE_NONSTANDARD_ID:
                cooling_device_state = adjusted_level.cooling_device_state;
                charging_status = adjusted_level.charging_status;
                charging_current_uA = adjusted_level.charging_current_uA;
@@ -693,14 +692,6 @@ int pass_rescon_set_scenario_level_sync_with_data(struct pass_resource *res,
        if (!res)
                return -EINVAL;
 
-       /*
-        * FIXME: PMQoS core sends the raw data to the HAL in order to
-        * support the backwards compatibility. This function call will
-        * be removed after finding the proper method.
-        */
-       if (data)
-               pass_hal_set_pmqos_data(res, data);
-
        rescon_set_scenario_level(res, scenario_level);
 
        return rescon_update(res);
@@ -720,14 +711,6 @@ int pass_rescon_unset_scenario_level_sync_with_data(struct pass_resource *res,
        if (!res)
                return -EINVAL;
 
-       /*
-        * FIXME: PMQoS core sends the raw data to the HAL in order to
-        * support the backwards compatibility. This function call will
-        * be removed after finding the proper method.
-        */
-       if (data)
-               pass_hal_set_pmqos_data(res, data);
-
        rescon_unset_scenario_level(res, scenario_level);
 
        return rescon_update(res);
index fa6d2b4a159c8930f1eb099fa81288eaeb6acb6c..aa4ca04c568a7307f34bd325016c26ced1763d31 100644 (file)
@@ -82,12 +82,6 @@ static uint64 supported_module[] = {
                                        | PASS_MODULE_RESMON
                                        | PASS_MODULE_PMQOS
                                        | PASS_MODULE_THERMAL,
-
-       [PASS_RESOURCE_NONSTANDARD_ID]  = PASS_MODULE_PARSER
-                                       | PASS_MODULE_RESCON
-                                       | PASS_MODULE_RESMON
-                                       | PASS_MODULE_PMQOS
-                                       | PASS_MODULE_THERMAL,
 };
 
 extern int pass_cpuhp_init(struct pass_resource *res);
index 1a1d5c25ddd01b16598329184b837992b564daa3..2213e88dc0a2c75ed0013a6f0df6e362bc374555 100644 (file)
@@ -160,7 +160,6 @@ struct pass_level {
         * - PASS_RESOURCE_BUS_ID
         * - PASS_RESOURCE_GPU_ID
         * - PASS_RESOURCE_BATTERY_ID
-        * - PASS_RESOURCE_NONSTANDARD_ID
         */
        int cooling_device_state;
 
@@ -168,7 +167,6 @@ struct pass_level {
         * The current state of battery charging device
         * and this property is used for the following resources:
         * - PASS_RESOURCE_BATTERY_ID
-        * - PASS_RESOURCE_NONSTANDARD_ID
         */
        int charging_status;
        int charging_current_uA;
@@ -393,7 +391,6 @@ struct pass_resource_config_data {
         * -  2: PASS_RESOURCE_BUS_ID
         * -  3: PASS_RESOURCE_GPU_ID
         * -  4: PASS_RESOURCE_MEMORY_ID
-        * - 99: PASS_RESOURCE_NONSTANDARD_ID
         */
        unsigned int res_type;
        /**
@@ -554,8 +551,6 @@ struct pass_resource {
         * - If res_type of cdata is PASS_RESOURCE_GPU_ID, hal.gpu will be used.
         * - If res_type of cdata is PASS_RESOURCE_MEMORY_ID,
         *   hal.memory will be used.
-        * - If res_type of cdata is PASS_RESOURCE_NONSTANDARD_ID,
-        *   hal.nonstandard will be used.
         */
        union {
                /** Instance for CPU h/w resource */
@@ -566,8 +561,6 @@ struct pass_resource {
                struct pass_resource_gpu *gpu;
                /** Instance for Memory h/w resource */
                struct pass_resource_memory *memory;
-               /** Instance for Nonstandard h/w resource */
-               struct pass_resource_nonstandard *nonstandard;
        } hal;
 
        /** Instance of PASS_MODULE_RESCON module */
index d336cf9aef435861f0bed170fe28b8927d81c022..24fc6af342bdb35e0aec73467b2c819281a35873 100644 (file)
@@ -519,22 +519,6 @@ TEST_F(PowerHaltest, SetFaultAroundBytes_HandlesValidInput)
        }
 }
 
-TEST_F(PowerHaltest, SetPmqosData_HandlesValidInput)
-{
-       int ret = 0;
-       unsigned int i;
-       char applaunch_scenario[] = "AppLaunch";
-
-       for (i = 0; i < g_pass.num_resources; i++) {
-               struct pass_resource *res = &g_pass.res[i];
-
-               ret = pass_hal_set_pmqos_data(res, applaunch_scenario);
-               if (haltest_is_failed(res, ret)) {
-                       ASSERT_EQ(ret, 0) << "SetPmqosData Failed";
-               }
-       }
-}
-
 TEST_F(PowerHaltest, PutResourceConfig_HandlesValidInput)
 {
        int ret = 0;
index 0f982c7d32d86bac867d8947785e4f344d853d10..8ded14388c3c4b7f568fa640c22de991794aee57 100644 (file)
@@ -477,22 +477,6 @@ TEST_F(PassHalTest, pass_hal_set_fault_around_bytes) {
        EXPECT_NE(ret, 0);
 }
 
-TEST_F(PassHalTest, pass_hal_set_pmqos_data) {
-       struct pass_resource res;
-       char buf[BUFF_MAX];
-       int ret;
-
-       EXPECT_CALL(*gHalApiPowerMock, hal_power_misc_set_pmqos_data(_, _, _))
-               .WillRepeatedly(Return(0));
-
-       ret = pass_hal_set_pmqos_data(&res, (void *)buf);
-       EXPECT_EQ(ret, 0);
-       ret = pass_hal_set_pmqos_data(NULL, (void *)buf);
-       EXPECT_NE(ret, 0);
-       ret = pass_hal_set_pmqos_data(NULL, NULL);
-       EXPECT_NE(ret, 0);
-}
-
 /* Unittest of pass-parser module */
 class PassParserTest : public testing::Test {
 public:
index b9a550fc6f8b98d819363a604c67a6cdef829b08..a0993b94fc6fa082cb0a862fe922362e7d4234d7 100644 (file)
@@ -338,15 +338,3 @@ int hal_power_memory_set_fault_around_bytes(unsigned int res_type, char *res_nam
        return gHalApiPowerMock->hal_power_memory_set_fault_around_bytes(
                                        res_type, res_name, fault_around_bytes);
 }
-
-/**
- * Miscellaneous Operation for CPU/BUS/GPU H/W
- */
-int hal_power_misc_set_pmqos_data(unsigned int res_type, char *res_name, void *data)
-{
-       if (!gHalApiPowerMock)
-               return -ENOTSUP;
-
-       return gHalApiPowerMock->hal_power_misc_set_pmqos_data(
-                                       res_type, res_name, data);
-}
index e03c2ba8efc8b1500b38cabf269a577406975dde..2fdc88bbfbf52a1aadfe33dca90af1cd44d3756a 100644 (file)
@@ -117,11 +117,6 @@ public:
        /* Get and set the /sys/kernel/debug/fault_around_bytes */
        virtual int hal_power_memory_get_fault_around_bytes(unsigned int res_type, char *res_name) = 0;
        virtual int hal_power_memory_set_fault_around_bytes(unsigned int res_type, char *res_name, int fault_around_bytes) = 0;
-
-       /**
-        * Miscellaneous Operation for CPU/BUS/GPU H/W
-        */
-       virtual int hal_power_misc_set_pmqos_data(unsigned int res_type, char *res_name, void *data) = 0;
 };
 
 class HalApiPowerMock:HalApiPowerMockInterface {
@@ -175,9 +170,6 @@ public:
 
        MOCK_METHOD2(hal_power_memory_get_fault_around_bytes, int (unsigned int res_type, char *res_name));
        MOCK_METHOD3(hal_power_memory_set_fault_around_bytes, int (unsigned int res_type, char *res_name, int fault_around_bytes));
-
-       MOCK_METHOD3(hal_power_misc_set_pmqos_data, int (unsigned int res_type, char *res_name, void *data));
-
 };
 
 extern HalApiPowerMock *gHalApiPowerMock;
index cda27aa6538056ee89de981412feff88482b8e66..cfe3f0f28119a3bd090c83b8cc45459d8afe148c 100644 (file)
@@ -475,22 +475,6 @@ TEST_F(PassHalTest, pass_hal_set_fault_around_bytes) {
        EXPECT_NE(ret, 0);
 }
 
-TEST_F(PassHalTest, pass_hal_set_pmqos_data) {
-       struct pass_resource res;
-       char buf[BUFF_MAX];
-       int ret;
-
-       EXPECT_CALL(*gHalApiPowerMock, hal_power_misc_set_pmqos_data(_, _, _))
-               .WillRepeatedly(Return(0));
-
-       ret = pass_hal_set_pmqos_data(&res, (void *)buf);
-       EXPECT_EQ(ret, 0);
-       ret = pass_hal_set_pmqos_data(NULL, (void *)buf);
-       EXPECT_NE(ret, 0);
-       ret = pass_hal_set_pmqos_data(NULL, NULL);
-       EXPECT_NE(ret, 0);
-}
-
 /* Unittest of pass-parser module */
 class PassParserTest : public testing::Test {
 public:
index 5f3eb2fde548dcca85640b2cbf5b20c3eff06c42..d166ea1b34f1e104b92cfeff019dde1ee008b54e 100644 (file)
@@ -261,14 +261,6 @@ int pass_hal_get_fault_around_bytes(struct pass_resource *res)
        return gPassHalMock->pass_hal_get_fault_around_bytes(res);
 }
 
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data)
-{
-       if (!gPassHalMock)
-               return -ENOTSUP;
-
-       return gPassHalMock->pass_hal_set_pmqos_data(res, data);
-}
-
 int pass_hal_save_initdata(struct pass_resource *res)
 {
        if (!gPassHalMock)
index 6d93b8ea4c520c0f039bb39b43b59ceb99472caa..c95653a315ff9d2dff352986a6ca28d90c9e83e1 100644 (file)
@@ -108,18 +108,6 @@ public:
        /* Get and set the /sys/kernel/debug/fault_around_bytes */
        virtual int pass_hal_get_fault_around_bytes(struct pass_resource *res) = 0;
        virtual int pass_hal_set_fault_around_bytes(struct pass_resource *res, int fault_around_bytes) = 0;
-
-       /***
-        * Functions for Nonstandard H/W resources
-        */
-       /*
-        * NOTE: It is not propper method. But PASS must need to keep
-        * the backwards compatibility, set the PMQoS's data from
-        * platform to hal. So, It is not recommended to use it.
-        *
-        * This function will be removed after finding the proper method.
-        */
-       virtual int pass_hal_set_pmqos_data(struct pass_resource *res, void *data) = 0;
 };
 
 class PassHalMock:PassHalMockInterface {
@@ -197,19 +185,6 @@ public:
        /* Get and set the /sys/kernel/debug/fault_around_bytes */
        MOCK_METHOD1(pass_hal_get_fault_around_bytes, int (struct pass_resource *res));
        MOCK_METHOD2(pass_hal_set_fault_around_bytes, int (struct pass_resource *res, int fault_around_bytes));
-
-       /***
-        * Functions for Nonstandard H/W resources
-        */
-       /*
-        * NOTE: It is not propper method. But PASS must need to keep
-        * the backwards compatibility, set the PMQoS's data from
-        * platform to hal. So, It is not recommended to use it.
-        *
-        * This function will be removed after finding the proper method.
-        */
-       MOCK_METHOD2(pass_hal_set_pmqos_data, int (struct pass_resource *res, void *data));
-
 };
 
 extern PassHalMock *gPassHalMock;
index 315d4ef0d184b4c143bb2b0cbcb3d155a13ffb40..cdea3c6c715e3b4ca31c871e0a303a23e6434d45 100644 (file)
@@ -105,15 +105,6 @@ static void init_pass_hal(void)
        /* Get and set the /sys/kernel/debug/fault_around_bytes */
        EXPECT_CALL(*gPassHalMock, pass_hal_get_fault_around_bytes(_)).WillRepeatedly(Return(0));
        EXPECT_CALL(*gPassHalMock, pass_hal_set_fault_around_bytes(_, _)).WillRepeatedly(Return(0));
-
-       /*
-        * NOTE: It is not propper method. But PASS must need to keep
-        * the backwards compatibility, set the PMQoS's data from
-        * platform to hal. So, It is not recommended to use it.
-        *
-        * This function will be removed after finding the proper method.
-        */
-       EXPECT_CALL(*gPassHalMock, pass_hal_set_pmqos_data(_, _)).WillRepeatedly(Return(0));
 }
 
 static void exit_pass_hal(void)
index 5f3eb2fde548dcca85640b2cbf5b20c3eff06c42..d166ea1b34f1e104b92cfeff019dde1ee008b54e 100644 (file)
@@ -261,14 +261,6 @@ int pass_hal_get_fault_around_bytes(struct pass_resource *res)
        return gPassHalMock->pass_hal_get_fault_around_bytes(res);
 }
 
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data)
-{
-       if (!gPassHalMock)
-               return -ENOTSUP;
-
-       return gPassHalMock->pass_hal_set_pmqos_data(res, data);
-}
-
 int pass_hal_save_initdata(struct pass_resource *res)
 {
        if (!gPassHalMock)
index 6d93b8ea4c520c0f039bb39b43b59ceb99472caa..c95653a315ff9d2dff352986a6ca28d90c9e83e1 100644 (file)
@@ -108,18 +108,6 @@ public:
        /* Get and set the /sys/kernel/debug/fault_around_bytes */
        virtual int pass_hal_get_fault_around_bytes(struct pass_resource *res) = 0;
        virtual int pass_hal_set_fault_around_bytes(struct pass_resource *res, int fault_around_bytes) = 0;
-
-       /***
-        * Functions for Nonstandard H/W resources
-        */
-       /*
-        * NOTE: It is not propper method. But PASS must need to keep
-        * the backwards compatibility, set the PMQoS's data from
-        * platform to hal. So, It is not recommended to use it.
-        *
-        * This function will be removed after finding the proper method.
-        */
-       virtual int pass_hal_set_pmqos_data(struct pass_resource *res, void *data) = 0;
 };
 
 class PassHalMock:PassHalMockInterface {
@@ -197,19 +185,6 @@ public:
        /* Get and set the /sys/kernel/debug/fault_around_bytes */
        MOCK_METHOD1(pass_hal_get_fault_around_bytes, int (struct pass_resource *res));
        MOCK_METHOD2(pass_hal_set_fault_around_bytes, int (struct pass_resource *res, int fault_around_bytes));
-
-       /***
-        * Functions for Nonstandard H/W resources
-        */
-       /*
-        * NOTE: It is not propper method. But PASS must need to keep
-        * the backwards compatibility, set the PMQoS's data from
-        * platform to hal. So, It is not recommended to use it.
-        *
-        * This function will be removed after finding the proper method.
-        */
-       MOCK_METHOD2(pass_hal_set_pmqos_data, int (struct pass_resource *res, void *data));
-
 };
 
 extern PassHalMock *gPassHalMock;
index 9740128d19532c88ab11a3680cac89bc5740cf36..9c1be4e1ce50844dc766ca285e9e735ac9f181f1 100644 (file)
@@ -106,15 +106,6 @@ static void init_pass_hal(void)
        /* Get and set the /sys/kernel/debug/fault_around_bytes */
        EXPECT_CALL(*gPassHalMock, pass_hal_get_fault_around_bytes(_)).WillRepeatedly(Return(0));
        EXPECT_CALL(*gPassHalMock, pass_hal_set_fault_around_bytes(_, _)).WillRepeatedly(Return(0));
-
-       /*
-        * NOTE: It is not propper method. But PASS must need to keep
-        * the backwards compatibility, set the PMQoS's data from
-        * platform to hal. So, It is not recommended to use it.
-        *
-        * This function will be removed after finding the proper method.
-        */
-       EXPECT_CALL(*gPassHalMock, pass_hal_set_pmqos_data(_, _)).WillRepeatedly(Return(0));
 }
 
 static void exit_pass_hal(void)