5
5
* Copyright (C) 2001, 2002 Paul Diefenbaugh <[email protected] >
6
6
* Copyright (C) 2001 Jun Nakajima <[email protected] >
7
7
*/
8
+ #define pr_fmt (fmt ) "ACPI: " fmt
8
9
9
10
#include <linux/init.h>
10
11
#include <linux/acpi.h>
@@ -42,8 +43,6 @@ EXPORT_SYMBOL(acpi_disabled);
42
43
# include <asm/proto.h>
43
44
#endif /* X86 */
44
45
45
- #define PREFIX "ACPI: "
46
-
47
46
int acpi_noirq ; /* skip ACPI IRQ initialization */
48
47
static int acpi_nobgrt ; /* skip ACPI BGRT */
49
48
int acpi_pci_disabled ; /* skip ACPI PCI scan and IRQ initialization */
@@ -130,15 +129,14 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
130
129
131
130
madt = (struct acpi_table_madt * )table ;
132
131
if (!madt ) {
133
- printk ( KERN_WARNING PREFIX "Unable to map MADT\n" );
132
+ pr_warn ( "Unable to map MADT\n" );
134
133
return - ENODEV ;
135
134
}
136
135
137
136
if (madt -> address ) {
138
137
acpi_lapic_addr = (u64 ) madt -> address ;
139
138
140
- printk (KERN_DEBUG PREFIX "Local APIC address 0x%08x\n" ,
141
- madt -> address );
139
+ pr_debug ("Local APIC address 0x%08x\n" , madt -> address );
142
140
}
143
141
144
142
default_acpi_madt_oem_check (madt -> header .oem_id ,
@@ -161,7 +159,7 @@ static int acpi_register_lapic(int id, u32 acpiid, u8 enabled)
161
159
int cpu ;
162
160
163
161
if (id >= MAX_LOCAL_APIC ) {
164
- printk ( KERN_INFO PREFIX "skipped apicid that is too big\n" );
162
+ pr_info ( "skipped apicid that is too big\n" );
165
163
return - EINVAL ;
166
164
}
167
165
@@ -213,13 +211,13 @@ acpi_parse_x2apic(union acpi_subtable_headers *header, const unsigned long end)
213
211
*/
214
212
if (!apic -> apic_id_valid (apic_id )) {
215
213
if (enabled )
216
- pr_warn (PREFIX "x2apic entry ignored\n" );
214
+ pr_warn ("x2apic entry ignored\n" );
217
215
return 0 ;
218
216
}
219
217
220
218
acpi_register_lapic (apic_id , processor -> uid , enabled );
221
219
#else
222
- printk ( KERN_WARNING PREFIX "x2apic entry ignored\n" );
220
+ pr_warn ( "x2apic entry ignored\n" );
223
221
#endif
224
222
225
223
return 0 ;
@@ -306,7 +304,7 @@ acpi_parse_x2apic_nmi(union acpi_subtable_headers *header,
306
304
acpi_table_print_madt_entry (& header -> common );
307
305
308
306
if (x2apic_nmi -> lint != 1 )
309
- printk ( KERN_WARNING PREFIX "NMI not connected to LINT 1!\n" );
307
+ pr_warn ( "NMI not connected to LINT 1!\n" );
310
308
311
309
return 0 ;
312
310
}
@@ -324,7 +322,7 @@ acpi_parse_lapic_nmi(union acpi_subtable_headers * header, const unsigned long e
324
322
acpi_table_print_madt_entry (& header -> common );
325
323
326
324
if (lapic_nmi -> lint != 1 )
327
- printk ( KERN_WARNING PREFIX "NMI not connected to LINT 1!\n" );
325
+ pr_warn ( "NMI not connected to LINT 1!\n" );
328
326
329
327
return 0 ;
330
328
}
@@ -514,14 +512,14 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
514
512
515
513
if (intsrc -> source_irq == 0 ) {
516
514
if (acpi_skip_timer_override ) {
517
- printk ( PREFIX "BIOS IRQ0 override ignored.\n" );
515
+ pr_warn ( "BIOS IRQ0 override ignored.\n" );
518
516
return 0 ;
519
517
}
520
518
521
519
if ((intsrc -> global_irq == 2 ) && acpi_fix_pin2_polarity
522
520
&& (intsrc -> inti_flags & ACPI_MADT_POLARITY_MASK )) {
523
521
intsrc -> inti_flags &= ~ACPI_MADT_POLARITY_MASK ;
524
- printk ( PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n" );
522
+ pr_warn ( "BIOS IRQ0 pin2 override: forcing polarity to high active.\n" );
525
523
}
526
524
}
527
525
@@ -597,7 +595,7 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
597
595
if (old == new )
598
596
return ;
599
597
600
- printk ( PREFIX "setting ELCR to %04x (from %04x)\n" , new , old );
598
+ pr_warn ( "setting ELCR to %04x (from %04x)\n" , new , old );
601
599
outb (new , 0x4d0 );
602
600
outb (new >> 8 , 0x4d1 );
603
601
}
@@ -754,7 +752,7 @@ int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id,
754
752
755
753
cpu = acpi_register_lapic (physid , acpi_id , ACPI_MADT_ENABLED );
756
754
if (cpu < 0 ) {
757
- pr_info (PREFIX "Unable to map lapic to logical cpu number\n" );
755
+ pr_info ("Unable to map lapic to logical cpu number\n" );
758
756
return cpu ;
759
757
}
760
758
@@ -870,8 +868,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
870
868
struct acpi_table_hpet * hpet_tbl = (struct acpi_table_hpet * )table ;
871
869
872
870
if (hpet_tbl -> address .space_id != ACPI_SPACE_MEM ) {
873
- printk (KERN_WARNING PREFIX "HPET timers must be located in "
874
- "memory.\n" );
871
+ pr_warn ("HPET timers must be located in memory.\n" );
875
872
return -1 ;
876
873
}
877
874
@@ -883,9 +880,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
883
880
* want to allocate a resource there.
884
881
*/
885
882
if (!hpet_address ) {
886
- printk (KERN_WARNING PREFIX
887
- "HPET id: %#x base: %#lx is invalid\n" ,
888
- hpet_tbl -> id , hpet_address );
883
+ pr_warn ("HPET id: %#x base: %#lx is invalid\n" , hpet_tbl -> id , hpet_address );
889
884
return 0 ;
890
885
}
891
886
#ifdef CONFIG_X86_64
@@ -896,21 +891,17 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
896
891
*/
897
892
if (hpet_address == 0xfed0000000000000UL ) {
898
893
if (!hpet_force_user ) {
899
- printk (KERN_WARNING PREFIX "HPET id: %#x "
900
- "base: 0xfed0000000000000 is bogus\n "
901
- "try hpet=force on the kernel command line to "
902
- "fix it up to 0xfed00000.\n" , hpet_tbl -> id );
894
+ pr_warn ("HPET id: %#x base: 0xfed0000000000000 is bogus, try hpet=force on the kernel command line to fix it up to 0xfed00000.\n" ,
895
+ hpet_tbl -> id );
903
896
hpet_address = 0 ;
904
897
return 0 ;
905
898
}
906
- printk (KERN_WARNING PREFIX
907
- "HPET id: %#x base: 0xfed0000000000000 fixed up "
908
- "to 0xfed00000.\n" , hpet_tbl -> id );
899
+ pr_warn ("HPET id: %#x base: 0xfed0000000000000 fixed up to 0xfed00000.\n" ,
900
+ hpet_tbl -> id );
909
901
hpet_address >>= 32 ;
910
902
}
911
903
#endif
912
- printk (KERN_INFO PREFIX "HPET id: %#x base: %#lx\n" ,
913
- hpet_tbl -> id , hpet_address );
904
+ pr_info ("HPET id: %#x base: %#lx\n" , hpet_tbl -> id , hpet_address );
914
905
915
906
/*
916
907
* Allocate and initialize the HPET firmware resource for adding into
@@ -955,24 +946,24 @@ late_initcall(hpet_insert_resource);
955
946
static int __init acpi_parse_fadt (struct acpi_table_header * table )
956
947
{
957
948
if (!(acpi_gbl_FADT .boot_flags & ACPI_FADT_LEGACY_DEVICES )) {
958
- pr_debug ("ACPI: no legacy devices present\n" );
949
+ pr_debug ("no legacy devices present\n" );
959
950
x86_platform .legacy .devices .pnpbios = 0 ;
960
951
}
961
952
962
953
if (acpi_gbl_FADT .header .revision >= FADT2_REVISION_ID &&
963
954
!(acpi_gbl_FADT .boot_flags & ACPI_FADT_8042 ) &&
964
955
x86_platform .legacy .i8042 != X86_LEGACY_I8042_PLATFORM_ABSENT ) {
965
- pr_debug ("ACPI: i8042 controller is absent\n" );
956
+ pr_debug ("i8042 controller is absent\n" );
966
957
x86_platform .legacy .i8042 = X86_LEGACY_I8042_FIRMWARE_ABSENT ;
967
958
}
968
959
969
960
if (acpi_gbl_FADT .boot_flags & ACPI_FADT_NO_CMOS_RTC ) {
970
- pr_debug ("ACPI: not registering RTC platform device\n" );
961
+ pr_debug ("not registering RTC platform device\n" );
971
962
x86_platform .legacy .rtc = 0 ;
972
963
}
973
964
974
965
if (acpi_gbl_FADT .boot_flags & ACPI_FADT_NO_VGA ) {
975
- pr_debug ("ACPI: probing for VGA not safe\n" );
966
+ pr_debug ("probing for VGA not safe\n" );
976
967
x86_platform .legacy .no_vga = 1 ;
977
968
}
978
969
@@ -997,8 +988,7 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
997
988
pmtmr_ioport = acpi_gbl_FADT .pm_timer_block ;
998
989
}
999
990
if (pmtmr_ioport )
1000
- printk (KERN_INFO PREFIX "PM-Timer IO Port: %#x\n" ,
1001
- pmtmr_ioport );
991
+ pr_info ("PM-Timer IO Port: %#x\n" , pmtmr_ioport );
1002
992
#endif
1003
993
return 0 ;
1004
994
}
@@ -1024,8 +1014,7 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void)
1024
1014
count = acpi_table_parse_madt (ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE ,
1025
1015
acpi_parse_lapic_addr_ovr , 0 );
1026
1016
if (count < 0 ) {
1027
- printk (KERN_ERR PREFIX
1028
- "Error parsing LAPIC address override entry\n" );
1017
+ pr_err ("Error parsing LAPIC address override entry\n" );
1029
1018
return count ;
1030
1019
}
1031
1020
@@ -1057,20 +1046,19 @@ static int __init acpi_parse_madt_lapic_entries(void)
1057
1046
sizeof (struct acpi_table_madt ),
1058
1047
madt_proc , ARRAY_SIZE (madt_proc ), MAX_LOCAL_APIC );
1059
1048
if (ret < 0 ) {
1060
- printk (KERN_ERR PREFIX
1061
- "Error parsing LAPIC/X2APIC entries\n" );
1049
+ pr_err ("Error parsing LAPIC/X2APIC entries\n" );
1062
1050
return ret ;
1063
1051
}
1064
1052
1065
1053
count = madt_proc [0 ].count ;
1066
1054
x2count = madt_proc [1 ].count ;
1067
1055
}
1068
1056
if (!count && !x2count ) {
1069
- printk ( KERN_ERR PREFIX "No LAPIC entries present\n" );
1057
+ pr_err ( "No LAPIC entries present\n" );
1070
1058
/* TBD: Cleanup to allow fallback to MPS */
1071
1059
return - ENODEV ;
1072
1060
} else if (count < 0 || x2count < 0 ) {
1073
- printk ( KERN_ERR PREFIX "Error parsing LAPIC entry\n" );
1061
+ pr_err ( "Error parsing LAPIC entry\n" );
1074
1062
/* TBD: Cleanup to allow fallback to MPS */
1075
1063
return count ;
1076
1064
}
@@ -1080,7 +1068,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
1080
1068
count = acpi_table_parse_madt (ACPI_MADT_TYPE_LOCAL_APIC_NMI ,
1081
1069
acpi_parse_lapic_nmi , 0 );
1082
1070
if (count < 0 || x2count < 0 ) {
1083
- printk ( KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n" );
1071
+ pr_err ( "Error parsing LAPIC NMI entry\n" );
1084
1072
/* TBD: Cleanup to allow fallback to MPS */
1085
1073
return count ;
1086
1074
}
@@ -1139,7 +1127,7 @@ static void __init mp_config_acpi_legacy_irqs(void)
1139
1127
}
1140
1128
1141
1129
if (idx != mp_irq_entries ) {
1142
- printk ( KERN_DEBUG "ACPI: IRQ%d used by override.\n" , i );
1130
+ pr_debug ( "ACPI: IRQ%d used by override.\n" , i );
1143
1131
continue ; /* IRQ already used */
1144
1132
}
1145
1133
@@ -1179,26 +1167,24 @@ static int __init acpi_parse_madt_ioapic_entries(void)
1179
1167
* if "noapic" boot option, don't look for IO-APICs
1180
1168
*/
1181
1169
if (skip_ioapic_setup ) {
1182
- printk (KERN_INFO PREFIX "Skipping IOAPIC probe "
1183
- "due to 'noapic' option.\n" );
1170
+ pr_info ("Skipping IOAPIC probe due to 'noapic' option.\n" );
1184
1171
return - ENODEV ;
1185
1172
}
1186
1173
1187
1174
count = acpi_table_parse_madt (ACPI_MADT_TYPE_IO_APIC , acpi_parse_ioapic ,
1188
1175
MAX_IO_APICS );
1189
1176
if (!count ) {
1190
- printk ( KERN_ERR PREFIX "No IOAPIC entries present\n" );
1177
+ pr_err ( "No IOAPIC entries present\n" );
1191
1178
return - ENODEV ;
1192
1179
} else if (count < 0 ) {
1193
- printk ( KERN_ERR PREFIX "Error parsing IOAPIC entry\n" );
1180
+ pr_err ( "Error parsing IOAPIC entry\n" );
1194
1181
return count ;
1195
1182
}
1196
1183
1197
1184
count = acpi_table_parse_madt (ACPI_MADT_TYPE_INTERRUPT_OVERRIDE ,
1198
1185
acpi_parse_int_src_ovr , nr_irqs );
1199
1186
if (count < 0 ) {
1200
- printk (KERN_ERR PREFIX
1201
- "Error parsing interrupt source overrides entry\n" );
1187
+ pr_err ("Error parsing interrupt source overrides entry\n" );
1202
1188
/* TBD: Cleanup to allow fallback to MPS */
1203
1189
return count ;
1204
1190
}
@@ -1218,7 +1204,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
1218
1204
count = acpi_table_parse_madt (ACPI_MADT_TYPE_NMI_SOURCE ,
1219
1205
acpi_parse_nmi_src , nr_irqs );
1220
1206
if (count < 0 ) {
1221
- printk ( KERN_ERR PREFIX "Error parsing NMI SRC entry\n" );
1207
+ pr_err ( "Error parsing NMI SRC entry\n" );
1222
1208
/* TBD: Cleanup to allow fallback to MPS */
1223
1209
return count ;
1224
1210
}
@@ -1251,8 +1237,7 @@ static void __init early_acpi_process_madt(void)
1251
1237
/*
1252
1238
* Dell Precision Workstation 410, 610 come here.
1253
1239
*/
1254
- printk (KERN_ERR PREFIX
1255
- "Invalid BIOS MADT, disabling ACPI\n" );
1240
+ pr_err ("Invalid BIOS MADT, disabling ACPI\n" );
1256
1241
disable_acpi ();
1257
1242
}
1258
1243
}
@@ -1289,8 +1274,7 @@ static void __init acpi_process_madt(void)
1289
1274
/*
1290
1275
* Dell Precision Workstation 410, 610 come here.
1291
1276
*/
1292
- printk (KERN_ERR PREFIX
1293
- "Invalid BIOS MADT, disabling ACPI\n" );
1277
+ pr_err ("Invalid BIOS MADT, disabling ACPI\n" );
1294
1278
disable_acpi ();
1295
1279
}
1296
1280
} else {
@@ -1300,8 +1284,7 @@ static void __init acpi_process_madt(void)
1300
1284
* Boot with "acpi=off" to use MPS on such a system.
1301
1285
*/
1302
1286
if (smp_found_config ) {
1303
- printk (KERN_WARNING PREFIX
1304
- "No APIC-table, disabling MPS\n" );
1287
+ pr_warn ("No APIC-table, disabling MPS\n" );
1305
1288
smp_found_config = 0 ;
1306
1289
}
1307
1290
}
@@ -1311,20 +1294,17 @@ static void __init acpi_process_madt(void)
1311
1294
* processors, where MPS only supports physical.
1312
1295
*/
1313
1296
if (acpi_lapic && acpi_ioapic )
1314
- printk (KERN_INFO "Using ACPI (MADT) for SMP configuration "
1315
- "information\n" );
1297
+ pr_info ("Using ACPI (MADT) for SMP configuration information\n" );
1316
1298
else if (acpi_lapic )
1317
- printk (KERN_INFO "Using ACPI for processor (LAPIC) "
1318
- "configuration information\n" );
1299
+ pr_info ("Using ACPI for processor (LAPIC) configuration information\n" );
1319
1300
#endif
1320
1301
return ;
1321
1302
}
1322
1303
1323
1304
static int __init disable_acpi_irq (const struct dmi_system_id * d )
1324
1305
{
1325
1306
if (!acpi_force ) {
1326
- printk (KERN_NOTICE "%s detected: force use of acpi=noirq\n" ,
1327
- d -> ident );
1307
+ pr_notice ("%s detected: force use of acpi=noirq\n" , d -> ident );
1328
1308
acpi_noirq_set ();
1329
1309
}
1330
1310
return 0 ;
@@ -1333,8 +1313,7 @@ static int __init disable_acpi_irq(const struct dmi_system_id *d)
1333
1313
static int __init disable_acpi_pci (const struct dmi_system_id * d )
1334
1314
{
1335
1315
if (!acpi_force ) {
1336
- printk (KERN_NOTICE "%s detected: force use of pci=noacpi\n" ,
1337
- d -> ident );
1316
+ pr_notice ("%s detected: force use of pci=noacpi\n" , d -> ident );
1338
1317
acpi_disable_pci ();
1339
1318
}
1340
1319
return 0 ;
@@ -1343,11 +1322,10 @@ static int __init disable_acpi_pci(const struct dmi_system_id *d)
1343
1322
static int __init dmi_disable_acpi (const struct dmi_system_id * d )
1344
1323
{
1345
1324
if (!acpi_force ) {
1346
- printk ( KERN_NOTICE "%s detected: acpi off\n" , d -> ident );
1325
+ pr_notice ( "%s detected: acpi off\n" , d -> ident );
1347
1326
disable_acpi ();
1348
1327
} else {
1349
- printk (KERN_NOTICE
1350
- "Warning: DMI blacklist says broken, but acpi forced\n" );
1328
+ pr_notice ("Warning: DMI blacklist says broken, but acpi forced\n" );
1351
1329
}
1352
1330
return 0 ;
1353
1331
}
@@ -1574,9 +1552,9 @@ int __init early_acpi_boot_init(void)
1574
1552
*/
1575
1553
if (acpi_blacklisted ()) {
1576
1554
if (acpi_force ) {
1577
- printk ( KERN_WARNING PREFIX "acpi=force override\n" );
1555
+ pr_warn ( "acpi=force override\n" );
1578
1556
} else {
1579
- printk ( KERN_WARNING PREFIX "Disabling ACPI support\n" );
1557
+ pr_warn ( "Disabling ACPI support\n" );
1580
1558
disable_acpi ();
1581
1559
return 1 ;
1582
1560
}
@@ -1692,9 +1670,7 @@ int __init acpi_mps_check(void)
1692
1670
#if defined(CONFIG_X86_LOCAL_APIC ) && !defined(CONFIG_X86_MPPARSE )
1693
1671
/* mptable code is not built-in*/
1694
1672
if (acpi_disabled || acpi_noirq ) {
1695
- printk (KERN_WARNING "MPS support code is not built-in.\n"
1696
- "Using acpi=off or acpi=noirq or pci=noacpi "
1697
- "may have problem\n" );
1673
+ pr_warn ("MPS support code is not built-in, using acpi=off or acpi=noirq or pci=noacpi may have problem\n" );
1698
1674
return 1 ;
1699
1675
}
1700
1676
#endif
0 commit comments