Commit e25c5abf authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-cleanup', 'acpi-thermal', 'acpi-pci', 'acpi-lpss' and 'acpi-button'

* acpi-cleanup:
  ACPI: Remove duplicate definitions of PREFIX
  ACPI / tables: Replace printk with pr_*

* acpi-thermal:
  ACPI / thermal: make acpi_thermal_check asynchronous on resume

* acpi-pci:
  ACPI / PCI: Do not call ISA-specific code if ISA is not supported

* acpi-lpss:
  ACPI / LPSS: Add Intel BayTrail ACPI mode PWM

* acpi-button:
  ACPI / button: Add ACPI Button event via netlink routine
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
ACPI_MODULE_NAME("cmos rtc"); ACPI_MODULE_NAME("cmos rtc");
static const struct acpi_device_id acpi_cmos_rtc_ids[] = { static const struct acpi_device_id acpi_cmos_rtc_ids[] = {
......
...@@ -102,6 +102,16 @@ static struct lpss_device_desc lpt_sdio_dev_desc = { ...@@ -102,6 +102,16 @@ static struct lpss_device_desc lpt_sdio_dev_desc = {
.ltr_required = true, .ltr_required = true,
}; };
static struct lpss_shared_clock pwm_clock = {
.name = "pwm_clk",
.rate = 25000000,
};
static struct lpss_device_desc byt_pwm_dev_desc = {
.clk_required = true,
.shared_clock = &pwm_clock,
};
static struct lpss_shared_clock uart_clock = { static struct lpss_shared_clock uart_clock = {
.name = "uart_clk", .name = "uart_clk",
.rate = 44236800, .rate = 44236800,
...@@ -157,6 +167,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = { ...@@ -157,6 +167,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
{ "INT33C7", }, { "INT33C7", },
/* BayTrail LPSS devices */ /* BayTrail LPSS devices */
{ "80860F09", (unsigned long)&byt_pwm_dev_desc },
{ "80860F0A", (unsigned long)&byt_uart_dev_desc }, { "80860F0A", (unsigned long)&byt_uart_dev_desc },
{ "80860F0E", (unsigned long)&byt_spi_dev_desc }, { "80860F0E", (unsigned long)&byt_spi_dev_desc },
{ "80860F14", (unsigned long)&byt_sdio_dev_desc }, { "80860F14", (unsigned long)&byt_sdio_dev_desc },
......
...@@ -302,6 +302,10 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) ...@@ -302,6 +302,10 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
input_sync(input); input_sync(input);
pm_wakeup_event(&device->dev, 0); pm_wakeup_event(&device->dev, 0);
acpi_bus_generate_netlink_event(
device->pnp.device_class,
dev_name(&device->dev),
event, ++button->pushed);
} }
break; break;
default: default:
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_CONTAINER_COMPONENT #define _COMPONENT ACPI_CONTAINER_COMPONENT
ACPI_MODULE_NAME("container"); ACPI_MODULE_NAME("container");
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define ACPI_DOCK_DRIVER_DESCRIPTION "ACPI Dock Station Driver" #define ACPI_DOCK_DRIVER_DESCRIPTION "ACPI Dock Station Driver"
ACPI_MODULE_NAME("dock"); ACPI_MODULE_NAME("dock");
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#define _COMPONENT ACPI_OS_SERVICES #define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME("osl"); ACPI_MODULE_NAME("osl");
#define PREFIX "ACPI: "
struct acpi_os_dpc { struct acpi_os_dpc {
acpi_osd_exec_callback function; acpi_osd_exec_callback function;
void *context; void *context;
......
...@@ -370,6 +370,30 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin) ...@@ -370,6 +370,30 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
return NULL; return NULL;
} }
#if IS_ENABLED(CONFIG_ISA) || IS_ENABLED(CONFIG_EISA)
static int acpi_isa_register_gsi(struct pci_dev *dev)
{
u32 dev_gsi;
/* Interrupt Line values above 0xF are forbidden */
if (dev->irq > 0 && (dev->irq <= 0xF) &&
(acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
pin_name(dev->pin), dev->irq);
acpi_register_gsi(&dev->dev, dev_gsi,
ACPI_LEVEL_SENSITIVE,
ACPI_ACTIVE_LOW);
return 0;
}
return -EINVAL;
}
#else
static inline int acpi_isa_register_gsi(struct pci_dev *dev)
{
return -ENODEV;
}
#endif
int acpi_pci_irq_enable(struct pci_dev *dev) int acpi_pci_irq_enable(struct pci_dev *dev)
{ {
struct acpi_prt_entry *entry; struct acpi_prt_entry *entry;
...@@ -416,19 +440,9 @@ int acpi_pci_irq_enable(struct pci_dev *dev) ...@@ -416,19 +440,9 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
* driver reported one, then use it. Exit in any case. * driver reported one, then use it. Exit in any case.
*/ */
if (gsi < 0) { if (gsi < 0) {
u32 dev_gsi; if (acpi_isa_register_gsi(dev))
/* Interrupt Line values above 0xF are forbidden */
if (dev->irq > 0 && (dev->irq <= 0xF) &&
(acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
pin_name(pin), dev->irq);
acpi_register_gsi(&dev->dev, dev_gsi,
ACPI_LEVEL_SENSITIVE,
ACPI_ACTIVE_LOW);
} else {
dev_warn(&dev->dev, "PCI INT %c: no GSI\n", dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
pin_name(pin)); pin_name(pin));
}
kfree(entry); kfree(entry);
return 0; return 0;
......
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_PCI_COMPONENT #define _COMPONENT ACPI_PCI_COMPONENT
ACPI_MODULE_NAME("pci_link"); ACPI_MODULE_NAME("pci_link");
#define ACPI_PCI_LINK_CLASS "pci_irq_routing" #define ACPI_PCI_LINK_CLASS "pci_irq_routing"
......
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_PCI_COMPONENT #define _COMPONENT ACPI_PCI_COMPONENT
ACPI_MODULE_NAME("pci_root"); ACPI_MODULE_NAME("pci_root");
#define ACPI_PCI_ROOT_CLASS "pci_bridge" #define ACPI_PCI_ROOT_CLASS "pci_bridge"
......
...@@ -46,8 +46,6 @@ ...@@ -46,8 +46,6 @@
#include "sleep.h" #include "sleep.h"
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_POWER_COMPONENT #define _COMPONENT ACPI_POWER_COMPONENT
ACPI_MODULE_NAME("power"); ACPI_MODULE_NAME("power");
#define ACPI_POWER_CLASS "power_resource" #define ACPI_POWER_CLASS "power_resource"
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_PROCESSOR_COMPONENT #define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_core"); ACPI_MODULE_NAME("processor_core");
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80 #define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80
#define ACPI_PROCESSOR_NOTIFY_POWER 0x81 #define ACPI_PROCESSOR_NOTIFY_POWER 0x81
#define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82 #define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#define _COMPONENT ACPI_SYSTEM_COMPONENT #define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME("sysfs"); ACPI_MODULE_NAME("sysfs");
#define PREFIX "ACPI: "
#ifdef CONFIG_ACPI_DEBUG #ifdef CONFIG_ACPI_DEBUG
/* /*
* ACPI debug sysfs I/F, including: * ACPI debug sysfs I/F, including:
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
* *
*/ */
#define pr_fmt(fmt) "ACPI: " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/smp.h> #include <linux/smp.h>
...@@ -33,8 +35,6 @@ ...@@ -33,8 +35,6 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#define PREFIX "ACPI: "
#define ACPI_MAX_TABLES 128 #define ACPI_MAX_TABLES 128
static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" }; static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" };
...@@ -55,10 +55,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -55,10 +55,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_local_apic *p = struct acpi_madt_local_apic *p =
(struct acpi_madt_local_apic *)header; (struct acpi_madt_local_apic *)header;
printk(KERN_INFO PREFIX pr_info("LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",
"LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", p->processor_id, p->id,
p->processor_id, p->id, (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
(p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
} }
break; break;
...@@ -66,11 +65,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -66,11 +65,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_local_x2apic *p = struct acpi_madt_local_x2apic *p =
(struct acpi_madt_local_x2apic *)header; (struct acpi_madt_local_x2apic *)header;
printk(KERN_INFO PREFIX pr_info("X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n",
"X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", p->local_apic_id, p->uid,
p->local_apic_id, p->uid, (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
(p->lapic_flags & ACPI_MADT_ENABLED) ?
"enabled" : "disabled");
} }
break; break;
...@@ -78,9 +75,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -78,9 +75,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_io_apic *p = struct acpi_madt_io_apic *p =
(struct acpi_madt_io_apic *)header; (struct acpi_madt_io_apic *)header;
printk(KERN_INFO PREFIX pr_info("IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n",
"IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", p->id, p->address, p->global_irq_base);
p->id, p->address, p->global_irq_base);
} }
break; break;
...@@ -88,18 +84,15 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -88,18 +84,15 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_interrupt_override *p = struct acpi_madt_interrupt_override *p =
(struct acpi_madt_interrupt_override *)header; (struct acpi_madt_interrupt_override *)header;
printk(KERN_INFO PREFIX pr_info("INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n",
"INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", p->bus, p->source_irq, p->global_irq,
p->bus, p->source_irq, p->global_irq, mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]);
mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]);
if (p->inti_flags & if (p->inti_flags &
~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)) ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK))
printk(KERN_INFO PREFIX pr_info("INT_SRC_OVR unexpected reserved flags: 0x%x\n",
"INT_SRC_OVR unexpected reserved flags: 0x%x\n", p->inti_flags &
p->inti_flags &
~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)); ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK));
} }
break; break;
...@@ -107,11 +100,10 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -107,11 +100,10 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_nmi_source *p = struct acpi_madt_nmi_source *p =
(struct acpi_madt_nmi_source *)header; (struct acpi_madt_nmi_source *)header;
printk(KERN_INFO PREFIX pr_info("NMI_SRC (%s %s global_irq %d)\n",
"NMI_SRC (%s %s global_irq %d)\n", mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], p->global_irq);
p->global_irq);
} }
break; break;
...@@ -119,12 +111,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -119,12 +111,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_local_apic_nmi *p = struct acpi_madt_local_apic_nmi *p =
(struct acpi_madt_local_apic_nmi *)header; (struct acpi_madt_local_apic_nmi *)header;
printk(KERN_INFO PREFIX pr_info("LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
"LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", p->processor_id,
p->processor_id, mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ],
mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], p->lint);
p->lint);
} }
break; break;
...@@ -137,12 +128,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -137,12 +128,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK; polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK;
trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2; trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
printk(KERN_INFO PREFIX pr_info("X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n",
"X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n", p->uid,
p->uid, mps_inti_flags_polarity[polarity],
mps_inti_flags_polarity[polarity], mps_inti_flags_trigger[trigger],
mps_inti_flags_trigger[trigger], p->lint);
p->lint);
} }
break; break;
...@@ -150,9 +140,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -150,9 +140,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_local_apic_override *p = struct acpi_madt_local_apic_override *p =
(struct acpi_madt_local_apic_override *)header; (struct acpi_madt_local_apic_override *)header;
printk(KERN_INFO PREFIX pr_info("LAPIC_ADDR_OVR (address[%p])\n",
"LAPIC_ADDR_OVR (address[%p])\n", (void *)(unsigned long)p->address);
(void *)(unsigned long)p->address);
} }
break; break;
...@@ -160,10 +149,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -160,10 +149,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_io_sapic *p = struct acpi_madt_io_sapic *p =
(struct acpi_madt_io_sapic *)header; (struct acpi_madt_io_sapic *)header;
printk(KERN_INFO PREFIX pr_info("IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n",
"IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", p->id, (void *)(unsigned long)p->address,
p->id, (void *)(unsigned long)p->address, p->global_irq_base);
p->global_irq_base);
} }
break; break;
...@@ -171,10 +159,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -171,10 +159,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_local_sapic *p = struct acpi_madt_local_sapic *p =
(struct acpi_madt_local_sapic *)header; (struct acpi_madt_local_sapic *)header;
printk(KERN_INFO PREFIX pr_info("LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n",
"LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", p->processor_id, p->id, p->eid,
p->processor_id, p->id, p->eid, (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
(p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
} }
break; break;
...@@ -182,19 +169,17 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) ...@@ -182,19 +169,17 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
{ {
struct acpi_madt_interrupt_source *p = struct acpi_madt_interrupt_source *p =
(struct acpi_madt_interrupt_source *)header; (struct acpi_madt_interrupt_source *)header;
printk(KERN_INFO PREFIX pr_info("PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
"PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], p->type, p->id, p->eid, p->io_sapic_vector,
p->type, p->id, p->eid, p->io_sapic_vector, p->global_irq);
p->global_irq);
} }
break; break;
default: default:
printk(KERN_WARNING PREFIX pr_warn("Found unsupported MADT entry (type = 0x%x)\n",
"Found unsupported MADT entry (type = 0x%x)\n", header->type);
header->type);
break; break;
} }
} }
...@@ -225,7 +210,7 @@ acpi_table_parse_entries(char *id, ...@@ -225,7 +210,7 @@ acpi_table_parse_entries(char *id,
acpi_get_table_with_size(id, 0, &table_header, &tbl_size); acpi_get_table_with_size(id, 0, &table_header, &tbl_size);
if (!table_header) { if (!table_header) {
printk(KERN_WARNING PREFIX "%4.4s not present\n", id); pr_warn("%4.4s not present\n", id);
return -ENODEV; return -ENODEV;
} }
...@@ -248,7 +233,7 @@ acpi_table_parse_entries(char *id, ...@@ -248,7 +233,7 @@ acpi_table_parse_entries(char *id,
* infinite loop. * infinite loop.
*/ */
if (entry->length == 0) { if (entry->length == 0) {
pr_err(PREFIX "[%4.4s:0x%02x] Invalid zero length\n", id, entry_id); pr_err("[%4.4s:0x%02x] Invalid zero length\n", id, entry_id);
goto err; goto err;
} }
...@@ -256,8 +241,8 @@ acpi_table_parse_entries(char *id, ...@@ -256,8 +241,8 @@ acpi_table_parse_entries(char *id,
((unsigned long)entry + entry->length); ((unsigned long)entry + entry->length);
} }
if (max_entries && count > max_entries) { if (max_entries && count > max_entries) {
printk(KERN_WARNING PREFIX "[%4.4s:0x%02x] ignored %i entries of " pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n",
"%i found\n", id, entry_id, count - max_entries, count); id, entry_id, count - max_entries, count);
} }
early_acpi_os_unmap_memory((char *)table_header, tbl_size); early_acpi_os_unmap_memory((char *)table_header, tbl_size);
...@@ -322,13 +307,11 @@ static void __init check_multiple_madt(void) ...@@ -322,13 +307,11 @@ static void __init check_multiple_madt(void)
acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size); acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size);
if (table) { if (table) {
printk(KERN_WARNING PREFIX pr_warn("BIOS bug: multiple APIC/MADT found, using %d\n",
"BIOS bug: multiple APIC/MADT found," acpi_apic_instance);
" using %d\n", acpi_apic_instance); pr_warn("If \"acpi_apic_instance=%d\" works better, "
printk(KERN_WARNING PREFIX "notify linux-acpi@vger.kernel.org\n",
"If \"acpi_apic_instance=%d\" works better, " acpi_apic_instance ? 0 : 2);
"notify linux-acpi@vger.kernel.org\n",
acpi_apic_instance ? 0 : 2);
early_acpi_os_unmap_memory(table, tbl_size); early_acpi_os_unmap_memory(table, tbl_size);
} else } else
...@@ -365,8 +348,7 @@ static int __init acpi_parse_apic_instance(char *str) ...@@ -365,8 +348,7 @@ static int __init acpi_parse_apic_instance(char *str)
acpi_apic_instance = simple_strtoul(str, NULL, 0); acpi_apic_instance = simple_strtoul(str, NULL, 0);
printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n", pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance);
acpi_apic_instance);
return 0; return 0;
} }
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/thermal.h> #include <linux/thermal.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/workqueue.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#define PREFIX "ACPI: " #define PREFIX "ACPI: "
...@@ -90,6 +91,8 @@ static int psv; ...@@ -90,6 +91,8 @@ static int psv;
module_param(psv, int, 0644); module_param(psv, int, 0644);
MODULE_PARM_DESC(psv, "Disable or override all passive trip points."); MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
static struct workqueue_struct *acpi_thermal_pm_queue;
static int acpi_thermal_add(struct acpi_device *device); static int acpi_thermal_add(struct acpi_device *device);
static int acpi_thermal_remove(struct acpi_device *device); static int acpi_thermal_remove(struct acpi_device *device);
static void acpi_thermal_notify(struct acpi_device *device, u32 event); static void acpi_thermal_notify(struct acpi_device *device, u32 event);
...@@ -101,11 +104,13 @@ static const struct acpi_device_id thermal_device_ids[] = { ...@@ -101,11 +104,13 @@ static const struct acpi_device_id thermal_device_ids[] = {
MODULE_DEVICE_TABLE(acpi, thermal_device_ids); MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int acpi_thermal_suspend(struct device *dev);
static int acpi_thermal_resume(struct device *dev); static int acpi_thermal_resume(struct device *dev);
#else #else
#define acpi_thermal_suspend NULL
#define acpi_thermal_resume NULL #define acpi_thermal_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, acpi_thermal_suspend, acpi_thermal_resume);
static struct acpi_driver acpi_thermal_driver = { static struct acpi_driver acpi_thermal_driver = {
.name = "thermal", .name = "thermal",
...@@ -186,6 +191,7 @@ struct acpi_thermal { ...@@ -186,6 +191,7 @@ struct acpi_thermal {
struct thermal_zone_device *thermal_zone; struct thermal_zone_device *thermal_zone;
int tz_enabled; int tz_enabled;
int kelvin_offset; int kelvin_offset;
struct work_struct thermal_check_work;
}; };
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -1064,6 +1070,13 @@ static void acpi_thermal_guess_offset(struct acpi_thermal *tz) ...@@ -1064,6 +1070,13 @@ static void acpi_thermal_guess_offset(struct acpi_thermal *tz)
tz->kelvin_offset = 2732; tz->kelvin_offset = 2732;
} }
static void acpi_thermal_check_fn(struct work_struct *work)
{
struct acpi_thermal *tz = container_of(work, struct acpi_thermal,
thermal_check_work);
acpi_thermal_check(tz);
}
static int acpi_thermal_add(struct acpi_device *device) static int acpi_thermal_add(struct acpi_device *device)
{ {
int result = 0; int result = 0;
...@@ -1093,6 +1106,8 @@ static int acpi_thermal_add(struct acpi_device *device) ...@@ -1093,6 +1106,8 @@ static int acpi_thermal_add(struct acpi_device *device)
if (result) if (result)
goto free_memory; goto free_memory;
INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn);
pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device), pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device),
acpi_device_bid(device), KELVIN_TO_CELSIUS(tz->temperature)); acpi_device_bid(device), KELVIN_TO_CELSIUS(tz->temperature));
goto end; goto end;
...@@ -1110,6 +1125,7 @@ static int acpi_thermal_remove(struct acpi_device *device) ...@@ -1110,6 +1125,7 @@ static int acpi_thermal_remove(struct acpi_device *device)
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return -EINVAL; return -EINVAL;
flush_workqueue(acpi_thermal_pm_queue);
tz = acpi_driver_data(device); tz = acpi_driver_data(device);
acpi_thermal_unregister_thermal_zone(tz); acpi_thermal_unregister_thermal_zone(tz);
...@@ -1118,6 +1134,13 @@ static int acpi_thermal_remove(struct acpi_device *device) ...@@ -1118,6 +1134,13 @@ static int acpi_thermal_remove(struct acpi_device *device)
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int acpi_thermal_suspend(struct device *dev)
{
/* Make sure the previously queued thermal check work has been done */
flush_workqueue(acpi_thermal_pm_queue);
return 0;
}
static int acpi_thermal_resume(struct device *dev) static int acpi_thermal_resume(struct device *dev)
{ {
struct acpi_thermal *tz; struct acpi_thermal *tz;
...@@ -1148,7 +1171,7 @@ static int acpi_thermal_resume(struct device *dev) ...@@ -1148,7 +1171,7 @@ static int acpi_thermal_resume(struct device *dev)
tz->state.active |= tz->trips.active[i].flags.enabled; tz->state.active |= tz->trips.active[i].flags.enabled;
} }
acpi_thermal_check(tz); queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
return AE_OK; return AE_OK;
} }
...@@ -1240,16 +1263,22 @@ static int __init acpi_thermal_init(void) ...@@ -1240,16 +1263,22 @@ static int __init acpi_thermal_init(void)
return -ENODEV; return -ENODEV;
} }
acpi_thermal_pm_queue = create_workqueue("acpi_thermal_pm");
if (!acpi_thermal_pm_queue)
return -ENODEV;
result = acpi_bus_register_driver(&acpi_thermal_driver); result = acpi_bus_register_driver(&acpi_thermal_driver);
if (result < 0) if (result < 0) {
destroy_workqueue(acpi_thermal_pm_queue);
return -ENODEV; return -ENODEV;
}
return 0; return 0;
} }
static void __exit acpi_thermal_exit(void) static void __exit acpi_thermal_exit(void)
{ {
destroy_workqueue(acpi_thermal_pm_queue);
acpi_bus_unregister_driver(&acpi_thermal_driver); acpi_bus_unregister_driver(&acpi_thermal_driver);
return; return;
......
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
#define ACPI_VIDEO_BUS_NAME "Video Bus" #define ACPI_VIDEO_BUS_NAME "Video Bus"
#define ACPI_VIDEO_DEVICE_NAME "Video Device" #define ACPI_VIDEO_DEVICE_NAME "Video Device"
#define ACPI_VIDEO_NOTIFY_SWITCH 0x80 #define ACPI_VIDEO_NOTIFY_SWITCH 0x80
......
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
#include "internal.h" #include "internal.h"
#define PREFIX "ACPI: "
ACPI_MODULE_NAME("video"); ACPI_MODULE_NAME("video");
#define _COMPONENT ACPI_VIDEO_COMPONENT #define _COMPONENT ACPI_VIDEO_COMPONENT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment