Skip to content

Commit 1c29f6a

Browse files
committed
Merge back 'acpi-processor' material for v5.13.
2 parents 8cdddd1 + 2c25fab commit 1c29f6a

9 files changed

Lines changed: 116 additions & 133 deletions

File tree

Documentation/firmware-guide/acpi/debug.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ shows the supported mask values, currently these::
5858
ACPI_CONTAINER_COMPONENT 0x01000000
5959
ACPI_SYSTEM_COMPONENT 0x02000000
6060
ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
61-
ACPI_PROCESSOR_COMPONENT 0x20000000
6261

6362
debug_level
6463
===========

drivers/acpi/acpi_processor.c

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222

2323
#include "internal.h"
2424

25-
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
26-
27-
ACPI_MODULE_NAME("processor");
28-
2925
DEFINE_PER_CPU(struct acpi_processor *, processors);
3026
EXPORT_PER_CPU_SYMBOL(processors);
3127

@@ -51,19 +47,19 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
5147

5248
switch (dev->revision) {
5349
case 0:
54-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n"));
50+
dev_dbg(&dev->dev, "Found PIIX4 A-step\n");
5551
break;
5652
case 1:
57-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 B-step\n"));
53+
dev_dbg(&dev->dev, "Found PIIX4 B-step\n");
5854
break;
5955
case 2:
60-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4E\n"));
56+
dev_dbg(&dev->dev, "Found PIIX4E\n");
6157
break;
6258
case 3:
63-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4M\n"));
59+
dev_dbg(&dev->dev, "Found PIIX4M\n");
6460
break;
6561
default:
66-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unknown PIIX4\n"));
62+
dev_dbg(&dev->dev, "Found unknown PIIX4\n");
6763
break;
6864
}
6965

@@ -129,11 +125,9 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
129125
}
130126

131127
if (errata.piix4.bmisx)
132-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
133-
"Bus master activity detection (BM-IDE) erratum enabled\n"));
128+
dev_dbg(&dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n");
134129
if (errata.piix4.fdma)
135-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
136-
"Type-F DMA livelock erratum (C3 disabled)\n"));
130+
dev_dbg(&dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n");
137131

138132
return 0;
139133
}
@@ -244,11 +238,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
244238
*/
245239
if (acpi_gbl_FADT.pm2_control_block && acpi_gbl_FADT.pm2_control_length) {
246240
pr->flags.bm_control = 1;
247-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
248-
"Bus mastering arbitration control present\n"));
241+
dev_dbg(&device->dev, "Bus mastering arbitration control present\n");
249242
} else
250-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
251-
"No bus mastering arbitration control\n"));
243+
dev_dbg(&device->dev, "No bus mastering arbitration control\n");
252244

253245
if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) {
254246
/* Declared with "Processor" statement; match ProcessorID */
@@ -291,7 +283,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
291283
pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration,
292284
pr->acpi_id);
293285
if (invalid_phys_cpuid(pr->phys_id))
294-
acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n");
286+
dev_dbg(&device->dev, "Failed to get CPU physical ID.\n");
295287

296288
pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id);
297289
if (!cpu0_initialized && !acpi_has_cpu_in_madt()) {
@@ -328,11 +320,10 @@ static int acpi_processor_get_info(struct acpi_device *device)
328320
* CPU+CPU ID.
329321
*/
330322
sprintf(acpi_device_bid(device), "CPU%X", pr->id);
331-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id,
332-
pr->acpi_id));
323+
dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id);
333324

334325
if (!object.processor.pblk_address)
335-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
326+
dev_dbg(&device->dev, "No PBLK (NULL address)\n");
336327
else if (object.processor.pblk_length != 6)
337328
dev_err(&device->dev, "Invalid PBLK length [%d]\n",
338329
object.processor.pblk_length);

drivers/acpi/processor_driver.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
#define ACPI_PROCESSOR_NOTIFY_POWER 0x81
2929
#define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82
3030

31-
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
32-
ACPI_MODULE_NAME("processor_driver");
33-
3431
MODULE_AUTHOR("Paul Diefenbaugh");
3532
MODULE_DESCRIPTION("ACPI Processor Driver");
3633
MODULE_LICENSE("GPL");
@@ -87,8 +84,7 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
8784
dev_name(&device->dev), event, 0);
8885
break;
8986
default:
90-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
91-
"Unsupported event [0x%x]\n", event));
87+
acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event);
9288
break;
9389
}
9490

drivers/acpi/processor_idle.c

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
#include <asm/cpu.h>
3333
#endif
3434

