9
9
* - Added processor hotplug support
10
10
*/
11
11
12
+ #define pr_fmt (fmt ) "ACPI: " fmt
13
+
12
14
#include <linux/kernel.h>
13
15
#include <linux/module.h>
14
16
#include <linux/slab.h>
20
22
#include <asm/io.h>
21
23
#include <linux/uaccess.h>
22
24
23
- #define PREFIX "ACPI: "
24
-
25
25
/* ignore_tpc:
26
26
* 0 -> acpi processor driver doesn't ignore _TPC values
27
27
* 1 -> acpi processor driver ignores _TPC values
@@ -236,8 +236,7 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
236
236
if (pr -> throttling_platform_limit > target_state )
237
237
target_state = pr -> throttling_platform_limit ;
238
238
if (target_state >= p_throttling -> state_count ) {
239
- printk (KERN_WARNING
240
- "Exceed the limit of T-state \n" );
239
+ pr_warn ("Exceed the limit of T-state \n" );
241
240
target_state = p_throttling -> state_count - 1 ;
242
241
}
243
242
p_tstate -> target_state = target_state ;
@@ -256,8 +255,7 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
256
255
cpu , target_state );
257
256
break ;
258
257
default :
259
- printk (KERN_WARNING
260
- "Unsupported Throttling notifier event\n" );
258
+ pr_warn ("Unsupported Throttling notifier event\n" );
261
259
break ;
262
260
}
263
261
@@ -422,7 +420,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
422
420
ptc = (union acpi_object * )buffer .pointer ;
423
421
if (!ptc || (ptc -> type != ACPI_TYPE_PACKAGE )
424
422
|| (ptc -> package .count != 2 )) {
425
- printk ( KERN_ERR PREFIX "Invalid _PTC data\n" );
423
+ pr_err ( "Invalid _PTC data\n" );
426
424
result = - EFAULT ;
427
425
goto end ;
428
426
}
@@ -436,8 +434,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
436
434
if ((obj .type != ACPI_TYPE_BUFFER )
437
435
|| (obj .buffer .length < sizeof (struct acpi_ptc_register ))
438
436
|| (obj .buffer .pointer == NULL )) {
439
- printk (KERN_ERR PREFIX
440
- "Invalid _PTC data (control_register)\n" );
437
+ pr_err ("Invalid _PTC data (control_register)\n" );
441
438
result = - EFAULT ;
442
439
goto end ;
443
440
}
@@ -453,7 +450,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
453
450
if ((obj .type != ACPI_TYPE_BUFFER )
454
451
|| (obj .buffer .length < sizeof (struct acpi_ptc_register ))
455
452
|| (obj .buffer .pointer == NULL )) {
456
- printk ( KERN_ERR PREFIX "Invalid _PTC data (status_register)\n" );
453
+ pr_err ( "Invalid _PTC data (status_register)\n" );
457
454
result = - EFAULT ;
458
455
goto end ;
459
456
}
@@ -465,14 +462,14 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
465
462
466
463
if ((throttling -> control_register .bit_width +
467
464
throttling -> control_register .bit_offset ) > 32 ) {
468
- printk ( KERN_ERR PREFIX "Invalid _PTC control register\n" );
465
+ pr_err ( "Invalid _PTC control register\n" );
469
466
result = - EFAULT ;
470
467
goto end ;
471
468
}
472
469
473
470
if ((throttling -> status_register .bit_width +
474
471
throttling -> status_register .bit_offset ) > 32 ) {
475
- printk ( KERN_ERR PREFIX "Invalid _PTC status register\n" );
472
+ pr_err ( "Invalid _PTC status register\n" );
476
473
result = - EFAULT ;
477
474
goto end ;
478
475
}
@@ -506,7 +503,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
506
503
507
504
tss = buffer .pointer ;
508
505
if (!tss || (tss -> type != ACPI_TYPE_PACKAGE )) {
509
- printk ( KERN_ERR PREFIX "Invalid _TSS data\n" );
506
+ pr_err ( "Invalid _TSS data\n" );
510
507
result = - EFAULT ;
511
508
goto end ;
512
509
}
@@ -546,15 +543,14 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
546
543
}
547
544
548
545
if (!tx -> freqpercentage ) {
549
- printk (KERN_ERR PREFIX
550
- "Invalid _TSS data: freq is zero\n" );
546
+ pr_err ("Invalid _TSS data: freq is zero\n" );
551
547
result = - EFAULT ;
552
548
kfree (pr -> throttling .states_tss );
553
549
goto end ;
554
550
}
555
551
}
556
552
557
- end :
553
+ end :
558
554
kfree (buffer .pointer );
559
555
560
556
return result ;
@@ -587,13 +583,13 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)
587
583
588
584
tsd = buffer .pointer ;
589
585
if (!tsd || (tsd -> type != ACPI_TYPE_PACKAGE )) {
590
- printk ( KERN_ERR PREFIX "Invalid _TSD data\n" );
586
+ pr_err ( "Invalid _TSD data\n" );
591
587
result = - EFAULT ;
592
588
goto end ;
593
589
}
594
590
595
591
if (tsd -> package .count != 1 ) {
596
- printk ( KERN_ERR PREFIX "Invalid _TSD data\n" );
592
+ pr_err ( "Invalid _TSD data\n" );
597
593
result = - EFAULT ;
598
594
goto end ;
599
595
}
@@ -606,19 +602,19 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)
606
602
status = acpi_extract_package (& (tsd -> package .elements [0 ]),
607
603
& format , & state );
608
604
if (ACPI_FAILURE (status )) {
609
- printk ( KERN_ERR PREFIX "Invalid _TSD data\n" );
605
+ pr_err ( "Invalid _TSD data\n" );
610
606
result = - EFAULT ;
611
607
goto end ;
612
608
}
613
609
614
610
if (pdomain -> num_entries != ACPI_TSD_REV0_ENTRIES ) {
615
- printk ( KERN_ERR PREFIX "Unknown _TSD:num_entries\n" );
611
+ pr_err ( "Unknown _TSD:num_entries\n" );
616
612
result = - EFAULT ;
617
613
goto end ;
618
614
}
619
615
620
616
if (pdomain -> revision != ACPI_TSD_REV0_REVISION ) {
621
- printk ( KERN_ERR PREFIX "Unknown _TSD:revision\n" );
617
+ pr_err ( "Unknown _TSD:revision\n" );
622
618
result = - EFAULT ;
623
619
goto end ;
624
620
}
@@ -639,7 +635,7 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)
639
635
pthrottling -> shared_type = DOMAIN_COORD_TYPE_SW_ALL ;
640
636
}
641
637
642
- end :
638
+ end :
643
639
kfree (buffer .pointer );
644
640
return result ;
645
641
}
@@ -711,8 +707,7 @@ static int acpi_throttling_rdmsr(u64 *value)
711
707
712
708
if ((this_cpu_read (cpu_info .x86_vendor ) != X86_VENDOR_INTEL ) ||
713
709
!this_cpu_has (X86_FEATURE_ACPI )) {
714
- printk (KERN_ERR PREFIX
715
- "HARDWARE addr space,NOT supported yet\n" );
710
+ pr_err ("HARDWARE addr space,NOT supported yet\n" );
716
711
} else {
717
712
msr_low = 0 ;
718
713
msr_high = 0 ;
@@ -732,8 +727,7 @@ static int acpi_throttling_wrmsr(u64 value)
732
727
733
728
if ((this_cpu_read (cpu_info .x86_vendor ) != X86_VENDOR_INTEL ) ||
734
729
!this_cpu_has (X86_FEATURE_ACPI )) {
735
- printk (KERN_ERR PREFIX
736
- "HARDWARE addr space,NOT supported yet\n" );
730
+ pr_err ("HARDWARE addr space,NOT supported yet\n" );
737
731
} else {
738
732
msr = value ;
739
733
wrmsr_safe (MSR_IA32_THERM_CONTROL ,
@@ -745,15 +739,13 @@ static int acpi_throttling_wrmsr(u64 value)
745
739
#else
746
740
static int acpi_throttling_rdmsr (u64 * value )
747
741
{
748
- printk (KERN_ERR PREFIX
749
- "HARDWARE addr space,NOT supported yet\n" );
742
+ pr_err ("HARDWARE addr space,NOT supported yet\n" );
750
743
return -1 ;
751
744
}
752
745
753
746
static int acpi_throttling_wrmsr (u64 value )
754
747
{
755
- printk (KERN_ERR PREFIX
756
- "HARDWARE addr space,NOT supported yet\n" );
748
+ pr_err ("HARDWARE addr space,NOT supported yet\n" );
757
749
return -1 ;
758
750
}
759
751
#endif
@@ -784,7 +776,7 @@ static int acpi_read_throttling_status(struct acpi_processor *pr,
784
776
ret = acpi_throttling_rdmsr (value );
785
777
break ;
786
778
default :
787
- printk ( KERN_ERR PREFIX "Unknown addr space %d\n" ,
779
+ pr_err ( "Unknown addr space %d\n" ,
788
780
(u32 ) (throttling -> status_register .space_id ));
789
781
}
790
782
return ret ;
@@ -817,7 +809,7 @@ static int acpi_write_throttling_state(struct acpi_processor *pr,
817
809
ret = acpi_throttling_wrmsr (value );
818
810
break ;
819
811
default :
820
- printk ( KERN_ERR PREFIX "Unknown addr space %d\n" ,
812
+ pr_err ( "Unknown addr space %d\n" ,
821
813
(u32 ) (throttling -> control_register .space_id ));
822
814
}
823
815
return ret ;
@@ -926,7 +918,7 @@ static int acpi_processor_get_fadt_info(struct acpi_processor *pr)
926
918
}
927
919
/* TBD: Support duty_cycle values that span bit 4. */
928
920
else if ((pr -> throttling .duty_offset + pr -> throttling .duty_width ) > 4 ) {
929
- printk ( KERN_WARNING PREFIX "duty_cycle spans bit 4\n" );
921
+ pr_warn ( "duty_cycle spans bit 4\n" );
930
922
return - EINVAL ;
931
923
}
932
924
@@ -1246,7 +1238,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
1246
1238
goto end ;
1247
1239
}
1248
1240
1249
- end :
1241
+ end :
1250
1242
if (result )
1251
1243
pr -> flags .throttling = 0 ;
1252
1244
0 commit comments