Skip to content

Commit

Permalink
Merge tag 'pm+acpi-2-3.13-rc1' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/rafael/linux-pm

Pull more ACPI and power management updates from Rafael Wysocki:

 - ACPI-based device hotplug fixes for issues introduced recently and a
   fix for an older error code path bug in the ACPI PCI host bridge
   driver

 - Fix for recently broken OMAP cpufreq build from Viresh Kumar

 - Fix for a recent hibernation regression related to s2disk

 - Fix for a locking-related regression in the ACPI EC driver from
   Puneet Kumar

 - System suspend error code path fix related to runtime PM and runtime
   PM documentation update from Ulf Hansson

 - cpufreq's conservative governor fix from Xiaoguang Chen

 - New processor IDs for intel_idle and turbostat and removal of an
   obsolete Kconfig option from Len Brown

 - New device IDs for the ACPI LPSS (Low-Power Subsystem) driver and
   ACPI-based PCI hotplug (ACPIPHP) cleanup from Mika Westerberg

 - Removal of several ACPI video DMI blacklist entries that are not
   necessary any more from Aaron Lu

 - Rework of the ACPI companion representation in struct device and code
   cleanup related to that change from Rafael J Wysocki, Lan Tianyu and
   Jarkko Nikula

 - Fixes for assigning names to ACPI-enumerated I2C and SPI devices from
   Jarkko Nikula

* tag 'pm+acpi-2-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (24 commits)
  PCI / hotplug / ACPI: Drop unused acpiphp_debug declaration
  ACPI / scan: Set flags.match_driver in acpi_bus_scan_fixed()
  ACPI / PCI root: Clear driver_data before failing enumeration
  ACPI / hotplug: Fix PCI host bridge hot removal
  ACPI / hotplug: Fix acpi_bus_get_device() return value check
  cpufreq: governor: Remove fossil comment in the cpufreq_governor_dbs()
  ACPI / video: clean up DMI table for initial black screen problem
  ACPI / EC: Ensure lock is acquired before accessing ec struct members
  PM / Hibernate: Do not crash kernel in free_basic_memory_bitmaps()
  ACPI / AC: Remove struct acpi_device pointer from struct acpi_ac
  spi: Use stable dev_name for ACPI enumerated SPI slaves
  i2c: Use stable dev_name for ACPI enumerated I2C slaves
  ACPI: Provide acpi_dev_name accessor for struct acpi_device device name
  ACPI / bind: Use (put|get)_device() on ACPI device objects too
  ACPI: Eliminate the DEVICE_ACPI_HANDLE() macro
  ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node
  cpufreq: OMAP: Fix compilation error 'r & ret undeclared'
  PM / Runtime: Fix error path for prepare
  PM / Runtime: Update documentation around probe|remove|suspend
  cpufreq: conservative: set requested_freq to policy max when it is over policy max
  ...
  • Loading branch information
Linus Torvalds committed Nov 20, 2013
2 parents e6d69a6 + ed6a825 commit 82023bb
Show file tree
Hide file tree
Showing 58 changed files with 374 additions and 328 deletions.
14 changes: 6 additions & 8 deletions Documentation/power/runtime_pm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,11 @@ helper functions described in Section 4. In that case, pm_runtime_resume()
should be used. Of course, for this purpose the device's runtime PM has to be
enabled earlier by calling pm_runtime_enable().

If the device bus type's or driver's ->probe() callback runs
pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts,
they will fail returning -EAGAIN, because the device's usage counter is
incremented by the driver core before executing ->probe(). Still, it may be
desirable to suspend the device as soon as ->probe() has finished, so the driver
core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for
the device at that time.
It may be desirable to suspend the device once ->probe() has finished.
Therefore the driver core uses the asyncronous pm_request_idle() to submit a
request to execute the subsystem-level idle callback for the device at that
time. A driver that makes use of the runtime autosuspend feature, may want to
update the last busy mark before returning from ->probe().

Moreover, the driver core prevents runtime PM callbacks from racing with the bus
notifier callback in __device_release_driver(), which is necessary, because the
Expand Down Expand Up @@ -656,7 +654,7 @@ out the following operations:
__pm_runtime_disable() with 'false' as the second argument for every device
right before executing the subsystem-level .suspend_late() callback for it.

* During system resume it calls pm_runtime_enable() and pm_runtime_put_sync()
* During system resume it calls pm_runtime_enable() and pm_runtime_put()
for every device right after executing the subsystem-level .resume_early()
callback and right after executing the subsystem-level .resume() callback
for it, respectively.
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/hp/common/sba_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ sba_connect_bus(struct pci_bus *bus)
if (PCI_CONTROLLER(bus)->iommu)
return;

handle = PCI_CONTROLLER(bus)->acpi_handle;
handle = acpi_device_handle(PCI_CONTROLLER(bus)->companion);
if (!handle)
return;

Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct iospace_resource {
};

struct pci_controller {
void *acpi_handle;
struct acpi_device *companion;
void *iommu;
int segment;
int node; /* nearest node with memory or -1 for global allocation */
Expand Down
6 changes: 3 additions & 3 deletions arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
if (!controller)
return NULL;

controller->acpi_handle = device->handle;
controller->companion = device;

pxm = acpi_get_pxm(controller->acpi_handle);
pxm = acpi_get_pxm(device->handle);
#ifdef CONFIG_NUMA
if (pxm >= 0)
controller->node = pxm_to_node(pxm);
Expand Down Expand Up @@ -489,7 +489,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
{
struct pci_controller *controller = bridge->bus->sysdata;

ACPI_HANDLE_SET(&bridge->dev, controller->acpi_handle);
ACPI_COMPANION_SET(&bridge->dev, controller->companion);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/ia64/sn/kernel/io_acpi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
struct acpi_resource_vendor_typed *vendor;


handle = PCI_CONTROLLER(bus)->acpi_handle;
handle = acpi_device_handle(PCI_CONTROLLER(bus)->companion);
status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
&sn_uuid, &buffer);
if (ACPI_FAILURE(status)) {
Expand Down Expand Up @@ -360,7 +360,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
acpi_status status;
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };

rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle;
rootbus_handle = acpi_device_handle(PCI_CONTROLLER(dev)->companion);
status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
&segment);
if (ACPI_SUCCESS(status)) {
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct pci_sysdata {
int domain; /* PCI domain */
int node; /* NUMA node */
#ifdef CONFIG_ACPI
void *acpi; /* ACPI-specific data */
struct acpi_device *companion; /* ACPI companion device */
#endif
#ifdef CONFIG_X86_64
void *iommu; /* IOMMU private data */
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/include/uapi/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@
#define MSR_PP1_ENERGY_STATUS 0x00000641
#define MSR_PP1_POLICY 0x00000642

#define MSR_CORE_C1_RES 0x00000660

#define MSR_AMD64_MC0_MASK 0xc0010044

#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
sd = &info->sd;
sd->domain = domain;
sd->node = node;
sd->acpi = device->handle;
sd->companion = device;
/*
* Maybe the desired pci bus has been already scanned. In such case
* it is unnecessary to scan the pci bus with the given domain,busnum.
Expand Down Expand Up @@ -589,7 +589,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
{
struct pci_sysdata *sd = bridge->bus->sysdata;

ACPI_HANDLE_SET(&bridge->dev, sd->acpi);
ACPI_COMPANION_SET(&bridge->dev, sd->companion);
return 0;
}

Expand Down
11 changes: 0 additions & 11 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,6 @@ config ACPI_INITRD_TABLE_OVERRIDE
initrd, therefore it's safe to say Y.
See Documentation/acpi/initrd_table_override.txt for details

config ACPI_BLACKLIST_YEAR
int "Disable ACPI for systems before Jan 1st this year" if X86_32
default 0
help
Enter a 4-digit year, e.g., 2001, to disable ACPI by default
on platforms with DMI BIOS date before January 1st that year.
"acpi=force" can be used to override this mechanism.

Enter 0 to disable this mechanism and allow ACPI to
run by default no matter what the year. (default)

config ACPI_DEBUG
bool "Debug Statements"
default n
Expand Down
15 changes: 8 additions & 7 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ static int ac_sleep_before_get_state_ms;

struct acpi_ac {
struct power_supply charger;
struct acpi_device *adev;
struct platform_device *pdev;
unsigned long long state;
};
Expand All @@ -70,8 +69,9 @@ struct acpi_ac {
static int acpi_ac_get_state(struct acpi_ac *ac)
{
acpi_status status;
acpi_handle handle = ACPI_HANDLE(&ac->pdev->dev);

status = acpi_evaluate_integer(ac->adev->handle, "_PSR", NULL,
status = acpi_evaluate_integer(handle, "_PSR", NULL,
&ac->state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
Expand Down Expand Up @@ -119,6 +119,7 @@ static enum power_supply_property ac_props[] = {
static void acpi_ac_notify_handler(acpi_handle handle, u32 event, void *data)
{
struct acpi_ac *ac = data;
struct acpi_device *adev;

if (!ac)
return;
Expand All @@ -141,10 +142,11 @@ static void acpi_ac_notify_handler(acpi_handle handle, u32 event, void *data)
msleep(ac_sleep_before_get_state_ms);

acpi_ac_get_state(ac);
acpi_bus_generate_netlink_event(ac->adev->pnp.device_class,
adev = ACPI_COMPANION(&ac->pdev->dev);
acpi_bus_generate_netlink_event(adev->pnp.device_class,
dev_name(&ac->pdev->dev),
event, (u32) ac->state);
acpi_notifier_call_chain(ac->adev, event, (u32) ac->state);
acpi_notifier_call_chain(adev, event, (u32) ac->state);
kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
}

Expand Down Expand Up @@ -178,8 +180,8 @@ static int acpi_ac_probe(struct platform_device *pdev)
if (!pdev)
return -EINVAL;

result = acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev);
if (result)
adev = ACPI_COMPANION(&pdev->dev);
if (!adev)
return -ENODEV;

ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL);
Expand All @@ -188,7 +190,6 @@ static int acpi_ac_probe(struct platform_device *pdev)

strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME);
strcpy(acpi_device_class(adev), ACPI_AC_CLASS);
ac->adev = adev;
ac->pdev = pdev;
platform_set_drvdata(pdev, ac);

Expand Down
9 changes: 9 additions & 0 deletions drivers/acpi/acpi_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
{ "80860F41", (unsigned long)&byt_i2c_dev_desc },
{ "INT33B2", },

{ "INT3430", (unsigned long)&lpt_dev_desc },
{ "INT3431", (unsigned long)&lpt_dev_desc },
{ "INT3432", (unsigned long)&lpt_dev_desc },
{ "INT3433", (unsigned long)&lpt_dev_desc },
{ "INT3434", (unsigned long)&lpt_uart_dev_desc },
{ "INT3435", (unsigned long)&lpt_uart_dev_desc },
{ "INT3436", (unsigned long)&lpt_sdio_dev_desc },
{ "INT3437", },

{ }
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int acpi_create_platform_device(struct acpi_device *adev,
pdevinfo.id = -1;
pdevinfo.res = resources;
pdevinfo.num_res = count;
pdevinfo.acpi_node.handle = adev->handle;
pdevinfo.acpi_node.companion = adev;
pdev = platform_device_register_full(&pdevinfo);
if (IS_ERR(pdev)) {
dev_err(&adev->dev, "platform device creation failed: %ld\n",
Expand Down
35 changes: 0 additions & 35 deletions drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,39 +75,6 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata = {
{""}
};

#if CONFIG_ACPI_BLACKLIST_YEAR

static int __init blacklist_by_year(void)
{
int year;

/* Doesn't exist? Likely an old system */
if (!dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL)) {
printk(KERN_ERR PREFIX "no DMI BIOS year, "
"acpi=force is required to enable ACPI\n" );
return 1;
}
/* 0? Likely a buggy new BIOS */
if (year == 0) {
printk(KERN_ERR PREFIX "DMI BIOS year==0, "
"assuming ACPI-capable machine\n" );
return 0;
}
if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
"acpi=force is required to enable ACPI\n",
year, CONFIG_ACPI_BLACKLIST_YEAR);
return 1;
}
return 0;
}
#else
static inline int blacklist_by_year(void)
{
return 0;
}
#endif