35-
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
36-
ACPI_MODULE_NAME("processor_idle");
37-
3835
#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0)
3936

4037
static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
@@ -240,8 +237,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
240237
* 100 microseconds.
241238
*/
242239
if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
243-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
244-
"C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency));
240+
acpi_handle_debug(pr->handle, "C2 latency too large [%d]\n",
241+
acpi_gbl_FADT.c2_latency);
245242
/* invalidate C2 */
246243
pr->power.states[ACPI_STATE_C2].address = 0;
247244
}
@@ -251,16 +248,15 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
251248
* 1000 microseconds.
252249
*/
253250
if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {
254-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
255-
"C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency));
251+
acpi_handle_debug(pr->handle, "C3 latency too large [%d]\n",
252+
acpi_gbl_FADT.c3_latency);
256253
/* invalidate C3 */
257254
pr->power.states[ACPI_STATE_C3].address = 0;
258255
}
259256

260-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
261-
"lvl2[0x%08x] lvl3[0x%08x]\n",
257+
acpi_handle_debug(pr->handle, "lvl2[0x%08x] lvl3[0x%08x]\n",
262258
pr->power.states[ACPI_STATE_C2].address,
263-
pr->power.states[ACPI_STATE_C3].address));
259+
pr->power.states[ACPI_STATE_C3].address);
264260

265261
snprintf(pr->power.states[ACPI_STATE_C2].desc,
266262
ACPI_CX_DESC_LEN, "ACPI P_LVL2 IOPORT 0x%x",
@@ -325,8 +321,8 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
325321
* devices thus we take the conservative approach.
326322
*/
327323
else if (errata.piix4.fdma) {
328-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
329-
"C3 not supported on PIIX4 with Type-F DMA\n"));
324+
acpi_handle_debug(pr->handle,
325+
"C3 not supported on PIIX4 with Type-F DMA\n");
330326
return;
331327
}
332328

@@ -345,13 +341,13 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
345341
if (!pr->flags.bm_control) {
346342
if (pr->flags.has_cst != 1) {
347343
/* bus mastering control is necessary */
348-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
349-
"C3 support requires BM control\n"));
344+
acpi_handle_debug(pr->handle,
345+
"C3 support requires BM control\n");
350346
return;
351347
} else {
352348
/* Here we enter C3 without bus mastering */
353-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
354-
"C3 support without BM control\n"));
349+
acpi_handle_debug(pr->handle,
350+
"C3 support without BM control\n");
355351
}
356352
}
357353
} else {
@@ -360,9 +356,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
360356
* supported on when bm_check is not required.
361357
*/
362358
if (!(acpi_gbl_FADT.flags & ACPI_FADT_WBINVD)) {
363-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
359+
acpi_handle_debug(pr->handle,
364360
"Cache invalidation should work properly"
365-
" for C3 to be enabled on SMP systems\n"));
361+
" for C3 to be enabled on SMP systems\n");
366362
return;
367363
}
368364
}
@@ -791,8 +787,8 @@ static inline void acpi_processor_cstate_first_run_checks(void)
791787
dmi_check_system(processor_power_dmi_table);
792788
max_cstate = acpi_processor_cstate_check(max_cstate);
793789
if (max_cstate < ACPI_C_STATES_MAX)
794-
pr_notice("ACPI: processor limited to max C-state %d\n",
795-
max_cstate);
790+
pr_notice("processor limited to max C-state %d\n", max_cstate);
791+
796792
first_run++;
797793

798794
if (nocst)
@@ -850,7 +846,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
850846

851847
status = acpi_evaluate_object(handle, "_LPI", NULL, &buffer);
852848
if (ACPI_FAILURE(status)) {
853-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _LPI, giving up\n"));
849+
acpi_handle_debug(handle, "No _LPI, giving up\n");
854850
return -ENODEV;
855851
}
856852

drivers/acpi/processor_pdc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
#include "internal.h"
1818

19-
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
20-
ACPI_MODULE_NAME("processor_pdc");
21-
2219
static bool __init processor_physically_present(acpi_handle handle)
2320
{
2421
int cpuid, type;
@@ -132,8 +129,8 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
132129
status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL);
133130

134131
if (ACPI_FAILURE(status))
135-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
136-
"Could not evaluate _PDC, using legacy perf. control.\n"));
132+
acpi_handle_debug(handle,
133+
"Could not evaluate _PDC, using legacy perf control\n");
137134

138135
return status;
139136
}

drivers/acpi/processor_perflib.c

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
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

2927
static 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

460462
int 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

Comments
 (0)