ACPI and power management fixes for 3.17-rc3

- Fix for an ACPI regression related to the handling of fixed events
    that caused netlink routines to be (incorrectly) run in interrupt
    context from Lan Tianyu.
 
  - Fix for an ACPI EC driver regression on Acer Aspire V5-573G that
    caused AC/battery plug/unplug and video brightness change
    notifications to be delayed on that machine from Lv Zheng.
 
  - Fix for an ACPI device enumeration regression that caused ACPI
    driver probe to fail for some devices where it succeeded before
    (Rafael J Wysocki).
 
  - intel_pstate driver fix to prevent it from printing an information
    message for every CPU in the system on every boot from Andi Kleen.
 
  - s5pv210 cpufreq driver fix to remove an __init annotation from
    a routine that in fact can be called at any time after init too
    from Mark Brown.
 
  - New Intel Braswell device ID for the ACPI LPSS (Low-Power Subsystem)
    driver from Alan Cox.
 
  - New Intel Braswell CPU ID for intel_pstate from Mika Westerberg.
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJUAPAHAAoJEILEb/54YlRxTmUQAIEh8mT8p6Zxlrcclq9hpbnH
 eWpx597XORza5/K64XP7zYpHaoXmOftzhoKyuxRMQmxA1HNDze/yuJmSritMNYp6
 FwIwyOVYleCVhwpYg1lnQ2w1omQ6lrGlTFPEvBdhSzU8SwDi/CJv/FIn2drvbf7+
 l2wLNfpdMvMaNHnHAcw9LOPoPkKD8wqrCDbulsTAvympDRTUjnbje7ZP4RVXhc6t
 p8xc2cDoH36LyOb11kfsL5zgKsoJ4XTACo4Sd8gxy+3Fw/9bhov+qY1RA8PkEs2i
 QMrVAwngW10twbGU56nMjBHcauHfpKcmBcJ6evZzIyu1jsW3iEo71/ifKwNeWkzp
 aY/+g2qlnGdA84GMmxhKEx2b8KN6Wcn64vqIUz6TWKS4jkgWxPn4zAx2ww1cHIlz
 pffPNmiBaNHDlqmaL9NtUltcyVGi5bmn8TcHvQT8yHordPC1Q+2avuLE+Yki43LT
 H5ckVrfqCav6vs4wqr46o9igWM59UOWGBuMqyAwTLwNn3qyXZLB/NYfMWwNCpT8d
 0exyWZCDY26zaMiW1Y7bExX7Ei23vICvdc8XwstIc7GChnP2UZCCWnKh5umLloU/
 yf3sU/hBT+8ZIaBrvEXEE20/m+4l5qTpIcN8OzNrv7OxhDatHYP0OMUUpdqOzU9R
 Zo+He9A98k38IAnMnFCu
 =7zYD
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:

 - Fix for an ACPI regression related to the handling of fixed events
   that caused netlink routines to be (incorrectly) run in interrupt
   context from Lan Tianyu

 - Fix for an ACPI EC driver regression on Acer Aspire V5-573G that
   caused AC/battery plug/unplug and video brightness change
   notifications to be delayed on that machine from Lv Zheng

 - Fix for an ACPI device enumeration regression that caused ACPI driver
   probe to fail for some devices where it succeeded before (Rafael J
   Wysocki)

 - intel_pstate driver fix to prevent it from printing an information
   message for every CPU in the system on every boot from Andi Kleen

 - s5pv210 cpufreq driver fix to remove an __init annotation from a
   routine that in fact can be called at any time after init too from
   Mark Brown

 - New Intel Braswell device ID for the ACPI LPSS (Low-Power Subsystem)
   driver from Alan Cox

 - New Intel Braswell CPU ID for intel_pstate from Mika Westerberg

* tag 'pm+acpi-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: s5pv210: Remove spurious __init annotation
  cpufreq: intel_pstate: Add CPU ID for Braswell processor
  intel_pstate: Turn per cpu printk into pr_debug
  ACPI / LPSS: Add ACPI IDs for Intel Braswell
  ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC
  ACPI / EC: Add support to disallow QR_EC to be issued when SCI_EVT isn't set
  ACPI: Run fixed event device notifications in process context
  ACPI / scan: Allow ACPI drivers to bind to PNP device objects
This commit is contained in:
Linus Torvalds 2014-08-29 17:18:48 -07:00
commit ad6ede80a0
5 changed files with 49 additions and 11 deletions

View File

