Skip to content

Commit

Permalink
Merge branches 'acpi-fan', 'acpi-ec', 'acpi-drivers' and 'acpi-osl'
Browse files Browse the repository at this point in the history
* acpi-fan:
  ACPI / fan: Fix error reading cur_state

* acpi-ec:
  ACPI / EC: Fix unused function warning when CONFIG_PM_SLEEP=n

* acpi-drivers:
  ACPI / PAD: don't register acpi_pad driver if running as Xen dom0

* acpi-osl:
  acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT
  • Loading branch information
Rafael J. Wysocki committed Oct 14, 2016
5 parents 3f62d52 + 84baf17 + eab05ec + e311404 + abc4b9a commit 522533f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
5 changes: 5 additions & 0 deletions drivers/acpi/acpi_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <linux/acpi.h>
#include <asm/mwait.h>
#include <xen/xen.h>

#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
Expand Down Expand Up @@ -477,6 +478,10 @@ static struct acpi_driver acpi_pad_driver = {

static int __init acpi_pad_init(void)
{
/* Xen ACPI PAD is used when running as Xen Dom0. */
if (xen_initial_domain())
return -ENODEV;

power_saving_mwait_init();
if (power_saving_mwait_eax == 0)
return -EINVAL;
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ static void acpi_ec_enable_event(struct acpi_ec *ec)
acpi_ec_clear(ec);
}

#ifdef CONFIG_PM_SLEEP
static bool acpi_ec_query_flushed(struct acpi_ec *ec)
{
bool flushed;
Expand Down Expand Up @@ -557,6 +558,7 @@ static void acpi_ec_disable_event(struct acpi_ec *ec)
spin_unlock_irqrestore(&ec->lock, flags);
__acpi_ec_flush_event(ec);
}
#endif /* CONFIG_PM_SLEEP */

static bool acpi_ec_guard_event(struct acpi_ec *ec)
{
Expand Down
12 changes: 11 additions & 1 deletion drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,18 @@ static int fan_get_state_acpi4(struct acpi_device *device, unsigned long *state)

control = obj->package.elements[1].integer.value;
for (i = 0; i < fan->fps_count; i++) {
if (control == fan->fps[i].control)
/*
* When Fine Grain Control is set, return the state
* corresponding to maximum fan->fps[i].control
* value compared to the current speed. Here the
* fan->fps[] is sorted array with increasing speed.
*/
if (fan->fif.fine_grain_ctrl && control < fan->fps[i].control) {
i = (i > 0) ? i - 1 : 0;
break;
} else if (control == fan->fps[i].control) {
break;
}
}
if (i == fan->fps_count) {
dev_dbg(&device->dev, "Invalid control value returned\n");
Expand Down
13 changes: 10 additions & 3 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,18 @@ void acpi_os_vprintf(const char *fmt, va_list args)
if (acpi_in_debugger) {
kdb_printf("%s", buffer);
} else {
printk(KERN_CONT "%s", buffer);
if (printk_get_level(buffer))
printk("%s", buffer);
else
printk(KERN_CONT "%s", buffer);
}
#else
if (acpi_debugger_write_log(buffer) < 0)
printk(KERN_CONT "%s", buffer);
if (acpi_debugger_write_log(buffer) < 0) {
if (printk_get_level(buffer))
printk("%s", buffer);
else
printk(KERN_CONT "%s", buffer);
}
#endif
}

Expand Down

0 comments on commit 522533f

Please sign in to comment.