2323#define PREFIX "ACPI: "
2424
2525#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
26- #define _COMPONENT ACPI_PROCESSOR_COMPONENT
27- ACPI_MODULE_NAME ("processor_perflib" );
2826
2927static DEFINE_MUTEX (performance_mutex );
3028
@@ -65,13 +63,15 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
6563 * (e.g. 0 = states 0..n; 1 = states 1..n; etc.
6664 */
6765 status = acpi_evaluate_integer (pr -> handle , "_PPC" , NULL , & ppc );
68-
69- if (status != AE_NOT_FOUND )
66+ if (status != AE_NOT_FOUND ) {
7067 acpi_processor_ppc_in_use = true;
7168
72- if (ACPI_FAILURE (status ) && status != AE_NOT_FOUND ) {
73- ACPI_EXCEPTION ((AE_INFO , status , "Evaluating _PPC" ));
74- return - ENODEV ;
69+ if (ACPI_FAILURE (status )) {
70+ acpi_handle_warn (pr -> handle ,
71+ "_PPC evaluation failed: %s\n" ,
72+ acpi_format_exception (status ));
73+ return - ENODEV ;
74+ }
7575 }
7676
7777 pr_debug ("CPU %d: _PPC is %d - frequency %s limited\n" , pr -> id ,
@@ -199,7 +199,8 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
199199
200200 status = acpi_evaluate_object (pr -> handle , "_PCT" , NULL , & buffer );
201201 if (ACPI_FAILURE (status )) {
202- ACPI_EXCEPTION ((AE_INFO , status , "Evaluating _PCT" ));
202+ acpi_handle_warn (pr -> handle , "_PCT evaluation failed: %s\n" ,
203+ acpi_format_exception (status ));
203204 return - ENODEV ;
204205 }
205206
@@ -299,7 +300,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
299300
300301 status = acpi_evaluate_object (pr -> handle , "_PSS" , NULL , & buffer );
301302 if (ACPI_FAILURE (status )) {
302- ACPI_EXCEPTION ((AE_INFO , status , "Evaluating _PSS" ));
303+ acpi_handle_warn (pr -> handle , "_PSS evaluation failed: %s\n" ,
304+ acpi_format_exception (status ));
303305 return - ENODEV ;
304306 }
305307
@@ -310,8 +312,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
310312 goto end ;
311313 }
312314
313- ACPI_DEBUG_PRINT (( ACPI_DB_INFO , "Found %d performance states\n" ,
314- pss -> package .count )) ;
315+ acpi_handle_debug ( pr -> handle , "Found %d performance states\n" ,
316+ pss -> package .count );
315317
316318 pr -> performance -> state_count = pss -> package .count ;
317319 pr -> performance -> states =
@@ -330,27 +332,28 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
330332 state .length = sizeof (struct acpi_processor_px );
331333 state .pointer = px ;
332334
333- ACPI_DEBUG_PRINT (( ACPI_DB_INFO , "Extracting state %d\n" , i ) );
335+ acpi_handle_debug ( pr -> handle , "Extracting state %d\n" , i );
334336
335337 status = acpi_extract_package (& (pss -> package .elements [i ]),
336338 & format , & state );
337339 if (ACPI_FAILURE (status )) {
338- ACPI_EXCEPTION ((AE_INFO , status , "Invalid _PSS data" ));
340+ acpi_handle_warn (pr -> handle , "Invalid _PSS data: %s\n" ,
341+ acpi_format_exception (status ));
339342 result = - EFAULT ;
340343 kfree (pr -> performance -> states );
341344 goto end ;
342345 }
343346
344347 amd_fixup_frequency (px , i );
345348
346- ACPI_DEBUG_PRINT (( ACPI_DB_INFO ,
349+ acpi_handle_debug ( pr -> handle ,
347350 "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n" ,
348351 i ,
349352 (u32 ) px -> core_frequency ,
350353 (u32 ) px -> power ,
351354 (u32 ) px -> transition_latency ,
352355 (u32 ) px -> bus_master_latency ,
353- (u32 ) px -> control , (u32 ) px -> status )) ;
356+ (u32 ) px -> control , (u32 ) px -> status );
354357
355358 /*
356359 * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
@@ -400,8 +403,8 @@ int acpi_processor_get_performance_info(struct acpi_processor *pr)
400403 return - EINVAL ;
401404
402405 if (!acpi_has_method (pr -> handle , "_PCT" )) {
403- ACPI_DEBUG_PRINT (( ACPI_DB_INFO ,
404- "ACPI-based processor performance control unavailable\n" )) ;
406+ acpi_handle_debug ( pr -> handle ,
407+ "ACPI-based processor performance control unavailable\n" );
405408 return - ENODEV ;
406409 }
407410
@@ -442,24 +445,23 @@ int acpi_processor_pstate_control(void)
442445 if (!acpi_gbl_FADT .smi_command || !acpi_gbl_FADT .pstate_control )
443446 return 0 ;
444447
445- ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,
446- "Writing pstate_control [0x%x] to smi_command [0x%x]\n" ,
447- acpi_gbl_FADT .pstate_control , acpi_gbl_FADT .smi_command ));
448+ pr_debug ("Writing pstate_control [0x%x] to smi_command [0x%x]\n" ,
449+ acpi_gbl_FADT .pstate_control , acpi_gbl_FADT .smi_command );
448450
449451 status = acpi_os_write_port (acpi_gbl_FADT .smi_command ,
450452 (u32 )acpi_gbl_FADT .pstate_control , 8 );
451453 if (ACPI_SUCCESS (status ))
452454 return 1 ;
453455
454- ACPI_EXCEPTION (( AE_INFO , status ,
455- "Failed to write pstate_control [0x%x] to smi_command [0x%x]" ,
456- acpi_gbl_FADT . pstate_control , acpi_gbl_FADT . smi_command ));
456+ pr_warn ( "Failed to write pstate_control [0x%x] to smi_command [0x%x]: %s\n" ,
457+ acpi_gbl_FADT . pstate_control , acpi_gbl_FADT . smi_command ,
458+ acpi_format_exception ( status ));
457459 return - EIO ;
458460}
459461
460462int acpi_processor_notify_smm (struct module * calling_module )
461463{
462- static int is_done = 0 ;
464+ static int is_done ;
463465 int result ;
464466
465467 if (!acpi_processor_cpufreq_init )
@@ -485,7 +487,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
485487
486488 result = acpi_processor_pstate_control ();
487489 if (!result ) {
488- ACPI_DEBUG_PRINT (( ACPI_DB_INFO , "No SMI port or pstate_control\n" ) );
490+ pr_debug ( "No SMI port or pstate_control\n" );
489491 module_put (calling_module );
490492 return 0 ;
491493 }
0 commit comments