@@ -3505,35 +3505,7 @@ static void PerCore_Compute_ACPI_CPPC(CORE_RO *Core)
35053505 {
35063506 unsigned long long scaledFreq ;
35073507
3508- if (PUBLIC (RO (Proc ))-> Features .OSPM_EPP ) {
3509- Get_EPP_ACPI_CPPC (Core -> Bind );
3510- }
3511-
3512- Compute_ACPI_CPPC_Bounds (Core -> Bind );
3513-
3514- Core -> PowerThermal .HWP_Capabilities .Highest = \
3515- Core -> PowerThermal .ACPI_CPPC .Highest ;
3516-
3517- Core -> PowerThermal .HWP_Capabilities .Guaranteed = \
3518- Core -> PowerThermal .ACPI_CPPC .Guaranteed ;
3519-
3520- Core -> PowerThermal .HWP_Capabilities .Most_Efficient = \
3521- Core -> PowerThermal .ACPI_CPPC .Efficient ;
3522-
3523- Core -> PowerThermal .HWP_Capabilities .Lowest = \
3524- Core -> PowerThermal .ACPI_CPPC .Lowest ;
3525-
3526- Core -> PowerThermal .HWP_Request .Minimum_Perf = \
3527- Core -> PowerThermal .ACPI_CPPC .Minimum ;
3528-
3529- Core -> PowerThermal .HWP_Request .Maximum_Perf = \
3530- Core -> PowerThermal .ACPI_CPPC .Maximum ;
3531-
3532- Core -> PowerThermal .HWP_Request .Desired_Perf = \
3533- Core -> PowerThermal .ACPI_CPPC .Desired ;
3534-
3535- Core -> PowerThermal .HWP_Request .Energy_Pref = \
3536- Core -> PowerThermal .ACPI_CPPC .Energy ;
3508+ Read_ACPI_CPPC_Registers (Core -> Bind , NULL );
35373509
35383510 scaledFreq = Core -> PowerThermal .ACPI_CPPC .Minimum
35393511 * Core -> PowerThermal .ACPI_CPPC .Efficient ;
@@ -3778,9 +3750,9 @@ static void Controller_Start(int wait)
37783750 & PRIVATE (OF (Core , AT (cpu )))-> ThermalWork ,
37793751 msecs_to_jiffies (PUBLIC (RO (Proc ))-> SleepInterval )
37803752 );
3781- smp_call_function_single (cpu ,
3782- Arch [PUBLIC (RO (Proc ))-> ArchID ].Start ,
3783- NULL , wait );
3753+ smp_call_on_cpu (cpu ,
3754+ Arch [PUBLIC (RO (Proc ))-> ArchID ].Start ,
3755+ NULL , false );
37843756 }
37853757 }
37863758 }
@@ -3795,9 +3767,9 @@ static void Controller_Stop(int wait)
37953767 if ((BITVAL (PRIVATE (OF (Core , AT (cpu )))-> Join .TSM , CREATED ) == 1 )
37963768 && (BITVAL (PRIVATE (OF (Core , AT (cpu )))-> Join .TSM , STARTED ) == 1 ))
37973769 {
3798- smp_call_function_single (cpu ,
3799- Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop ,
3800- NULL , wait );
3770+ smp_call_on_cpu (cpu ,
3771+ Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop ,
3772+ NULL , false );
38013773
38023774 cancel_delayed_work_sync (
38033775 & PRIVATE (OF (Core , AT (cpu )))-> ThermalWork
@@ -4663,8 +4635,8 @@ static void (*Platform_Setup[])(CORE_RO*, union SAVE_AREA_CORE*) = {
46634635 [PFM_DGX_SPARK ] = Setup_DGX_Spark_GX10
46644636};
46654637
4666- static void Start_GenericMachine ( void * arg )
4667- {
4638+ IMPL_SMP_FUNC ( /*func:*/ Start_GenericMachine , /*body:*/ {
4639+
46684640 unsigned int cpu = smp_processor_id ();
46694641 CORE_RO * Core = (CORE_RO * ) PUBLIC (RO (Core , AT (cpu )));
46704642 union SAVE_AREA_CORE * Save = & PRIVATE (OF (Core , AT (cpu )))-> SaveArea ;
@@ -4690,10 +4662,10 @@ static void Start_GenericMachine(void *arg)
46904662 HRTIMER_MODE_REL_PINNED );
46914663
46924664 BITSET (LOCKLESS , PRIVATE (OF (Core , AT (cpu )))-> Join .TSM , STARTED );
4693- }
4665+ });
4666+
4667+ IMPL_SMP_FUNC (/*func:*/ Stop_GenericMachine , /*body:*/ {
46944668
4695- static void Stop_GenericMachine (void * arg )
4696- {
46974669 unsigned int cpu = smp_processor_id ();
46984670 CORE_RO * Core = (CORE_RO * ) PUBLIC (RO (Core , AT (cpu )));
46994671 union SAVE_AREA_CORE * Save = & PRIVATE (OF (Core , AT (cpu )))-> SaveArea ;
@@ -4714,7 +4686,7 @@ static void Stop_GenericMachine(void *arg)
47144686 PerCore_Reset (Core );
47154687
47164688 BITCLR (LOCKLESS , PRIVATE (OF (Core , AT (cpu )))-> Join .TSM , STARTED );
4717- }
4689+ });
47184690
47194691static long Sys_OS_Driver_Query (void )
47204692{
@@ -6515,9 +6487,9 @@ static int CoreFreqK_HotPlug_CPU_Online(unsigned int cpu)
65156487 & PRIVATE (OF (Core , AT (cpu )))-> ThermalWork ,
65166488 msecs_to_jiffies (PUBLIC (RO (Proc ))-> SleepInterval )
65176489 );
6518- smp_call_function_single (cpu ,
6519- Arch [PUBLIC (RO (Proc ))-> ArchID ].Start ,
6520- NULL , 0 );
6490+ smp_call_on_cpu (cpu ,
6491+ Arch [PUBLIC (RO (Proc ))-> ArchID ].Start ,
6492+ NULL , false );
65216493 }
65226494 }
65236495#if defined(CONFIG_CPU_IDLE ) && LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 14 , 0 )
@@ -6544,9 +6516,9 @@ static int CoreFreqK_HotPlug_CPU_Offline(unsigned int cpu)
65446516 if ((BITVAL (PRIVATE (OF (Core , AT (cpu )))-> Join .TSM , CREATED ) == 1 )
65456517 && (BITVAL (PRIVATE (OF (Core , AT (cpu )))-> Join .TSM , STARTED ) == 1 )
65466518 && (Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop != NULL )) {
6547- smp_call_function_single (cpu ,
6548- Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop ,
6549- NULL , 1 );
6519+ smp_call_on_cpu (cpu ,
6520+ Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop ,
6521+ NULL , false );
65506522
65516523 cancel_delayed_work_sync (& PRIVATE (OF (Core , AT (cpu )))-> ThermalWork );
65526524 }
@@ -6571,15 +6543,15 @@ static int CoreFreqK_HotPlug_CPU_Offline(unsigned int cpu)
65716543 {
65726544 if ((BITVAL (PRIVATE (OF (Core , AT (alt )))-> Join .TSM , STARTED ) == 1 )
65736545 && (Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop != NULL )) {
6574- smp_call_function_single (alt ,
6575- Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop ,
6576- NULL , 1 );
6546+ smp_call_on_cpu (alt ,
6547+ Arch [PUBLIC (RO (Proc ))-> ArchID ].Stop ,
6548+ NULL , false );
65776549 }
65786550 if ((BITVAL (PRIVATE (OF (Core , AT (alt )))-> Join .TSM , STARTED ) == 0 )
65796551 && (Arch [PUBLIC (RO (Proc ))-> ArchID ].Start != NULL )) {
6580- smp_call_function_single (alt ,
6581- Arch [PUBLIC (RO (Proc ))-> ArchID ].Start ,
6582- NULL , 0 );
6552+ smp_call_on_cpu (alt ,
6553+ Arch [PUBLIC (RO (Proc ))-> ArchID ].Start ,
6554+ NULL , false );
65836555 }
65846556 }
65856557 }
@@ -7402,7 +7374,11 @@ static int CoreFreqK_Ignition_Level_Up(INIT_ARG *pArg)
74027374 }
74037375#endif /* CONFIG_PM_OPP */
74047376 if (PUBLIC (RO (Proc ))-> Features .ACPI ) {
7377+ CORE_RO * Core = PUBLIC ( RO (Core ,
7378+ AT (PUBLIC (RO (Proc ))-> Service .Core )) );
7379+
74057380 ReCompute_FactoryFrequency ();
7381+ PerCore_Compute_ACPI_CPPC (Core );
74067382 }
74077383#ifdef CONFIG_HOTPLUG_CPU
74087384 #if LINUX_VERSION_CODE < KERNEL_VERSION (4 , 6 , 0 )
0 commit comments