From 866d6cdf353ac81ca0a55d0ad4be91222d856336 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 19 Feb 2021 19:16:54 +0100 Subject: ACPI: PCI: Drop ACPI_PCI_COMPONENT that is not used any more After dropping all of the code using ACPI_PCI_COMPONENT drop the definition of it too and update the documentation to remove all ACPI_PCI_COMPONENT references from it. Signed-off-by: Rafael J. Wysocki Reviewed-by: Hanjun Guo --- Documentation/admin-guide/kernel-parameters.txt | 4 +--- Documentation/firmware-guide/acpi/debug.rst | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'Documentation') diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 04545725f187..bda4e8e96969 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -50,7 +50,7 @@ CONFIG_ACPI_DEBUG must be enabled to produce any ACPI debug output. Bits in debug_layer correspond to a _COMPONENT in an ACPI source file, e.g., - #define _COMPONENT ACPI_PCI_COMPONENT + #define _COMPONENT ACPI_EVENTS Bits in debug_level correspond to a level in ACPI_DEBUG_PRINT statements, e.g., ACPI_DEBUG_PRINT((ACPI_DB_INFO, ... @@ -60,8 +60,6 @@ Enable processor driver info messages: acpi.debug_layer=0x20000000 - Enable PCI/PCI interrupt routing info messages: - acpi.debug_layer=0x400000 Enable AML "Debug" output, i.e., stores to the Debug object while interpreting AML: acpi.debug_layer=0xffffffff acpi.debug_level=0x2 diff --git a/Documentation/firmware-guide/acpi/debug.rst b/Documentation/firmware-guide/acpi/debug.rst index 03cd4e25fc45..1b34e12dc53b 100644 --- a/Documentation/firmware-guide/acpi/debug.rst +++ b/Documentation/firmware-guide/acpi/debug.rst @@ -54,7 +54,6 @@ shows the supported mask values, currently these:: ACPI_TOOLS 0x00002000 ACPI_SBS_COMPONENT 0x00100000 ACPI_FAN_COMPONENT 0x00200000 - ACPI_PCI_COMPONENT 0x00400000 ACPI_CONTAINER_COMPONENT 0x01000000 ACPI_SYSTEM_COMPONENT 0x02000000 ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 @@ -127,10 +126,6 @@ AML) during boot:: acpi.debug_layer=0xffffffff acpi.debug_level=0x2 -Enable PCI and PCI interrupt routing debug messages:: - - acpi.debug_layer=0x400000 acpi.debug_level=0x4 - Enable all ACPI hardware-related messages:: acpi.debug_layer=0x2 acpi.debug_level=0xffffffff -- cgit v1.2.3 From 52af99c3f55ff0afd815eac0271db2e1751af55c Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 22 Feb 2021 19:59:13 +0100 Subject: ACPI: processor: Get rid of ACPICA message printing The ACPI_DEBUG_PRINT() and ACPI_EXCEPTION() macros are used for message printing in the ACPICA code and they should not be used elsewhere. Special configuration (either kernel command line or sysfs-based) is needed to see the messages printed by them and the format of those messages is also special and convoluted. For this reason, replace all of the ACPI_DEBUG_PRINT() and ACPI_EXCEPTION() instances in the ACPI processor driver with corresponding dev_*(), acpi_handle_*() and pr_*() calls depending on the context in which they appear. Also drop the ACPI_PROCESSOR_COMPONENT definition that is not going to be necessary any more. Signed-off-by: Rafael J. Wysocki Reviewed-by: Hanjun Guo --- Documentation/firmware-guide/acpi/debug.rst | 1 - drivers/acpi/acpi_processor.c | 33 +++------ drivers/acpi/processor_driver.c | 6 +- drivers/acpi/processor_idle.c | 34 ++++----- drivers/acpi/processor_pdc.c | 7 +- drivers/acpi/processor_perflib.c | 41 ++++++----- drivers/acpi/processor_throttling.c | 110 ++++++++++++++-------------- drivers/acpi/sysfs.c | 1 - include/acpi/acpi_drivers.h | 1 - 9 files changed, 108 insertions(+), 126 deletions(-) (limited to 'Documentation') diff --git a/Documentation/firmware-guide/acpi/debug.rst b/Documentation/firmware-guide/acpi/debug.rst index 03cd4e25fc45..54b36aca8903 100644 --- a/Documentation/firmware-guide/acpi/debug.rst +++ b/Documentation/firmware-guide/acpi/debug.rst @@ -58,7 +58,6 @@ shows the supported mask values, currently these:: ACPI_CONTAINER_COMPONENT 0x01000000 ACPI_SYSTEM_COMPONENT 0x02000000 ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 - ACPI_PROCESSOR_COMPONENT 0x20000000 debug_level =========== diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 2ee5e05a0d69..fc89f3a66ec2 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -22,10 +22,6 @@ #include "internal.h" -#define _COMPONENT ACPI_PROCESSOR_COMPONENT - -ACPI_MODULE_NAME("processor"); - DEFINE_PER_CPU(struct acpi_processor *, processors); EXPORT_PER_CPU_SYMBOL(processors); @@ -51,19 +47,19 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) switch (dev->revision) { case 0: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n")); + dev_dbg(&dev->dev, "Found PIIX4 A-step\n"); break; case 1: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 B-step\n")); + dev_dbg(&dev->dev, "Found PIIX4 B-step\n"); break; case 2: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4E\n")); + dev_dbg(&dev->dev, "Found PIIX4E\n"); break; case 3: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4M\n")); + dev_dbg(&dev->dev, "Found PIIX4M\n"); break; default: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unknown PIIX4\n")); + dev_dbg(&dev->dev, "Found unknown PIIX4\n"); break; } @@ -129,11 +125,9 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) } if (errata.piix4.bmisx) - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Bus master activity detection (BM-IDE) erratum enabled\n")); + dev_dbg(&dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n"); if (errata.piix4.fdma) - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Type-F DMA livelock erratum (C3 disabled)\n")); + dev_dbg(&dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n"); return 0; } @@ -244,11 +238,9 @@ static int acpi_processor_get_info(struct acpi_device *device) */ if (acpi_gbl_FADT.pm2_control_block && acpi_gbl_FADT.pm2_control_length) { pr->flags.bm_control = 1; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Bus mastering arbitration control present\n")); + dev_dbg(&device->dev, "Bus mastering arbitration control present\n"); } else - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "No bus mastering arbitration control\n")); + dev_dbg(&device->dev, "No bus mastering arbitration control\n"); if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) { /* Declared with "Processor" statement; match ProcessorID */ @@ -291,7 +283,7 @@ static int acpi_processor_get_info(struct acpi_device *device) pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration, pr->acpi_id); if (invalid_phys_cpuid(pr->phys_id)) - acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n"); + dev_dbg(&device->dev, "Failed to get CPU physical ID.\n"); pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id); if (!cpu0_initialized && !acpi_has_cpu_in_madt()) { @@ -328,11 +320,10 @@ static int acpi_processor_get_info(struct acpi_device *device) * CPU+CPU ID. */ sprintf(acpi_device_bid(device), "CPU%X", pr->id); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id, - pr->acpi_id)); + dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id); if (!object.processor.pblk_address) - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); + dev_dbg(&device->dev, "No PBLK (NULL address)\n"); else if (object.processor.pblk_length != 6) dev_err(&device->dev, "Invalid PBLK length [%d]\n", object.processor.pblk_length); diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 62114a03a51a..77541f939be3 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -28,9 +28,6 @@ #define ACPI_PROCESSOR_NOTIFY_POWER 0x81 #define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82 -#define _COMPONENT ACPI_PROCESSOR_COMPONENT -ACPI_MODULE_NAME("processor_driver"); - MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI Processor Driver"); MODULE_LICENSE("GPL"); @@ -87,8 +84,7 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) dev_name(&device->dev), event, 0); break; default: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Unsupported event [0x%x]\n", event)); + acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event); break; } diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 36dbcbc406b2..418f0e26f4dd 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -31,9 +31,6 @@ #include #endif -#define _COMPONENT ACPI_PROCESSOR_COMPONENT -ACPI_MODULE_NAME("processor_idle"); - #define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0) static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; @@ -239,8 +236,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) * 100 microseconds. */ if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency)); + acpi_handle_debug(pr->handle, "C2 latency too large [%d]\n", + acpi_gbl_FADT.c2_latency); /* invalidate C2 */ pr->power.states[ACPI_STATE_C2].address = 0; } @@ -250,16 +247,15 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) * 1000 microseconds. */ if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency)); + acpi_handle_debug(pr->handle, "C3 latency too large [%d]\n", + acpi_gbl_FADT.c3_latency); /* invalidate C3 */ pr->power.states[ACPI_STATE_C3].address = 0; } - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "lvl2[0x%08x] lvl3[0x%08x]\n", + acpi_handle_debug(pr->handle, "lvl2[0x%08x] lvl3[0x%08x]\n", pr->power.states[ACPI_STATE_C2].address, - pr->power.states[ACPI_STATE_C3].address)); + pr->power.states[ACPI_STATE_C3].address); snprintf(pr->power.states[ACPI_STATE_C2].desc, ACPI_CX_DESC_LEN, "ACPI P_LVL2 IOPORT 0x%x", @@ -324,8 +320,8 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, * devices thus we take the conservative approach. */ else if (errata.piix4.fdma) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C3 not supported on PIIX4 with Type-F DMA\n")); + acpi_handle_debug(pr->handle, + "C3 not supported on PIIX4 with Type-F DMA\n"); return; } @@ -344,13 +340,13 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, if (!pr->flags.bm_control) { if (pr->flags.has_cst != 1) { /* bus mastering control is necessary */ - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C3 support requires BM control\n")); + acpi_handle_debug(pr->handle, + "C3 support requires BM control\n"); return; } else { /* Here we enter C3 without bus mastering */ - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C3 support without BM control\n")); + acpi_handle_debug(pr->handle, + "C3 support without BM control\n"); } } } else { @@ -359,9 +355,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, * supported on when bm_check is not required. */ if (!(acpi_gbl_FADT.flags & ACPI_FADT_WBINVD)) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, + acpi_handle_debug(pr->handle, "Cache invalidation should work properly" - " for C3 to be enabled on SMP systems\n")); + " for C3 to be enabled on SMP systems\n"); return; } } @@ -843,7 +839,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle, status = acpi_evaluate_object(handle, "_LPI", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _LPI, giving up\n")); + acpi_handle_debug(handle, "No _LPI, giving up\n"); return -ENODEV; } diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c index 813f1b78c16a..8c3f82c9fff3 100644 --- a/drivers/acpi/processor_pdc.c +++ b/drivers/acpi/processor_pdc.c @@ -16,9 +16,6 @@ #include "internal.h" -#define _COMPONENT ACPI_PROCESSOR_COMPONENT -ACPI_MODULE_NAME("processor_pdc"); - static bool __init processor_physically_present(acpi_handle handle) { int cpuid, type; @@ -132,8 +129,8 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL); if (ACPI_FAILURE(status)) - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Could not evaluate _PDC, using legacy perf. control.\n")); + acpi_handle_debug(handle, + "Could not evaluate _PDC, using legacy perf control\n"); return status; } diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 91c401e2a4ca..e4032b7c3133 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -23,8 +23,6 @@ #define PREFIX "ACPI: " #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" -#define _COMPONENT ACPI_PROCESSOR_COMPONENT -ACPI_MODULE_NAME("processor_perflib"); static DEFINE_MUTEX(performance_mutex); @@ -70,7 +68,8 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) acpi_processor_ppc_in_use = true; if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC")); + acpi_handle_warn(pr->handle, "_PPC evaluation failed: %s\n", + acpi_format_exception(status)); return -ENODEV; } @@ -199,7 +198,8 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT")); + acpi_handle_warn(pr->handle, "_PCT evaluation failed: %s\n", + acpi_format_exception(status)); return -ENODEV; } @@ -299,7 +299,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS")); + acpi_handle_warn(pr->handle, "_PSS evaluation failed: %s\n", + acpi_format_exception(status)); return -ENODEV; } @@ -310,8 +311,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) goto end; } - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n", - pss->package.count)); + acpi_handle_debug(pr->handle, "Found %d performance states\n", + pss->package.count); pr->performance->state_count = pss->package.count; pr->performance->states = @@ -330,12 +331,13 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) state.length = sizeof(struct acpi_processor_px); state.pointer = px; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i)); + acpi_handle_debug(pr->handle, "Extracting state %d\n", i); status = acpi_extract_package(&(pss->package.elements[i]), &format, &state); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data")); + acpi_handle_warn(pr->handle, "Invalid _PSS data: %s\n", + acpi_format_exception(status)); result = -EFAULT; kfree(pr->performance->states); goto end; @@ -343,14 +345,14 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) amd_fixup_frequency(px, i); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, + acpi_handle_debug(pr->handle, "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n", i, (u32) px->core_frequency, (u32) px->power, (u32) px->transition_latency, (u32) px->bus_master_latency, - (u32) px->control, (u32) px->status)); + (u32) px->control, (u32) px->status); /* * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq @@ -400,8 +402,8 @@ int acpi_processor_get_performance_info(struct acpi_processor *pr) return -EINVAL; if (!acpi_has_method(pr->handle, "_PCT")) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "ACPI-based processor performance control unavailable\n")); + acpi_handle_debug(pr->handle, + "ACPI-based processor performance control unavailable\n"); return -ENODEV; } @@ -442,18 +444,17 @@ int acpi_processor_pstate_control(void) if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control) return 0; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Writing pstate_control [0x%x] to smi_command [0x%x]\n", - acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command)); + pr_debug("Writing pstate_control [0x%x] to smi_command [0x%x]\n", + acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command); status = acpi_os_write_port(acpi_gbl_FADT.smi_command, (u32)acpi_gbl_FADT.pstate_control, 8); if (ACPI_SUCCESS(status)) return 1; - ACPI_EXCEPTION((AE_INFO, status, - "Failed to write pstate_control [0x%x] to smi_command [0x%x]", - acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command)); + pr_warn("Failed to write pstate_control [0x%x] to smi_command [0x%x]: %s\n", + acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command, + acpi_format_exception(status)); return -EIO; } @@ -485,7 +486,7 @@ int acpi_processor_notify_smm(struct module *calling_module) result = acpi_processor_pstate_control(); if (!result) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_control\n")); + pr_debug("No SMI port or pstate_control\n"); module_put(calling_module); return 0; } diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index b1876534324b..fb6834cb0882 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -22,9 +22,6 @@ #define PREFIX "ACPI: " -#define _COMPONENT ACPI_PROCESSOR_COMPONENT -ACPI_MODULE_NAME("processor_throttling"); - /* ignore_tpc: * 0 -> acpi processor driver doesn't ignore _TPC values * 1 -> acpi processor driver ignores _TPC values @@ -196,10 +193,8 @@ err_ret: */ void acpi_processor_throttling_init(void) { - if (acpi_processor_update_tsd_coord()) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Assume no T-state coordination\n")); - } + if (acpi_processor_update_tsd_coord()) + pr_debug("Assume no T-state coordination\n"); return; } @@ -216,12 +211,13 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data) cpu = p_tstate->cpu; pr = per_cpu(processors, cpu); if (!pr) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid pr pointer\n")); + pr_debug("Invalid pr pointer\n"); return 0; } if (!pr->flags.throttling) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Throttling control is " - "unsupported on CPU %d\n", cpu)); + acpi_handle_debug(pr->handle, + "Throttling control unsupported on CPU %d\n", + cpu); return 0; } target_state = p_tstate->target_state; @@ -245,9 +241,9 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data) target_state = p_throttling->state_count - 1; } p_tstate->target_state = target_state; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PreChange Event:" - "target T-state of CPU %d is T%d\n", - cpu, target_state)); + acpi_handle_debug(pr->handle, + "PreChange Event: target T-state of CPU %d is T%d\n", + cpu, target_state); break; case THROTTLING_POSTCHANGE: /* @@ -255,9 +251,9 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data) * T-state flag of acpi_processor_throttling. */ p_throttling->state = target_state; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PostChange Event:" - "CPU %d is switched to T%d\n", - cpu, target_state)); + acpi_handle_debug(pr->handle, + "PostChange Event: CPU %d is switched to T%d\n", + cpu, target_state); break; default: printk(KERN_WARNING @@ -284,9 +280,11 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); - } + if (status != AE_NOT_FOUND) + acpi_handle_warn(pr->handle, + "_TPC evaluation failed: %s\n", + acpi_format_exception(status)); + return -ENODEV; } @@ -417,9 +415,11 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); - } + if (status != AE_NOT_FOUND) + acpi_handle_warn(pr->handle, + "_PTC evaluation failed: %s\n", + acpi_format_exception(status)); + return -ENODEV; } @@ -502,9 +502,11 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); - } + if (status != AE_NOT_FOUND) + acpi_handle_warn(pr->handle, + "_TSS evaluation failed: %s\n", + acpi_format_exception(status)); + return -ENODEV; } @@ -515,8 +517,8 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) goto end; } - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n", - tss->package.count)); + acpi_handle_debug(pr->handle, "Found %d throttling states\n", + tss->package.count); pr->throttling.state_count = tss->package.count; pr->throttling.states_tss = @@ -537,12 +539,13 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) state.length = sizeof(struct acpi_processor_tx_tss); state.pointer = tx; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i)); + acpi_handle_debug(pr->handle, "Extracting state %d\n", i); status = acpi_extract_package(&(tss->package.elements[i]), &format, &state); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Invalid _TSS data")); + acpi_handle_warn(pr->handle, "Invalid _TSS data: %s\n", + acpi_format_exception(status)); result = -EFAULT; kfree(pr->throttling.states_tss); goto end; @@ -582,9 +585,11 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD")); - } + if (status != AE_NOT_FOUND) + acpi_handle_warn(pr->handle, + "_TSD evaluation failed: %s\n", + acpi_format_exception(status)); + return -ENODEV; } @@ -698,9 +703,9 @@ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr) local_irq_enable(); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, + acpi_handle_debug(pr->handle, "Throttling state is T%d (%d%% throttling applied)\n", - state, pr->throttling.states[state].performance)); + state, pr->throttling.states[state].performance); return 0; } @@ -875,8 +880,8 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr) if (ret >= 0) { state = acpi_get_throttling_state(pr, value); if (state == -1) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Invalid throttling state, reset\n")); + acpi_handle_debug(pr->handle, + "Invalid throttling state, reset\n"); state = 0; ret = __acpi_processor_set_throttling(pr, state, true, true); @@ -921,10 +926,10 @@ static int acpi_processor_get_fadt_info(struct acpi_processor *pr) int i, step; if (!pr->throttling.address) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); + acpi_handle_debug(pr->handle, "No throttling register\n"); return -EINVAL; } else if (!pr->throttling.duty_width) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n")); + acpi_handle_debug(pr->handle, "No throttling states\n"); return -EINVAL; } /* TBD: Support duty_cycle values that span bit 4. */ @@ -1015,10 +1020,10 @@ static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr, local_irq_enable(); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, + acpi_handle_debug(pr->handle, "Throttling state set to T%d (%d%%)\n", state, (pr->throttling.states[state].performance ? pr-> - throttling.states[state].performance / 10 : 0))); + throttling.states[state].performance / 10 : 0)); return 0; } @@ -1129,8 +1134,8 @@ static int __acpi_processor_set_throttling(struct acpi_processor *pr, * error message and continue. */ if (!match_pr) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Invalid Pointer for CPU %d\n", i)); + acpi_handle_debug(pr->handle, + "Invalid Pointer for CPU %d\n", i); continue; } /* @@ -1138,9 +1143,8 @@ static int __acpi_processor_set_throttling(struct acpi_processor *pr, * we will report the error message and continue. */ if (!match_pr->flags.throttling) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Throttling Control is unsupported " - "on CPU %d\n", i)); + acpi_handle_debug(pr->handle, + "Throttling Control unsupported on CPU %d\n", i); continue; } @@ -1177,11 +1181,11 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) int result = 0; struct acpi_processor_throttling *pthrottling; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, + acpi_handle_debug(pr->handle, "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", pr->throttling.address, pr->throttling.duty_offset, - pr->throttling.duty_width)); + pr->throttling.duty_width); /* * Evaluate _PTC, _TSS and _TPC @@ -1221,13 +1225,13 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) * used this part. */ if (errata.piix4.throttle) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Throttling not supported on PIIX4 A- or B-step\n")); + acpi_handle_debug(pr->handle, + "Throttling not supported on PIIX4 A- or B-step\n"); return 0; } - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n", - pr->throttling.state_count)); + acpi_handle_debug(pr->handle, "Found %d throttling states\n", + pr->throttling.state_count); pr->flags.throttling = 1; @@ -1242,9 +1246,9 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) goto end; if (pr->throttling.state) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, + acpi_handle_debug(pr->handle, "Disabling throttling (was T%d)\n", - pr->throttling.state)); + pr->throttling.state); result = acpi_processor_set_throttling(pr, 0, false); if (result) goto end; diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 8baf7644a0d0..4974e9280dc0 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -58,7 +58,6 @@ static const struct acpi_dlayer acpi_debug_layers[] = { ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT), ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), - ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT), }; static const struct acpi_dlevel acpi_debug_levels[] = { diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 94d356fcc483..c6f0c41c4f5d 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -21,7 +21,6 @@ #define ACPI_CONTAINER_COMPONENT 0x01000000 #define ACPI_SYSTEM_COMPONENT 0x02000000 #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 -#define ACPI_PROCESSOR_COMPONENT 0x20000000 /* * _HID definitions -- cgit v1.2.3 From e6a55ccbd5647fcb44a6389682e8f522998a5773 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 22 Feb 2021 19:59:54 +0100 Subject: ACPI: sysfs: Get rid of ACPICA message printing Replace the only ACPI_EXCEPTION() instance in sysfs.c with a pr_warn() call, drop the _COMPONENT and ACPI_MODULE_NAME() definitions that are not used any more and drop the ACPI_SYSTEM_COMPONENT definition that would not be used any more in a meaningful way after the above changes. Signed-off-by: Rafael J. Wysocki Reviewed-by: Hanjun Guo --- Documentation/firmware-guide/acpi/debug.rst | 1 - drivers/acpi/sysfs.c | 7 +------ include/acpi/acpi_drivers.h | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) (limited to 'Documentation') diff --git a/Documentation/firmware-guide/acpi/debug.rst b/Documentation/firmware-guide/acpi/debug.rst index 0c979d8e45d7..6a6961c9d98a 100644 --- a/Documentation/firmware-guide/acpi/debug.rst +++ b/Documentation/firmware-guide/acpi/debug.rst @@ -55,7 +55,6 @@ shows the supported mask values, currently these:: ACPI_SBS_COMPONENT 0x00100000 ACPI_FAN_COMPONENT 0x00200000 ACPI_CONTAINER_COMPONENT 0x01000000 - ACPI_SYSTEM_COMPONENT 0x02000000 ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 debug_level diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 4f27d7820784..10f51490517d 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -12,9 +12,6 @@ #include "internal.h" -#define _COMPONENT ACPI_SYSTEM_COMPONENT -ACPI_MODULE_NAME("sysfs"); - #ifdef CONFIG_ACPI_DEBUG /* * ACPI debug sysfs I/F, including: @@ -55,7 +52,6 @@ static const struct acpi_dlayer acpi_debug_layers[] = { ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), - ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT), ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), }; @@ -650,8 +646,7 @@ static int get_status(u32 index, acpi_event_status *ret, if (index < num_gpes) { status = acpi_get_gpe_device(index, handle); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND, - "Invalid GPE 0x%x", index)); + pr_warn("Invalid GPE 0x%x", index); return -ENXIO; } status = acpi_get_gpe_status(*handle, index, ret); diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 97e9a066417d..b5bdb55e7def 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -18,7 +18,6 @@ #define ACPI_SBS_COMPONENT 0x00100000 #define ACPI_FAN_COMPONENT 0x00200000 #define ACPI_CONTAINER_COMPONENT 0x01000000 -#define ACPI_SYSTEM_COMPONENT 0x02000000 #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 /* -- cgit v1.2.3 From 3aadd86e5669f6bdb7c082e06c0ffadb4f987375 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 22 Feb 2021 20:00:43 +0100 Subject: ACPI: Drop unused ACPI_*_COMPONENT definitions and update documentation Drop the definitions of the following symbols: ACPI_SBS_COMPONENT ACPI_FAN_COMPONENT ACPI_CONTAINER_COMPONENT ACPI_MEMORY_DEVICE_COMPONENT that are not used in a meaningful way any more and update the ACPI debug documentation to avoid confusing users by making the impression that the ACPICA debug can be used for anything other than ACPICA itself, which is incorrect. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Hanjun Guo --- Documentation/firmware-guide/acpi/debug.rst | 29 ++++++++++++----------------- drivers/acpi/sysfs.c | 5 ----- include/acpi/acpi_drivers.h | 9 --------- 3 files changed, 12 insertions(+), 31 deletions(-) (limited to 'Documentation') diff --git a/Documentation/firmware-guide/acpi/debug.rst b/Documentation/firmware-guide/acpi/debug.rst index 6a6961c9d98a..0639c9de07f9 100644 --- a/Documentation/firmware-guide/acpi/debug.rst +++ b/Documentation/firmware-guide/acpi/debug.rst @@ -1,18 +1,17 @@ .. SPDX-License-Identifier: GPL-2.0 -================= -ACPI Debug Output -================= +==================== +ACPI CA Debug Output +==================== -The ACPI CA, the Linux ACPI core, and some ACPI drivers can generate debug -output. This document describes how to use this facility. +The ACPI CA can generate debug output. This document describes how to use this +facility. Compile-time configuration ========================== -ACPI debug output is globally enabled by CONFIG_ACPI_DEBUG. If this config -option is turned off, the debug messages are not even built into the -kernel. +The ACPI CA debug output is globally enabled by CONFIG_ACPI_DEBUG. If this +config option is not set, the debug messages are not even built into the kernel. Boot- and run-time configuration ================================ @@ -27,16 +26,16 @@ debug_layer (component) ======================= The "debug_layer" is a mask that selects components of interest, e.g., a -specific driver or part of the ACPI interpreter. To build the debug_layer -bitmask, look for the "#define _COMPONENT" in an ACPI source file. +specific part of the ACPI interpreter. To build the debug_layer bitmask, look +for the "#define _COMPONENT" in an ACPI source file. You can set the debug_layer mask at boot-time using the acpi.debug_layer command line argument, and you can change it after boot by writing values to /sys/module/acpi/parameters/debug_layer. -The possible components are defined in include/acpi/acoutput.h and -include/acpi/acpi_drivers.h. Reading /sys/module/acpi/parameters/debug_layer -shows the supported mask values, currently these:: +The possible components are defined in include/acpi/acoutput.h. + +Reading /sys/module/acpi/parameters/debug_layer shows the supported mask values:: ACPI_UTILITIES 0x00000001 ACPI_HARDWARE 0x00000002 @@ -52,10 +51,6 @@ shows the supported mask values, currently these:: ACPI_CA_DISASSEMBLER 0x00000800 ACPI_COMPILER 0x00001000 ACPI_TOOLS 0x00002000 - ACPI_SBS_COMPONENT 0x00100000 - ACPI_FAN_COMPONENT 0x00200000 - ACPI_CONTAINER_COMPONENT 0x01000000 - ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 debug_level =========== diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 10f51490517d..d25927195d6d 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -48,11 +48,6 @@ static const struct acpi_dlayer acpi_debug_layers[] = { ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER), ACPI_DEBUG_INIT(ACPI_COMPILER), ACPI_DEBUG_INIT(ACPI_TOOLS), - - ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), - ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), - ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), - ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), }; static const struct acpi_dlevel acpi_debug_levels[] = { diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index b5bdb55e7def..8372b0e7fd15 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -11,15 +11,6 @@ #define ACPI_MAX_STRING 80 -/* - * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst - * if you add to this list. - */ -#define ACPI_SBS_COMPONENT 0x00100000 -#define ACPI_FAN_COMPONENT 0x00200000 -#define ACPI_CONTAINER_COMPONENT 0x01000000 -#define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 - /* * _HID definitions * HIDs must conform to ACPI spec(6.1.4) -- cgit v1.2.3