Merge branches 'acpi-pci' and 'acpi-processor'

* acpi-pci:
  ACPI: PCI: Replace direct printk() invocations in pci_link.c
  ACPI: PCI: Drop ACPI_PCI_COMPONENT that is not used any more
  ACPI: PCI: Replace ACPI_DEBUG_PRINT() and ACPI_EXCEPTION()
  ACPI: PCI: IRQ: Consolidate printing diagnostic messages

* acpi-processor:
  ACPI: processor: perflib: Eliminate redundant status check
  ACPI: processor: Get rid of ACPICA message printing
  ACPI: processor: idle: Drop extra prefix from pr_notice()
  ACPI: processor: Remove initialization of static variable
This commit is contained in:
Rafael J. Wysocki
2021-04-26 17:03:05 +02:00
12 changed files with 201 additions and 259 deletions

View File

@@ -50,7 +50,7 @@
CONFIG_ACPI_DEBUG must be enabled to produce any ACPI CONFIG_ACPI_DEBUG must be enabled to produce any ACPI
debug output. Bits in debug_layer correspond to a debug output. Bits in debug_layer correspond to a
_COMPONENT in an ACPI source file, e.g., _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 Bits in debug_level correspond to a level in
ACPI_DEBUG_PRINT statements, e.g., ACPI_DEBUG_PRINT statements, e.g.,
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ... ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
@@ -60,8 +60,6 @@
Enable processor driver info messages: Enable processor driver info messages:
acpi.debug_layer=0x20000000 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 Enable AML "Debug" output, i.e., stores to the Debug
object while interpreting AML: object while interpreting AML:
acpi.debug_layer=0xffffffff acpi.debug_level=0x2 acpi.debug_layer=0xffffffff acpi.debug_level=0x2

View File

@@ -54,11 +54,9 @@ shows the supported mask values, currently these::
ACPI_TOOLS 0x00002000 ACPI_TOOLS 0x00002000
ACPI_SBS_COMPONENT 0x00100000 ACPI_SBS_COMPONENT 0x00100000
ACPI_FAN_COMPONENT 0x00200000 ACPI_FAN_COMPONENT 0x00200000
ACPI_PCI_COMPONENT 0x00400000
ACPI_CONTAINER_COMPONENT 0x01000000 ACPI_CONTAINER_COMPONENT 0x01000000
ACPI_SYSTEM_COMPONENT 0x02000000 ACPI_SYSTEM_COMPONENT 0x02000000
ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
ACPI_PROCESSOR_COMPONENT 0x20000000
debug_level debug_level
=========== ===========
@@ -127,10 +125,6 @@ AML) during boot::
acpi.debug_layer=0xffffffff acpi.debug_level=0x2 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:: Enable all ACPI hardware-related messages::
acpi.debug_layer=0x2 acpi.debug_level=0xffffffff acpi.debug_layer=0x2 acpi.debug_level=0xffffffff

View File

@@ -22,10 +22,6 @@
#include "internal.h" #include "internal.h"
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor");
DEFINE_PER_CPU(struct acpi_processor *, processors); DEFINE_PER_CPU(struct acpi_processor *, processors);
EXPORT_PER_CPU_SYMBOL(processors); EXPORT_PER_CPU_SYMBOL(processors);
@@ -51,19 +47,19 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
switch (dev->revision) { switch (dev->revision) {
case 0: case 0:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n")); dev_dbg(&dev->dev, "Found PIIX4 A-step\n");
break; break;
case 1: case 1:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 B-step\n")); dev_dbg(&dev->dev, "Found PIIX4 B-step\n");
break; break;
case 2: case 2:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4E\n")); dev_dbg(&dev->dev, "Found PIIX4E\n");
break; break;
case 3: case 3:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4M\n")); dev_dbg(&dev->dev, "Found PIIX4M\n");
break; break;
default: default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unknown PIIX4\n")); dev_dbg(&dev->dev, "Found unknown PIIX4\n");
break; break;
} }
@@ -129,11 +125,9 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
} }
if (errata.piix4.bmisx) if (errata.piix4.bmisx)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, dev_dbg(&dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n");
"Bus master activity detection (BM-IDE) erratum enabled\n"));
if (errata.piix4.fdma) if (errata.piix4.fdma)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, dev_dbg(&dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n");
"Type-F DMA livelock erratum (C3 disabled)\n"));
return 0; 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) { if (acpi_gbl_FADT.pm2_control_block && acpi_gbl_FADT.pm2_control_length) {
pr->flags.bm_control = 1; pr->flags.bm_control = 1;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, dev_dbg(&device->dev, "Bus mastering arbitration control present\n");
"Bus mastering arbitration control present\n"));
} else } else
ACPI_DEBUG_PRINT((ACPI_DB_INFO, dev_dbg(&device->dev, "No bus mastering arbitration control\n");
"No bus mastering arbitration control\n"));
if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) { if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) {
/* Declared with "Processor" statement; match ProcessorID */ /* 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->phys_id = acpi_get_phys_id(pr->handle, device_declaration,
pr->acpi_id); pr->acpi_id);
if (invalid_phys_cpuid(pr->phys_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); pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id);
if (!cpu0_initialized && !acpi_has_cpu_in_madt()) { 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. * CPU+CPU ID.
*/ */
sprintf(acpi_device_bid(device), "CPU%X", pr->id); sprintf(acpi_device_bid(device), "CPU%X", pr->id);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id, dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id);
pr->acpi_id));
if (!object.processor.pblk_address) 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) else if (object.processor.pblk_length != 6)
dev_err(&device->dev, "Invalid PBLK length [%d]\n", dev_err(&device->dev, "Invalid PBLK length [%d]\n",
object.processor.pblk_length); object.processor.pblk_length);