@ -196,6 +196,17 @@ static struct lpss_device_desc byt_i2c_dev_desc = {
.setup = lpss_i2c_setup,
};
static struct lpss_shared_clock bsw_pwm_clock = {
.name = "pwm_clk",
.rate = 19200000,
};
static struct lpss_device_desc bsw_pwm_dev_desc = {
.clk_required = true,
.save_ctx = true,
.shared_clock = &bsw_pwm_clock,
};
#else
#define LPSS_ADDR(desc) (0UL)
@ -225,6 +236,12 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
{ "INT33B2", },
{ "INT33FC", },
/* Braswell LPSS devices */
{ "80862288", LPSS_ADDR(bsw_pwm_dev_desc) },
{ "8086228A", LPSS_ADDR(byt_uart_dev_desc) },
{ "8086228E", LPSS_ADDR(byt_spi_dev_desc) },
{ "808622C1", LPSS_ADDR(byt_i2c_dev_desc) },
{ "INT3430", LPSS_ADDR(lpt_dev_desc) },
{ "INT3431", LPSS_ADDR(lpt_dev_desc) },
{ "INT3432", LPSS_ADDR(lpt_i2c_dev_desc) },

View File

@ -197,6 +197,8 @@ static bool advance_transaction(struct acpi_ec *ec)
t->rdata[t->ri++] = acpi_ec_read_data(ec);
if (t->rlen == t->ri) {
t->flags |= ACPI_EC_COMMAND_COMPLETE;
if (t->command == ACPI_EC_COMMAND_QUERY)
pr_debug("hardware QR_EC completion\n");
wakeup = true;
}
} else
@ -208,7 +210,20 @@ static bool advance_transaction(struct acpi_ec *ec)
}
return wakeup;
} else {
if ((status & ACPI_EC_FLAG_IBF) == 0) {
/*
* There is firmware refusing to respond QR_EC when SCI_EVT
* is not set, for which case, we complete the QR_EC
* without issuing it to the firmware.
* https://bugzilla.kernel.org/show_bug.cgi?id=86211
*/
if (!(status & ACPI_EC_FLAG_SCI) &&
(t->command == ACPI_EC_COMMAND_QUERY)) {
t->flags |= ACPI_EC_COMMAND_POLL;
t->rdata[t->ri++] = 0x00;
t->flags |= ACPI_EC_COMMAND_COMPLETE;
pr_debug("software QR_EC completion\n");
wakeup = true;
} else if ((status & ACPI_EC_FLAG_IBF) == 0) {
acpi_ec_write_cmd(ec, t->command);
t->flags |= ACPI_EC_COMMAND_POLL;
} else
@ -288,11 +303,11 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
/* following two actions should be kept atomic */
ec->curr = t;
start_transaction(ec);
if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
spin_unlock_irqrestore(&ec->lock, tmp);
ret = ec_poll(ec);
spin_lock_irqsave(&ec->lock, tmp);
if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
ec->curr = NULL;
spin_unlock_irqrestore(&ec->lock, tmp);
return ret;

View File

@ -922,12 +922,17 @@ static void acpi_device_notify(acpi_handle handle, u32 event, void *data)
device->driver->ops.notify(device, event);
}
static acpi_status acpi_device_notify_fixed(void *data)
static void acpi_device_notify_fixed(void *data)
{
struct acpi_device *device = data;
/* Fixed hardware devices have no handles */
acpi_device_notify(NULL, ACPI_FIXED_HARDWARE_EVENT, device);
}
static acpi_status acpi_device_fixed_event(void *data)
{
acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_device_notify_fixed, data);
return AE_OK;
}
@ -938,12 +943,12 @@ static int acpi_device_install_notify_handler(struct acpi_device *device)
if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON)
status =
acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_device_notify_fixed,
acpi_device_fixed_event,
device);
else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON)
status =
acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
acpi_device_notify_fixed,
acpi_device_fixed_event,
device);
else
status = acpi_install_notify_handler(device->handle,
@ -960,10 +965,10 @@ static void acpi_device_remove_notify_handler(struct acpi_device *device)
{
if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON)
acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_device_notify_fixed);
acpi_device_fixed_event);
else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON)
acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
acpi_device_notify_fixed);
acpi_device_fixed_event);
else
acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
acpi_device_notify);
@ -975,7 +980,7 @@ static int acpi_device_probe(struct device *dev)
struct acpi_driver *acpi_drv = to_acpi_driver(dev->driver);
int ret;
if (acpi_dev->handler)
if (acpi_dev->handler && !acpi_is_pnp_device(acpi_dev))
return -EINVAL;
if (!acpi_drv->ops.add)

View File

@ -660,6 +660,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
ICPU(0x3f, core_params),
ICPU(0x45, core_params),
ICPU(0x46, core_params),
ICPU(0x4c, byt_params),
ICPU(0x4f, core_params),
ICPU(0x56, core_params),
{}
@ -688,7 +689,7 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
add_timer_on(&cpu->timer, cpunum);
pr_info("Intel pstate controlling: cpu %d\n", cpunum);
pr_debug("Intel pstate controlling: cpu %d\n", cpunum);
return 0;
}

View File

@ -501,7 +501,7 @@ static int check_mem_type(void __iomem *dmc_reg)
return val >> 8;
}
static int __init s5pv210_cpu_init(struct cpufreq_policy *policy)
static int s5pv210_cpu_init(struct cpufreq_policy *policy)
{
unsigned long mem_type;
int ret;