int __init acpi_blacklisted(void)
{
int i = 0;
Expand Down Expand Up @@ -166,8 +133,6 @@ int __init acpi_blacklisted(void)
}
}

blacklisted += blacklist_by_year();

dmi_check_system(acpi_osi_dmi_table);

return blacklisted;
Expand Down
14 changes: 5 additions & 9 deletions drivers/acpi/device_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

#include <linux/device.h>
#include <linux/acpi.h>
#include <linux/export.h>
#include <linux/mutex.h>
#include <linux/pm_qos.h>
#include <linux/pm_runtime.h>

#include <acpi/acpi.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

#include "internal.h"

#define _COMPONENT ACPI_POWER_COMPONENT
Expand Down Expand Up @@ -548,7 +544,7 @@ static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev,
*/
int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
{
acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
acpi_handle handle = ACPI_HANDLE(dev);
struct acpi_device *adev;
int ret, d_min, d_max;

Expand Down Expand Up @@ -656,7 +652,7 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
if (!device_run_wake(phys_dev))
return -EINVAL;

handle = DEVICE_ACPI_HANDLE(phys_dev);
handle = ACPI_HANDLE(phys_dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_dbg(phys_dev, "ACPI handle without context in %s!\n",
__func__);
Expand Down Expand Up @@ -700,7 +696,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
if (!device_can_wakeup(dev))
return -EINVAL;

handle = DEVICE_ACPI_HANDLE(dev);
handle = ACPI_HANDLE(dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_dbg(dev, "ACPI handle without context in %s!\n", __func__);
return -ENODEV;
Expand All @@ -722,7 +718,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
*/
struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
{
acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
acpi_handle handle = ACPI_HANDLE(dev);
struct acpi_device *adev;

return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
Expand Down
3 changes: 2 additions & 1 deletion drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ static void start_transaction(struct acpi_ec *ec)
static void advance_transaction(struct acpi_ec *ec, u8 status)
{
unsigned long flags;
struct transaction *t = ec->curr;
struct transaction *t;

spin_lock_irqsave(&ec->lock, flags);
t = ec->curr;
if (!t)
goto unlock;
if (t->wlen > t->wi) {
Expand Down
Loading

0 comments on commit 82023bb

Please sign in to comment.