View File

@@ -9,6 +9,7 @@
* Bjorn Helgaas <bjorn.helgaas@hp.com> * Bjorn Helgaas <bjorn.helgaas@hp.com>
*/ */
#define pr_fmt(fmt) "ACPI: PCI: " fmt
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/kernel.h> #include <linux/kernel.h>
@@ -22,11 +23,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_PCI_COMPONENT
ACPI_MODULE_NAME("pci_irq");
struct acpi_prt_entry { struct acpi_prt_entry {
struct acpi_pci_id id; struct acpi_pci_id id;
u8 pin; u8 pin;
@@ -126,7 +122,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry,
entry->pin == quirk->pin && entry->pin == quirk->pin &&
!strcmp(prt->source, quirk->source) && !strcmp(prt->source, quirk->source) &&
strlen(prt->source) >= strlen(quirk->actual_source)) { strlen(prt->source) >= strlen(quirk->actual_source)) {
printk(KERN_WARNING PREFIX "firmware reports " pr_warn("Firmware reports "
"%04x:%02x:%02x PCI INT %c connected to %s; " "%04x:%02x:%02x PCI INT %c connected to %s; "
"changing to %s\n", "changing to %s\n",
entry->id.segment, entry->id.bus, entry->id.segment, entry->id.bus,
@@ -191,12 +187,9 @@ static int acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev,
* the IRQ value, which is hardwired to specific interrupt inputs on * the IRQ value, which is hardwired to specific interrupt inputs on
* the interrupt controller. * the interrupt controller.
*/ */
pr_debug("%04x:%02x:%02x[%c] -> %s[%d]\n",
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO, entry->id.segment, entry->id.bus, entry->id.device,
" %04x:%02x:%02x[%c] -> %s[%d]\n", pin_name(entry->pin), prt->source, entry->index);
entry->id.segment, entry->id.bus,
entry->id.device, pin_name(entry->pin),
prt->source, entry->index));
*entry_ptr = entry; *entry_ptr = entry;
@@ -307,8 +300,7 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
acpi_reroute_boot_interrupt(dev, entry); acpi_reroute_boot_interrupt(dev, entry);
#endif /* CONFIG_X86_IO_APIC */ #endif /* CONFIG_X86_IO_APIC */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n", dev_dbg(&dev->dev, "Found [%c] _PRT entry\n", pin_name(pin));
pci_name(dev), pin_name(pin)));
return entry; return entry;
} }
@@ -324,9 +316,7 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
/* PC card has the same IRQ as its cardbridge */ /* PC card has the same IRQ as its cardbridge */
bridge_pin = bridge->pin; bridge_pin = bridge->pin;
if (!bridge_pin) { if (!bridge_pin) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, dev_dbg(&bridge->dev, "No interrupt pin configured\n");
"No interrupt pin configured for device %s\n",
pci_name(bridge)));
return NULL; return NULL;
} }
pin = bridge_pin; pin = bridge_pin;
@@ -334,10 +324,8 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
ret = acpi_pci_irq_find_prt_entry(bridge, pin, &entry); ret = acpi_pci_irq_find_prt_entry(bridge, pin, &entry);
if (!ret && entry) { if (!ret && entry) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, dev_dbg(&dev->dev, "Derived GSI INT %c from %s\n",
"Derived GSI for %s INT %c from %s\n", pin_name(orig_pin), pci_name(bridge));
pci_name(dev), pin_name(orig_pin),
pci_name(bridge)));
return entry; return entry;
} }
@@ -413,9 +401,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
pin = dev->pin; pin = dev->pin;
if (!pin) { if (!pin) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, dev_dbg(&dev->dev, "No interrupt pin configured\n");
"No interrupt pin configured for device %s\n",
pci_name(dev)));
return 0; return 0;
} }

View File

