@@ -1631,6 +1631,8 @@ static int set_pbf_core_power(int cpu)
1631
1631
static void set_pbf_for_cpu (int cpu , void * arg1 , void * arg2 , void * arg3 ,
1632
1632
void * arg4 )
1633
1633
{
1634
+ struct isst_pkg_ctdp_level_info ctdp_level ;
1635
+ struct isst_pkg_ctdp pkg_dev ;
1634
1636
int ret ;
1635
1637
int status = * (int * )arg4 ;
1636
1638
@@ -1646,6 +1648,24 @@ static void set_pbf_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
1646
1648
goto disp_result ;
1647
1649
}
1648
1650
1651
+ ret = isst_get_ctdp_levels (cpu , & pkg_dev );
1652
+ if (ret ) {
1653
+ isst_display_error_info_message (1 , "Failed to get number of levels" , 0 , 0 );
1654
+ goto disp_result ;
1655
+ }
1656
+
1657
+ ret = isst_get_ctdp_control (cpu , pkg_dev .current_level , & ctdp_level );
1658
+ if (ret ) {
1659
+ isst_display_error_info_message (1 , "Failed to get current level" , 0 , 0 );
1660
+ goto disp_result ;
1661
+ }
1662
+
1663
+ if (!ctdp_level .pbf_support ) {
1664
+ isst_display_error_info_message (1 , "base-freq feature is not present at this level" , 1 , pkg_dev .current_level );
1665
+ ret = -1 ;
1666
+ goto disp_result ;
1667
+ }
1668
+
1649
1669
if (auto_mode && status ) {
1650
1670
ret = set_pbf_core_power (cpu );
1651
1671
if (ret )
@@ -1772,9 +1792,29 @@ static void dump_fact_config(int arg)
1772
1792
static void set_fact_for_cpu (int cpu , void * arg1 , void * arg2 , void * arg3 ,
1773
1793
void * arg4 )
1774
1794
{
1795
+ struct isst_pkg_ctdp_level_info ctdp_level ;
1796
+ struct isst_pkg_ctdp pkg_dev ;
1775
1797
int ret ;
1776
1798
int status = * (int * )arg4 ;
1777
1799
1800
+ ret = isst_get_ctdp_levels (cpu , & pkg_dev );
1801
+ if (ret ) {
1802
+ isst_display_error_info_message (1 , "Failed to get number of levels" , 0 , 0 );
1803
+ goto disp_results ;
1804
+ }
1805
+
1806
+ ret = isst_get_ctdp_control (cpu , pkg_dev .current_level , & ctdp_level );
1807
+ if (ret ) {
1808
+ isst_display_error_info_message (1 , "Failed to get current level" , 0 , 0 );
1809
+ goto disp_results ;
1810
+ }
1811
+
1812
+ if (!ctdp_level .fact_support ) {
1813
+ isst_display_error_info_message (1 , "turbo-freq feature is not present at this level" , 1 , pkg_dev .current_level );
1814
+ ret = -1 ;
1815
+ goto disp_results ;
1816
+ }
1817
+
1778
1818
if (auto_mode && status ) {
1779
1819
ret = isst_pm_qos_config (cpu , 1 , 1 );
1780
1820
if (ret )
0 commit comments