@@ -12,6 +12,8 @@
* for IRQ management (e.g. start()->_SRS). * for IRQ management (e.g. start()->_SRS).
*/ */
#define pr_fmt(fmt) "ACPI: PCI: " fmt
#include <linux/syscore_ops.h> #include <linux/syscore_ops.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
@@ -27,8 +29,6 @@
#include "internal.h" #include "internal.h"
#define _COMPONENT ACPI_PCI_COMPONENT
ACPI_MODULE_NAME("pci_link");
#define ACPI_PCI_LINK_CLASS "pci_irq_routing" #define ACPI_PCI_LINK_CLASS "pci_irq_routing"
#define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link"
#define ACPI_PCI_LINK_MAX_POSSIBLE 16 #define ACPI_PCI_LINK_MAX_POSSIBLE 16
@@ -85,6 +85,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
void *context) void *context)
{ {
struct acpi_pci_link *link = context; struct acpi_pci_link *link = context;
acpi_handle handle = link->device->handle;
u32 i; u32 i;
switch (resource->type) { switch (resource->type) {
@@ -95,15 +96,15 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
{ {
struct acpi_resource_irq *p = &resource->data.irq; struct acpi_resource_irq *p = &resource->data.irq;
if (!p || !p->interrupt_count) { if (!p || !p->interrupt_count) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(handle,
"Blank _PRS IRQ resource\n")); "Blank _PRS IRQ resource\n");
return AE_OK; return AE_OK;
} }
for (i = 0; for (i = 0;
(i < p->interrupt_count (i < p->interrupt_count
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
if (!p->interrupts[i]) { if (!p->interrupts[i]) {
printk(KERN_WARNING PREFIX acpi_handle_debug(handle,
"Invalid _PRS IRQ %d\n", "Invalid _PRS IRQ %d\n",
p->interrupts[i]); p->interrupts[i]);
continue; continue;
@@ -121,7 +122,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
struct acpi_resource_extended_irq *p = struct acpi_resource_extended_irq *p =
&resource->data.extended_irq; &resource->data.extended_irq;
if (!p || !p->interrupt_count) { if (!p || !p->interrupt_count) {
printk(KERN_WARNING PREFIX acpi_handle_debug(handle,
"Blank _PRS EXT IRQ resource\n"); "Blank _PRS EXT IRQ resource\n");
return AE_OK; return AE_OK;
} }
@@ -129,7 +130,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
(i < p->interrupt_count (i < p->interrupt_count
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
if (!p->interrupts[i]) { if (!p->interrupts[i]) {
printk(KERN_WARNING PREFIX acpi_handle_debug(handle,
"Invalid _PRS IRQ %d\n", "Invalid _PRS IRQ %d\n",
p->interrupts[i]); p->interrupts[i]);
continue; continue;
@@ -143,7 +144,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
break; break;
} }
default: default:
printk(KERN_ERR PREFIX "_PRS resource type 0x%x isn't an IRQ\n", acpi_handle_debug(handle, "_PRS resource type 0x%x is not IRQ\n",
resource->type); resource->type);
return AE_OK; return AE_OK;
} }
@@ -153,18 +154,18 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
static int acpi_pci_link_get_possible(struct acpi_pci_link *link) static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
{ {
acpi_handle handle = link->device->handle;
acpi_status status; acpi_status status;
status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, status = acpi_walk_resources(handle, METHOD_NAME__PRS,
acpi_pci_link_check_possible, link); acpi_pci_link_check_possible, link);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_handle_debug(link->device->handle, "_PRS not present or invalid"); acpi_handle_debug(handle, "_PRS not present or invalid");
return 0; return 0;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(handle, "Found %d possible IRQs\n",
"Found %d possible IRQs\n", link->irq.possible_count);
link->irq.possible_count));
return 0; return 0;
} }
@@ -186,8 +187,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
* IRQ descriptors may have no IRQ# bits set, * IRQ descriptors may have no IRQ# bits set,
* particularly those those w/ _STA disabled * particularly those those w/ _STA disabled
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, pr_debug("Blank _CRS IRQ resource\n");
"Blank _CRS IRQ resource\n"));
return AE_OK; return AE_OK;
} }
*irq = p->interrupts[0]; *irq = p->interrupts[0];
@@ -202,8 +202,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
* extended IRQ descriptors must * extended IRQ descriptors must
* return at least 1 IRQ * return at least 1 IRQ
*/ */
printk(KERN_WARNING PREFIX pr_debug("Blank _CRS EXT IRQ resource\n");
"Blank _CRS EXT IRQ resource\n");
return AE_OK; return AE_OK;
} }
*irq = p->interrupts[0]; *irq = p->interrupts[0];
@@ -211,7 +210,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
} }
break; break;
default: default:
printk(KERN_ERR PREFIX "_CRS resource type 0x%x isn't an IRQ\n", pr_debug("_CRS resource type 0x%x is not IRQ\n",
resource->type); resource->type);
return AE_OK; return AE_OK;
} }
@@ -228,8 +227,9 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
*/ */
static int acpi_pci_link_get_current(struct acpi_pci_link *link) static int acpi_pci_link_get_current(struct acpi_pci_link *link)
{ {
int result = 0; acpi_handle handle = link->device->handle;
acpi_status status; acpi_status status;
int result = 0;
int irq = 0; int irq = 0;
link->irq.active = 0; link->irq.active = 0;
@@ -239,12 +239,12 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
/* Query _STA, set link->device->status */ /* Query _STA, set link->device->status */
result = acpi_bus_get_status(link->device); result = acpi_bus_get_status(link->device);
if (result) { if (result) {
printk(KERN_ERR PREFIX "Unable to read status\n"); acpi_handle_err(handle, "Unable to read status\n");
goto end; goto end;
} }
if (!link->device->status.enabled) { if (!link->device->status.enabled) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n")); acpi_handle_debug(handle, "Link disabled\n");
return 0; return 0;
} }
} }
@@ -253,22 +253,23 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
* Query and parse _CRS to get the current IRQ assignment. * Query and parse _CRS to get the current IRQ assignment.
*/ */
status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, status = acpi_walk_resources(handle, METHOD_NAME__CRS,
acpi_pci_link_check_current, &irq); acpi_pci_link_check_current, &irq);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS")); acpi_handle_warn(handle, "_CRS evaluation failed: %s\n",
acpi_format_exception(status));
result = -ENODEV; result = -ENODEV;
goto end; goto end;
} }
if (acpi_strict && !irq) { if (acpi_strict && !irq) {
printk(KERN_ERR PREFIX "_CRS returned 0\n"); acpi_handle_err(handle, "_CRS returned 0\n");
result = -ENODEV; result = -ENODEV;
} }
link->irq.active = irq; link->irq.active = irq;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); acpi_handle_debug(handle, "Link at IRQ %d \n", link->irq.active);
end: end:
return result; return result;
@@ -276,13 +277,14 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
{ {
int result;
acpi_status status;
struct { struct {
struct acpi_resource res; struct acpi_resource res;
struct acpi_resource end; struct acpi_resource end;
} *resource; } *resource;
struct acpi_buffer buffer = { 0, NULL }; struct acpi_buffer buffer = { 0, NULL };
acpi_handle handle = link->device->handle;
acpi_status status;
int result;
if (!irq) if (!irq)
return -EINVAL; return -EINVAL;
@@ -329,7 +331,8 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
/* ignore resource_source, it's optional */ /* ignore resource_source, it's optional */
break; break;
default: default:
printk(KERN_ERR PREFIX "Invalid Resource_type %d\n", link->irq.resource_type); acpi_handle_err(handle, "Invalid resource type %d\n",
link->irq.resource_type);
result = -EINVAL; result = -EINVAL;
goto end; goto end;
@@ -342,7 +345,8 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
/* check for total failure */ /* check for total failure */
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS")); acpi_handle_warn(handle, "_SRS evaluation failed: %s",
acpi_format_exception(status));
result = -ENODEV; result = -ENODEV;
goto end; goto end;
} }
@@ -350,15 +354,11 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
/* Query _STA, set device->status */ /* Query _STA, set device->status */
result = acpi_bus_get_status(link->device); result = acpi_bus_get_status(link->device);
if (result) { if (result) {
printk(KERN_ERR PREFIX "Unable to read status\n"); acpi_handle_err(handle, "Unable to read status\n");
goto end; goto end;
} }
if (!link->device->status.enabled) { if (!link->device->status.enabled)
printk(KERN_WARNING PREFIX acpi_handle_warn(handle, "Disabled and referenced, BIOS bug\n");
"%s [%s] disabled and referenced, BIOS bug\n",
acpi_device_name(link->device),
acpi_device_bid(link->device));
}
/* Query _CRS, set link->irq.active */ /* Query _CRS, set link->irq.active */
result = acpi_pci_link_get_current(link); result = acpi_pci_link_get_current(link);
@@ -375,14 +375,12 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
* policy: when _CRS doesn't return what we just _SRS * policy: when _CRS doesn't return what we just _SRS
* assume _SRS worked and override _CRS value. * assume _SRS worked and override _CRS value.
*/ */
printk(KERN_WARNING PREFIX acpi_handle_warn(handle, "BIOS reported IRQ %d, using IRQ %d\n",
"%s [%s] BIOS reported IRQ %d, using IRQ %d\n", link->irq.active, irq);
acpi_device_name(link->device),
acpi_device_bid(link->device), link->irq.active, irq);
link->irq.active = irq; link->irq.active = irq;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active)); acpi_handle_debug(handle, "Set IRQ %d\n", link->irq.active);
end: end:
kfree(resource); kfree(resource);
@@ -531,6 +529,7 @@ static int acpi_irq_balance = -1; /* 0: static, 1: balance */
static int acpi_pci_link_allocate(struct acpi_pci_link *link) static int acpi_pci_link_allocate(struct acpi_pci_link *link)
{ {
acpi_handle handle = link->device->handle;
int irq; int irq;
int i; int i;
@@ -553,8 +552,8 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
*/ */
if (i == link->irq.possible_count) { if (i == link->irq.possible_count) {
if (acpi_strict) if (acpi_strict)
printk(KERN_WARNING PREFIX "_CRS %d not found" acpi_handle_warn(handle, "_CRS %d not found in _PRS\n",
" in _PRS\n", link->irq.active); link->irq.active);
link->irq.active = 0; link->irq.active = 0;
} }
@@ -578,28 +577,23 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
} }
} }
if (acpi_irq_get_penalty(irq) >= PIRQ_PENALTY_ISA_ALWAYS) { if (acpi_irq_get_penalty(irq) >= PIRQ_PENALTY_ISA_ALWAYS) {
printk(KERN_ERR PREFIX "No IRQ available for %s [%s]. " acpi_handle_err(handle,
"Try pci=noacpi or acpi=off\n", "No IRQ available. Try pci=noacpi or acpi=off\n");
acpi_device_name(link->device),
acpi_device_bid(link->device));
return -ENODEV; return -ENODEV;
} }
/* Attempt to enable the link device at this IRQ. */ /* Attempt to enable the link device at this IRQ. */
if (acpi_pci_link_set(link, irq)) { if (acpi_pci_link_set(link, irq)) {
printk(KERN_ERR PREFIX "Unable to set IRQ for %s [%s]. " acpi_handle_err(handle,
"Try pci=noacpi or acpi=off\n", "Unable to set IRQ. Try pci=noacpi or acpi=off\n");
acpi_device_name(link->device),
acpi_device_bid(link->device));
return -ENODEV; return -ENODEV;
} else { } else {
if (link->irq.active < ACPI_MAX_ISA_IRQS) if (link->irq.active < ACPI_MAX_ISA_IRQS)
acpi_isa_irq_penalty[link->irq.active] += acpi_isa_irq_penalty[link->irq.active] +=
PIRQ_PENALTY_PCI_USING; PIRQ_PENALTY_PCI_USING;
pr_info("%s [%s] enabled at IRQ %d\n", acpi_handle_info(handle, "Enabled at IRQ %d\n",
acpi_device_name(link->device), link->irq.active);
acpi_device_bid(link->device), link->irq.active);
} }
link->irq.initialized = 1; link->irq.initialized = 1;
@@ -620,19 +614,19 @@ int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
result = acpi_bus_get_device(handle, &device); result = acpi_bus_get_device(handle, &device);
if (result) { if (result) {
printk(KERN_ERR PREFIX "Invalid link device\n"); acpi_handle_err(handle, "Invalid link device\n");
return -1; return -1;
} }
link = acpi_driver_data(device); link = acpi_driver_data(device);
if (!link) { if (!link) {
printk(KERN_ERR PREFIX "Invalid link context\n"); acpi_handle_err(handle, "Invalid link context\n");
return -1; return -1;
} }
/* TBD: Support multiple index (IRQ) entries per Link Device */ /* TBD: Support multiple index (IRQ) entries per Link Device */
if (index) { if (index) {
printk(KERN_ERR PREFIX "Invalid index %d\n", index); acpi_handle_err(handle, "Invalid index %d\n", index);
return -1; return -1;
} }
@@ -644,7 +638,7 @@ int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
if (!link->irq.active) { if (!link->irq.active) {
mutex_unlock(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
printk(KERN_ERR PREFIX "Link active IRQ is 0!\n"); acpi_handle_err(handle, "Link active IRQ is 0!\n");
return -1; return -1;
} }
link->refcnt++; link->refcnt++;
@@ -656,9 +650,7 @@ int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
*polarity = link->irq.polarity; *polarity = link->irq.polarity;
if (name) if (name)
*name = acpi_device_bid(link->device); *name = acpi_device_bid(link->device);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(handle, "Link is referenced\n");
"Link %s is referenced\n",
acpi_device_bid(link->device)));
return link->irq.active; return link->irq.active;
} }
@@ -674,20 +666,20 @@ int acpi_pci_link_free_irq(acpi_handle handle)
result = acpi_bus_get_device(handle, &device); result = acpi_bus_get_device(handle, &device);
if (result) { if (result) {
printk(KERN_ERR PREFIX "Invalid link device\n"); acpi_handle_err(handle, "Invalid link device\n");
return -1; return -1;
} }
link = acpi_driver_data(device); link = acpi_driver_data(device);
if (!link) { if (!link) {
printk(KERN_ERR PREFIX "Invalid link context\n"); acpi_handle_err(handle, "Invalid link context\n");
return -1; return -1;
} }
mutex_lock(&acpi_link_lock); mutex_lock(&acpi_link_lock);
if (!link->irq.initialized) { if (!link->irq.initialized) {
mutex_unlock(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
printk(KERN_ERR PREFIX "Link isn't initialized\n"); acpi_handle_err(handle, "Link isn't initialized\n");
return -1; return -1;
} }
#ifdef FUTURE_USE #ifdef FUTURE_USE
@@ -702,9 +694,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
*/ */
link->refcnt--; link->refcnt--;
#endif #endif
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(handle, "Link is dereferenced\n");
"Link %s is dereferenced\n",
acpi_device_bid(link->device)));
if (link->refcnt == 0) if (link->refcnt == 0)
acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL); acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL);
@@ -720,10 +710,10 @@ int acpi_pci_link_free_irq(acpi_handle handle)
static int acpi_pci_link_add(struct acpi_device *device, static int acpi_pci_link_add(struct acpi_device *device,
const struct acpi_device_id *not_used) const struct acpi_device_id *not_used)
{ {
int result; acpi_handle handle = device->handle;
struct acpi_pci_link *link; struct acpi_pci_link *link;
int result;
int i; int i;
int found = 0;
link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL);
if (!link) if (!link)
@@ -742,31 +732,23 @@ static int acpi_pci_link_add(struct acpi_device *device,
/* query and set link->irq.active */ /* query and set link->irq.active */
acpi_pci_link_get_current(link); acpi_pci_link_get_current(link);
printk(KERN_INFO PREFIX "%s [%s] (IRQs", acpi_device_name(device), pr_info("Interrupt link %s configured for IRQ %d\n",
acpi_device_bid(device)); acpi_device_bid(device), link->irq.active);
for (i = 0; i < link->irq.possible_count; i++) { for (i = 0; i < link->irq.possible_count; i++) {
if (link->irq.active == link->irq.possible[i]) { if (link->irq.active != link->irq.possible[i])
printk(KERN_CONT " *%d", link->irq.possible[i]); acpi_handle_debug(handle, "Possible IRQ %d\n",
found = 1; link->irq.possible[i]);
} else
printk(KERN_CONT " %d", link->irq.possible[i]);
} }
printk(KERN_CONT ")");
if (!found)
printk(KERN_CONT " *%d", link->irq.active);
if (!link->device->status.enabled) if (!link->device->status.enabled)
printk(KERN_CONT ", disabled."); pr_info("Interrupt link %s disabled\n", acpi_device_bid(device));
printk(KERN_CONT "\n");
list_add_tail(&link->list, &acpi_link_list); list_add_tail(&link->list, &acpi_link_list);
end: end:
/* disable all links -- to be activated on use */ /* disable all links -- to be activated on use */
acpi_evaluate_object(device->handle, "_DIS", NULL, NULL); acpi_evaluate_object(handle, "_DIS", NULL, NULL);
mutex_unlock(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
if (result) if (result)

View File

@@ -28,9 +28,6 @@
#define ACPI_PROCESSOR_NOTIFY_POWER 0x81 #define ACPI_PROCESSOR_NOTIFY_POWER 0x81
#define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82 #define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_driver");
MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION("ACPI Processor Driver"); MODULE_DESCRIPTION("ACPI Processor Driver");
MODULE_LICENSE("GPL"); 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); dev_name(&device->dev), event, 0);
break; break;
default: default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event);
"Unsupported event [0x%x]\n", event));
break; break;
} }

View File

@@ -32,9 +32,6 @@
#include <asm/cpu.h> #include <asm/cpu.h>
#endif #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) #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; 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)
* 100 microseconds. * 100 microseconds.
*/ */
if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle, "C2 latency too large [%d]\n",
"C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency)); acpi_gbl_FADT.c2_latency);
/* invalidate C2 */ /* invalidate C2 */
pr->power.states[ACPI_STATE_C2].address = 0; pr->power.states[ACPI_STATE_C2].address = 0;
} }
@@ -251,16 +248,15 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
* 1000 microseconds. * 1000 microseconds.
*/ */
if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle, "C3 latency too large [%d]\n",
"C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency)); acpi_gbl_FADT.c3_latency);
/* invalidate C3 */ /* invalidate C3 */
pr->power.states[ACPI_STATE_C3].address = 0; pr->power.states[ACPI_STATE_C3].address = 0;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle, "lvl2[0x%08x] lvl3[0x%08x]\n",
"lvl2[0x%08x] lvl3[0x%08x]\n",
pr->power.states[ACPI_STATE_C2].address, 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, snprintf(pr->power.states[ACPI_STATE_C2].desc,
ACPI_CX_DESC_LEN, "ACPI P_LVL2 IOPORT 0x%x", 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,
* devices thus we take the conservative approach. * devices thus we take the conservative approach.
*/ */
else if (errata.piix4.fdma) { else if (errata.piix4.fdma) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"C3 not supported on PIIX4 with Type-F DMA\n")); "C3 not supported on PIIX4 with Type-F DMA\n");
return; return;
} }
@@ -345,13 +341,13 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
if (!pr->flags.bm_control) { if (!pr->flags.bm_control) {
if (pr->flags.has_cst != 1) { if (pr->flags.has_cst != 1) {
/* bus mastering control is necessary */ /* bus mastering control is necessary */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"C3 support requires BM control\n")); "C3 support requires BM control\n");
return; return;
} else { } else {
/* Here we enter C3 without bus mastering */ /* Here we enter C3 without bus mastering */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"C3 support without BM control\n")); "C3 support without BM control\n");
} }
} }
} else { } else {
@@ -360,9 +356,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
* supported on when bm_check is not required. * supported on when bm_check is not required.
*/ */
if (!(acpi_gbl_FADT.flags & ACPI_FADT_WBINVD)) { if (!(acpi_gbl_FADT.flags & ACPI_FADT_WBINVD)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Cache invalidation should work properly" "Cache invalidation should work properly"
" for C3 to be enabled on SMP systems\n")); " for C3 to be enabled on SMP systems\n");
return; return;
} }
} }
@@ -789,8 +785,8 @@ static inline void acpi_processor_cstate_first_run_checks(void)
dmi_check_system(processor_power_dmi_table); dmi_check_system(processor_power_dmi_table);
max_cstate = acpi_processor_cstate_check(max_cstate); max_cstate = acpi_processor_cstate_check(max_cstate);
if (max_cstate < ACPI_C_STATES_MAX) if (max_cstate < ACPI_C_STATES_MAX)
pr_notice("ACPI: processor limited to max C-state %d\n", pr_notice("processor limited to max C-state %d\n", max_cstate);
max_cstate);
first_run++; first_run++;
if (nocst) if (nocst)
@@ -848,7 +844,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
status = acpi_evaluate_object(handle, "_LPI", NULL, &buffer); status = acpi_evaluate_object(handle, "_LPI", NULL, &buffer);
if (ACPI_FAILURE(status)) { 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; return -ENODEV;
} }

View File

@@ -16,9 +16,6 @@
#include "internal.h" #include "internal.h"
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_pdc");
static bool __init processor_physically_present(acpi_handle handle) static bool __init processor_physically_present(acpi_handle handle)
{ {
int cpuid, type; 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); status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(handle,
"Could not evaluate _PDC, using legacy perf. control.\n")); "Could not evaluate _PDC, using legacy perf control\n");
return status; return status;
} }

View File

@@ -23,8 +23,6 @@
#define PREFIX "ACPI: " #define PREFIX "ACPI: "
#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_perflib");
static DEFINE_MUTEX(performance_mutex); static DEFINE_MUTEX(performance_mutex);
@@ -65,14 +63,16 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
* (e.g. 0 = states 0..n; 1 = states 1..n; etc. * (e.g. 0 = states 0..n; 1 = states 1..n; etc.
*/ */
status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc); status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc);
if (status != AE_NOT_FOUND) {
if (status != AE_NOT_FOUND)
acpi_processor_ppc_in_use = true; acpi_processor_ppc_in_use = true;
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC")); acpi_handle_warn(pr->handle,
"_PPC evaluation failed: %s\n",
acpi_format_exception(status));
return -ENODEV; return -ENODEV;
} }
}
pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id, pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id,
(int)ppc, ppc ? "" : "not"); (int)ppc, ppc ? "" : "not");
@@ -199,7 +199,8 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
if (ACPI_FAILURE(status)) { 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; return -ENODEV;
} }
@@ -299,7 +300,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
if (ACPI_FAILURE(status)) { 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; return -ENODEV;
} }
@@ -310,8 +312,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
goto end; goto end;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n", acpi_handle_debug(pr->handle, "Found %d performance states\n",
pss->package.count)); pss->package.count);
pr->performance->state_count = pss->package.count; pr->performance->state_count = pss->package.count;
pr->performance->states = pr->performance->states =
@@ -330,12 +332,13 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
state.length = sizeof(struct acpi_processor_px); state.length = sizeof(struct acpi_processor_px);
state.pointer = 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]), status = acpi_extract_package(&(pss->package.elements[i]),
&format, &state); &format, &state);
if (ACPI_FAILURE(status)) { 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; result = -EFAULT;
kfree(pr->performance->states); kfree(pr->performance->states);
goto end; goto end;
@@ -343,14 +346,14 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
amd_fixup_frequency(px, i); 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", "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n",
i, i,
(u32) px->core_frequency, (u32) px->core_frequency,
(u32) px->power, (u32) px->power,
(u32) px->transition_latency, (u32) px->transition_latency,
(u32) px->bus_master_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 * 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)
return -EINVAL; return -EINVAL;
if (!acpi_has_method(pr->handle, "_PCT")) { if (!acpi_has_method(pr->handle, "_PCT")) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"ACPI-based processor performance control unavailable\n")); "ACPI-based processor performance control unavailable\n");
return -ENODEV; return -ENODEV;
} }
@@ -442,24 +445,23 @@ int acpi_processor_pstate_control(void)
if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control) if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control)
return 0; return 0;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, pr_debug("Writing pstate_control [0x%x] to smi_command [0x%x]\n",
"Writing pstate_control [0x%x] to smi_command [0x%x]\n", acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command);
acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
status = acpi_os_write_port(acpi_gbl_FADT.smi_command, status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
(u32)acpi_gbl_FADT.pstate_control, 8); (u32)acpi_gbl_FADT.pstate_control, 8);
if (ACPI_SUCCESS(status)) if (ACPI_SUCCESS(status))
return 1; return 1;
ACPI_EXCEPTION((AE_INFO, status, pr_warn("Failed to write pstate_control [0x%x] to smi_command [0x%x]: %s\n",
"Failed to write pstate_control [0x%x] to smi_command [0x%x]", acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command,
acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command)); acpi_format_exception(status));
return -EIO; return -EIO;
} }
int acpi_processor_notify_smm(struct module *calling_module) int acpi_processor_notify_smm(struct module *calling_module)
{ {
static int is_done = 0; static int is_done;
int result; int result;
if (!acpi_processor_cpufreq_init) if (!acpi_processor_cpufreq_init)
@@ -485,7 +487,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
result = acpi_processor_pstate_control(); result = acpi_processor_pstate_control();
if (!result) { 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); module_put(calling_module);
return 0; return 0;
} }

View File

@@ -22,9 +22,6 @@
#define PREFIX "ACPI: " #define PREFIX "ACPI: "
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_throttling");
/* ignore_tpc: /* ignore_tpc:
* 0 -> acpi processor driver doesn't ignore _TPC values * 0 -> acpi processor driver doesn't ignore _TPC values
* 1 -> acpi processor driver ignores _TPC values * 1 -> acpi processor driver ignores _TPC values
@@ -196,10 +193,8 @@ err_ret:
*/ */
void acpi_processor_throttling_init(void) void acpi_processor_throttling_init(void)
{ {
if (acpi_processor_update_tsd_coord()) { if (acpi_processor_update_tsd_coord())
ACPI_DEBUG_PRINT((ACPI_DB_INFO, pr_debug("Assume no T-state coordination\n");
"Assume no T-state coordination\n"));
}
return; return;
} }
@@ -216,12 +211,13 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
cpu = p_tstate->cpu; cpu = p_tstate->cpu;
pr = per_cpu(processors, cpu); pr = per_cpu(processors, cpu);
if (!pr) { if (!pr) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid pr pointer\n")); pr_debug("Invalid pr pointer\n");
return 0; return 0;
} }
if (!pr->flags.throttling) { if (!pr->flags.throttling) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Throttling control is " acpi_handle_debug(pr->handle,
"unsupported on CPU %d\n", cpu)); "Throttling control unsupported on CPU %d\n",
cpu);
return 0; return 0;
} }
target_state = p_tstate->target_state; 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; target_state = p_throttling->state_count - 1;
} }
p_tstate->target_state = target_state; p_tstate->target_state = target_state;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PreChange Event:" acpi_handle_debug(pr->handle,
"target T-state of CPU %d is T%d\n", "PreChange Event: target T-state of CPU %d is T%d\n",
cpu, target_state)); cpu, target_state);
break; break;
case THROTTLING_POSTCHANGE: 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. * T-state flag of acpi_processor_throttling.
*/ */
p_throttling->state = target_state; p_throttling->state = target_state;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PostChange Event:" acpi_handle_debug(pr->handle,
"CPU %d is switched to T%d\n", "PostChange Event: CPU %d is switched to T%d\n",
cpu, target_state)); cpu, target_state);
break; break;
default: default:
printk(KERN_WARNING 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); status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) { if (status != AE_NOT_FOUND)
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); acpi_handle_warn(pr->handle,
} "_TPC evaluation failed: %s\n",
acpi_format_exception(status));
return -ENODEV; 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); status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) { if (status != AE_NOT_FOUND)
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); acpi_handle_warn(pr->handle,
} "_PTC evaluation failed: %s\n",
acpi_format_exception(status));
return -ENODEV; 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); status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) { if (status != AE_NOT_FOUND)
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); acpi_handle_warn(pr->handle,
} "_TSS evaluation failed: %s\n",
acpi_format_exception(status));
return -ENODEV; return -ENODEV;
} }
@@ -515,8 +517,8 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
goto end; goto end;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n", acpi_handle_debug(pr->handle, "Found %d throttling states\n",
tss->package.count)); tss->package.count);
pr->throttling.state_count = tss->package.count; pr->throttling.state_count = tss->package.count;
pr->throttling.states_tss = 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.length = sizeof(struct acpi_processor_tx_tss);
state.pointer = tx; 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]), status = acpi_extract_package(&(tss->package.elements[i]),
&format, &state); &format, &state);
if (ACPI_FAILURE(status)) { 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; result = -EFAULT;
kfree(pr->throttling.states_tss); kfree(pr->throttling.states_tss);
goto end; 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); status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) { if (status != AE_NOT_FOUND)
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD")); acpi_handle_warn(pr->handle,
} "_TSD evaluation failed: %s\n",
acpi_format_exception(status));
return -ENODEV; return -ENODEV;
} }
@@ -698,9 +703,9 @@ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr)
local_irq_enable(); local_irq_enable();
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Throttling state is T%d (%d%% throttling applied)\n", "Throttling state is T%d (%d%% throttling applied)\n",
state, pr->throttling.states[state].performance)); state, pr->throttling.states[state].performance);
return 0; return 0;
} }
@@ -875,8 +880,8 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
if (ret >= 0) { if (ret >= 0) {
state = acpi_get_throttling_state(pr, value); state = acpi_get_throttling_state(pr, value);
if (state == -1) { if (state == -1) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Invalid throttling state, reset\n")); "Invalid throttling state, reset\n");
state = 0; state = 0;
ret = __acpi_processor_set_throttling(pr, state, true, ret = __acpi_processor_set_throttling(pr, state, true,
true); true);
@@ -921,10 +926,10 @@ static int acpi_processor_get_fadt_info(struct acpi_processor *pr)
int i, step; int i, step;
if (!pr->throttling.address) { 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; return -EINVAL;
} else if (!pr->throttling.duty_width) { } 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; return -EINVAL;
} }
/* TBD: Support duty_cycle values that span bit 4. */ /* 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(); local_irq_enable();
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Throttling state set to T%d (%d%%)\n", state, "Throttling state set to T%d (%d%%)\n", state,
(pr->throttling.states[state].performance ? pr-> (pr->throttling.states[state].performance ? pr->
throttling.states[state].performance / 10 : 0))); throttling.states[state].performance / 10 : 0));
return 0; return 0;
} }
@@ -1129,8 +1134,8 @@ static int __acpi_processor_set_throttling(struct acpi_processor *pr,
* error message and continue. * error message and continue.
*/ */
if (!match_pr) { if (!match_pr) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Invalid Pointer for CPU %d\n", i)); "Invalid Pointer for CPU %d\n", i);
continue; continue;
} }
/* /*
@@ -1138,9 +1143,8 @@ static int __acpi_processor_set_throttling(struct acpi_processor *pr,
* we will report the error message and continue. * we will report the error message and continue.
*/ */
if (!match_pr->flags.throttling) { if (!match_pr->flags.throttling) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Throttling Control is unsupported " "Throttling Control unsupported on CPU %d\n", i);
"on CPU %d\n", i));
continue; continue;
} }
@@ -1177,11 +1181,11 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
int result = 0; int result = 0;
struct acpi_processor_throttling *pthrottling; 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", "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
pr->throttling.address, pr->throttling.address,
pr->throttling.duty_offset, pr->throttling.duty_offset,
pr->throttling.duty_width)); pr->throttling.duty_width);
/* /*
* Evaluate _PTC, _TSS and _TPC * Evaluate _PTC, _TSS and _TPC
@@ -1221,13 +1225,13 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
* used this part. * used this part.
*/ */
if (errata.piix4.throttle) { if (errata.piix4.throttle) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Throttling not supported on PIIX4 A- or B-step\n")); "Throttling not supported on PIIX4 A- or B-step\n");
return 0; return 0;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n", acpi_handle_debug(pr->handle, "Found %d throttling states\n",
pr->throttling.state_count)); pr->throttling.state_count);
pr->flags.throttling = 1; pr->flags.throttling = 1;
@@ -1242,9 +1246,9 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
goto end; goto end;
if (pr->throttling.state) { if (pr->throttling.state) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_debug(pr->handle,
"Disabling throttling (was T%d)\n", "Disabling throttling (was T%d)\n",
pr->throttling.state)); pr->throttling.state);
result = acpi_processor_set_throttling(pr, 0, false); result = acpi_processor_set_throttling(pr, 0, false);
if (result) if (result)
goto end; goto end;

View File

@@ -54,11 +54,9 @@ static const struct acpi_dlayer acpi_debug_layers[] = {
ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT),
ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT),
ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT),
ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT),
ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT), ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT),
ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT),
ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT),
}; };
static const struct acpi_dlevel acpi_debug_levels[] = { static const struct acpi_dlevel acpi_debug_levels[] = {

View File

@@ -17,11 +17,9 @@
*/ */
#define ACPI_SBS_COMPONENT 0x00100000 #define ACPI_SBS_COMPONENT 0x00100000
#define ACPI_FAN_COMPONENT 0x00200000 #define ACPI_FAN_COMPONENT 0x00200000
#define ACPI_PCI_COMPONENT 0x00400000
#define ACPI_CONTAINER_COMPONENT 0x01000000 #define ACPI_CONTAINER_COMPONENT 0x01000000
#define ACPI_SYSTEM_COMPONENT 0x02000000 #define ACPI_SYSTEM_COMPONENT 0x02000000
#define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
#define ACPI_PROCESSOR_COMPONENT 0x20000000
/* /*
* _HID definitions * _HID definitions