aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-18 23:28:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-18 23:28:33 -0500
commitc0f486fde3f353232c1cc2fd4d62783ac782a467 (patch)
tree600d222f6d9e975d88ab774aa9d8e5ea9109b08f
parent385336e321c41b5174055c0194b60c19a27cc5c5 (diff)
parent2ec1c17cadd0b994732f292d4bc49fc3a05d85a4 (diff)
Merge tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI and power management updates from Rafael Wysocki: "These are regression fixes (leds-gpio, ACPI backlight driver, operating performance points library, ACPI device enumeration messages, cpupower tool), other bug fixes (ACPI EC driver, ACPI device PM), some cleanups in the operating performance points (OPP) framework, continuation of CONFIG_PM_RUNTIME elimination, a couple of minor intel_pstate driver changes, a new MAINTAINERS entry for it and an ACPI fan driver change needed for better support of thermal management in user space. Specifics: - Fix a regression in leds-gpio introduced by a recent commit that inadvertently changed the name of one of the properties used by the driver (Fabio Estevam). - Fix a regression in the ACPI backlight driver introduced by a recent fix that missed one special case that had to be taken into account (Aaron Lu). - Drop the level of some new kernel messages from the ACPI core introduced by a recent commit to KERN_DEBUG which they should have used from the start and drop some other unuseful KERN_ERR messages printed by ACPI (Rafael J Wysocki). - Revert an incorrect commit modifying the cpupower tool (Prarit Bhargava). - Fix two regressions introduced by recent commits in the OPP library and clean up some existing minor issues in that code (Viresh Kumar). - Continue to replace CONFIG_PM_RUNTIME with CONFIG_PM throughout the tree (or drop it where that can be done) in order to make it possible to eliminate CONFIG_PM_RUNTIME (Rafael J Wysocki, Ulf Hansson, Ludovic Desroches). There will be one more "CONFIG_PM_RUNTIME removal" batch after this one, because some new uses of it have been introduced during the current merge window, but that should be sufficient to finally get rid of it. - Make the ACPI EC driver more robust against race conditions related to GPE handler installation failures (Lv Zheng). - Prevent the ACPI device PM core code from attempting to disable GPEs that it has not enabled which confuses ACPICA and makes it report errors unnecessarily (Rafael J Wysocki). - Add a "force" command line switch to the intel_pstate driver to make it possible to override the blacklisting of some systems in that driver if needed (Ethan Zhao). - Improve intel_pstate code documentation and add a MAINTAINERS entry for it (Kristen Carlson Accardi). - Make the ACPI fan driver create cooling device interfaces witn names that reflect the IDs of the ACPI device objects they are associated with, except for "generic" ACPI fans (PNP ID "PNP0C0B"). That's necessary for user space thermal management tools to be able to connect the fans with the parts of the system they are supposed to be cooling properly. From Srinivas Pandruvada" * tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits) MAINTAINERS: add entry for intel_pstate ACPI / video: update the skip case for acpi_video_device_in_dod() power / PM: Eliminate CONFIG_PM_RUNTIME NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM ACPI / EC: Fix unexpected ec_remove_handlers() invocations Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()" tracing / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM x86 / PM: Replace CONFIG_PM_RUNTIME in io_apic.c PM: Remove the SET_PM_RUNTIME_PM_OPS() macro mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macro PM / Kconfig: Replace PM_RUNTIME with PM in dependencies ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM phy / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM video / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM tty / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM spi: Replace CONFIG_PM_RUNTIME with CONFIG_PM ACPI / PM: Do not disable wakeup GPEs that have not been enabled ACPI / utils: Drop error messages from acpi_evaluate_reference() ...
-rw-r--r--Documentation/kernel-parameters.txt9
-rw-r--r--MAINTAINERS6
-rw-r--r--arch/arm/kernel/perf_event.c2
-rw-r--r--arch/arm/mach-davinci/pm_domain.c2
-rw-r--r--arch/arm/mach-exynos/Kconfig2
-rw-r--r--arch/arm/mach-keystone/pm_domain.c2
-rw-r--r--arch/arm/mach-omap1/pm_bus.c4
-rw-r--r--arch/arm/mach-omap2/io.c2
-rw-r--r--arch/arm/mach-omap2/omap_device.c2
-rw-r--r--arch/ia64/Kconfig2
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
-rw-r--r--drivers/acpi/device_pm.c12
-rw-r--r--drivers/acpi/ec.c2
-rw-r--r--drivers/acpi/fan.c8
-rw-r--r--drivers/acpi/scan.c4
-rw-r--r--drivers/acpi/utils.c12
-rw-r--r--drivers/acpi/video.c10
-rw-r--r--drivers/ata/Kconfig2
-rw-r--r--drivers/base/power/opp.c78
-rw-r--r--drivers/cpufreq/intel_pstate.c38
-rw-r--r--drivers/leds/leds-gpio.c2
-rw-r--r--drivers/media/platform/Kconfig2
-rw-r--r--drivers/media/platform/s5p-tv/Kconfig2
-rw-r--r--drivers/mmc/host/atmel-mci.c2
-rw-r--r--drivers/nfc/trf7970a.c2
-rw-r--r--drivers/phy/phy-omap-usb2.c2
-rw-r--r--drivers/phy/phy-ti-pipe3.c2
-rw-r--r--drivers/power/pm2301_charger.c4
-rw-r--r--drivers/scsi/scsi_pm.c10
-rw-r--r--drivers/scsi/scsi_priv.h5
-rw-r--r--drivers/scsi/ufs/ufshcd-pci.c11
-rw-r--r--drivers/scsi/ufs/ufshcd-pltfrm.c11
-rw-r--r--drivers/spi/spi-coldfire-qspi.c2
-rw-r--r--drivers/spi/spi-orion.c2
-rw-r--r--drivers/spi/spi-pxa2xx.c2
-rw-r--r--drivers/spi/spi-qup.c4
-rw-r--r--drivers/spi/spi-rockchip.c4
-rw-r--r--drivers/spi/spi-s3c64xx.c4
-rw-r--r--drivers/staging/gdm72xx/Kconfig2
-rw-r--r--drivers/tty/serial/8250/8250_dw.c2
-rw-r--r--drivers/tty/serial/8250/8250_mtk.c2
-rw-r--r--drivers/tty/serial/mfd.c7
-rw-r--r--drivers/tty/serial/msm_serial_hs.c2
-rw-r--r--drivers/tty/serial/omap-serial.c2
-rw-r--r--drivers/usb/core/Kconfig2
-rw-r--r--drivers/usb/phy/Kconfig4
-rw-r--r--drivers/usb/storage/Kconfig2
-rw-r--r--drivers/video/fbdev/s3c-fb.c2
-rw-r--r--drivers/video/fbdev/sh_mobile_meram.c4
-rw-r--r--include/acpi/acpi_bus.h1
-rw-r--r--include/linux/pm.h2
-rw-r--r--include/scsi/scsi_device.h4
-rw-r--r--kernel/trace/Makefile2
-rw-r--r--sound/pci/hda/hda_controller.c2
-rw-r--r--sound/pci/hda/hda_intel.c5
-rw-r--r--sound/soc/codecs/cs35l32.c2
-rw-r--r--sound/soc/codecs/cs42xx8.c2
-rw-r--r--sound/soc/codecs/max98090.c2
-rw-r--r--sound/soc/codecs/pcm512x.c2
-rw-r--r--sound/soc/codecs/tas2552.c4
-rw-r--r--sound/soc/codecs/wm2200.c2
-rw-r--r--sound/soc/codecs/wm5100.c2
-rw-r--r--sound/soc/codecs/wm8962.c2
-rw-r--r--sound/soc/fsl/fsl_asrc.c4
-rw-r--r--sound/soc/samsung/i2s.c4
-rw-r--r--tools/power/cpupower/utils/cpuidle-info.c8
66 files changed, 199 insertions, 156 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index bda85f1dbd44..4df73da11adc 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1457,6 +1457,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1457 disable 1457 disable
1458 Do not enable intel_pstate as the default 1458 Do not enable intel_pstate as the default
1459 scaling driver for the supported processors 1459 scaling driver for the supported processors
1460 force
1461 Enable intel_pstate on systems that prohibit it by default
1462 in favor of acpi-cpufreq. Forcing the intel_pstate driver
1463 instead of acpi-cpufreq may disable platform features, such
1464 as thermal controls and power capping, that rely on ACPI
1465 P-States information being indicated to OSPM and therefore
1466 should be used with caution. This option does not work with
1467 processors that aren't supported by the intel_pstate driver
1468 or on platforms that use pcc-cpufreq instead of acpi-cpufreq.
1460 no_hwp 1469 no_hwp
1461 Do not enable hardware P state control (HWP) 1470 Do not enable hardware P state control (HWP)
1462 if available. 1471 if available.
diff --git a/MAINTAINERS b/MAINTAINERS
index 7675425cabb8..08f671dad3e9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4963,6 +4963,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git
4963S: Supported 4963S: Supported
4964F: drivers/idle/intel_idle.c 4964F: drivers/idle/intel_idle.c
4965 4965
4966INTEL PSTATE DRIVER
4967M: Kristen Carlson Accardi <kristen@linux.intel.com>
4968L: linux-pm@vger.kernel.org
4969S: Supported
4970F: drivers/cpufreq/intel_pstate.c
4971
4966INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) 4972INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
4967M: Maik Broemme <mbroemme@plusserver.de> 4973M: Maik Broemme <mbroemme@plusserver.de>
4968L: linux-fbdev@vger.kernel.org 4974L: linux-fbdev@vger.kernel.org
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index e34934f63a49..f7c65adaa428 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -484,7 +484,7 @@ static void armpmu_disable(struct pmu *pmu)
484 armpmu->stop(armpmu); 484 armpmu->stop(armpmu);
485} 485}
486 486
487#ifdef CONFIG_PM_RUNTIME 487#ifdef CONFIG_PM
488static int armpmu_runtime_resume(struct device *dev) 488static int armpmu_runtime_resume(struct device *dev)
489{ 489{
490 struct arm_pmu_platdata *plat = dev_get_platdata(dev); 490 struct arm_pmu_platdata *plat = dev_get_platdata(dev);
diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 6b98413cebd6..641edc313938 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -14,7 +14,7 @@
14#include <linux/pm_clock.h> 14#include <linux/pm_clock.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16 16
17#ifdef CONFIG_PM_RUNTIME 17#ifdef CONFIG_PM
18static int davinci_pm_runtime_suspend(struct device *dev) 18static int davinci_pm_runtime_suspend(struct device *dev)
19{ 19{
20 int ret; 20 int ret;
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index e4a00bafffc1..603820e5aba7 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -21,7 +21,7 @@ menuconfig ARCH_EXYNOS
21 select HAVE_S3C_RTC if RTC_CLASS 21 select HAVE_S3C_RTC if RTC_CLASS
22 select PINCTRL 22 select PINCTRL
23 select PINCTRL_EXYNOS 23 select PINCTRL_EXYNOS
24 select PM_GENERIC_DOMAINS if PM_RUNTIME 24 select PM_GENERIC_DOMAINS if PM
25 select S5P_DEV_MFC 25 select S5P_DEV_MFC
26 select SRAM 26 select SRAM
27 select MFD_SYSCON 27 select MFD_SYSCON
diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c
index ca79ddac38bc..ef6041e7e675 100644
--- a/arch/arm/mach-keystone/pm_domain.c
+++ b/arch/arm/mach-keystone/pm_domain.c
@@ -19,7 +19,7 @@
19#include <linux/clk-provider.h> 19#include <linux/clk-provider.h>
20#include <linux/of.h> 20#include <linux/of.h>
21 21
22#ifdef CONFIG_PM_RUNTIME 22#ifdef CONFIG_PM
23static int keystone_pm_runtime_suspend(struct device *dev) 23static int keystone_pm_runtime_suspend(struct device *dev)
24{ 24{
25 int ret; 25 int ret;
diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 3f2d39672393..c40e209de65c 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -21,7 +21,7 @@
21 21
22#include "soc.h" 22#include "soc.h"
23 23
24#ifdef CONFIG_PM_RUNTIME 24#ifdef CONFIG_PM
25static int omap1_pm_runtime_suspend(struct device *dev) 25static int omap1_pm_runtime_suspend(struct device *dev)
26{ 26{
27 int ret; 27 int ret;
@@ -59,7 +59,7 @@ static struct dev_pm_domain default_pm_domain = {
59#define OMAP1_PM_DOMAIN (&default_pm_domain) 59#define OMAP1_PM_DOMAIN (&default_pm_domain)
60#else 60#else
61#define OMAP1_PM_DOMAIN NULL 61#define OMAP1_PM_DOMAIN NULL
62#endif /* CONFIG_PM_RUNTIME */ 62#endif /* CONFIG_PM */
63 63
64static struct pm_clk_notifier_block platform_bus_notifier = { 64static struct pm_clk_notifier_block platform_bus_notifier = {
65 .pm_domain = OMAP1_PM_DOMAIN, 65 .pm_domain = OMAP1_PM_DOMAIN,
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 4fc838354e31..a1bd6affb508 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -361,7 +361,7 @@ static void __init omap_hwmod_init_postsetup(void)
361 u8 postsetup_state; 361 u8 postsetup_state;
362 362
363 /* Set the default postsetup state for all hwmods */ 363 /* Set the default postsetup state for all hwmods */
364#ifdef CONFIG_PM_RUNTIME 364#ifdef CONFIG_PM
365 postsetup_state = _HWMOD_STATE_IDLE; 365 postsetup_state = _HWMOD_STATE_IDLE;
366#else 366#else
367 postsetup_state = _HWMOD_STATE_ENABLED; 367 postsetup_state = _HWMOD_STATE_ENABLED;
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 8c58b71c2727..be9541e18650 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -588,7 +588,7 @@ odbs_exit:
588 return ERR_PTR(ret); 588 return ERR_PTR(ret);
589} 589}
590 590
591#ifdef CONFIG_PM_RUNTIME 591#ifdef CONFIG_PM
592static int _od_runtime_suspend(struct device *dev) 592static int _od_runtime_suspend(struct device *dev)
593{ 593{
594 struct platform_device *pdev = to_platform_device(dev); 594 struct platform_device *pdev = to_platform_device(dev);
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 371b55bc5a6e..074e52bf815c 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -231,7 +231,7 @@ config IA64_SGI_UV
231config IA64_HP_SIM 231config IA64_HP_SIM
232 bool "Ski-simulator" 232 bool "Ski-simulator"
233 select SWIOTLB 233 select SWIOTLB
234 depends on !PM_RUNTIME 234 depends on !PM
235 235
236endchoice 236endchoice
237 237
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 7ffe0a2b870f..a6745e756729 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3968,7 +3968,7 @@ bool mp_should_keep_irq(struct device *dev)
3968{ 3968{
3969 if (dev->power.is_prepared) 3969 if (dev->power.is_prepared)
3970 return true; 3970 return true;
3971#ifdef CONFIG_PM_RUNTIME 3971#ifdef CONFIG_PM
3972 if (dev->power.runtime_status == RPM_SUSPENDING) 3972 if (dev->power.runtime_status == RPM_SUSPENDING)
3973 return true; 3973 return true;
3974#endif 3974#endif
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 897640188acd..c2daa85fc9f7 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -680,13 +680,21 @@ static int acpi_device_wakeup(struct acpi_device *adev, u32 target_state,
680 if (error) 680 if (error)
681 return error; 681 return error;
682 682
683 if (adev->wakeup.flags.enabled)
684 return 0;
685
683 res = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number); 686 res = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number);
684 if (ACPI_FAILURE(res)) { 687 if (ACPI_SUCCESS(res)) {
688 adev->wakeup.flags.enabled = 1;
689 } else {
685 acpi_disable_wakeup_device_power(adev); 690 acpi_disable_wakeup_device_power(adev);
686 return -EIO; 691 return -EIO;
687 } 692 }
688 } else { 693 } else {
689 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number); 694 if (adev->wakeup.flags.enabled) {
695 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
696 adev->wakeup.flags.enabled = 0;
697 }
690 acpi_disable_wakeup_device_power(adev); 698 acpi_disable_wakeup_device_power(adev);
691 } 699 }
692 return 0; 700 return 0;
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 5f9b74b9b71f..1b5853f384e2 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec)
844 844
845static void ec_remove_handlers(struct acpi_ec *ec) 845static void ec_remove_handlers(struct acpi_ec *ec)
846{ 846{
847 if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
848 return;
847 acpi_disable_gpe(NULL, ec->gpe); 849 acpi_disable_gpe(NULL, ec->gpe);
848 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, 850 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
849 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) 851 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index caf9b76b7ef8..7a36f02598a6 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
325 struct thermal_cooling_device *cdev; 325 struct thermal_cooling_device *cdev;
326 struct acpi_fan *fan; 326 struct acpi_fan *fan;
327 struct acpi_device *device = ACPI_COMPANION(&pdev->dev); 327 struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
328 char *name;
328 329
329 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); 330 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
330 if (!fan) { 331 if (!fan) {
@@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev)
346 } 347 }
347 } 348 }
348 349
349 cdev = thermal_cooling_device_register("Fan", device, 350 if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
351 name = "Fan";
352 else
353 name = acpi_device_bid(device);
354
355 cdev = thermal_cooling_device_register(name, device,
350 &fan_cooling_ops); 356 &fan_cooling_ops);
351 if (IS_ERR(cdev)) { 357 if (IS_ERR(cdev)) {
352 result = PTR_ERR(cdev); 358 result = PTR_ERR(cdev);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 1b1cf558d3d3..16914cc30882 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2214,7 +2214,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev)
2214 status = acpi_evaluate_reference(adev->handle, "_DEP", NULL, 2214 status = acpi_evaluate_reference(adev->handle, "_DEP", NULL,
2215 &dep_devices); 2215 &dep_devices);
2216 if (ACPI_FAILURE(status)) { 2216 if (ACPI_FAILURE(status)) {
2217 dev_err(&adev->dev, "Failed to evaluate _DEP.\n"); 2217 dev_dbg(&adev->dev, "Failed to evaluate _DEP.\n");
2218 return; 2218 return;
2219 } 2219 }
2220 2220
@@ -2224,7 +2224,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev)
2224 2224
2225 status = acpi_get_object_info(dep_devices.handles[i], &info); 2225 status = acpi_get_object_info(dep_devices.handles[i], &info);
2226 if (ACPI_FAILURE(status)) { 2226 if (ACPI_FAILURE(status)) {
2227 dev_err(&adev->dev, "Error reading device info\n"); 2227 dev_dbg(&adev->dev, "Error reading _DEP device info\n");
2228 continue; 2228 continue;
2229 } 2229 }
2230 2230
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index dd8ff63ee2b4..cd49a3982b6a 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -346,22 +346,16 @@ acpi_evaluate_reference(acpi_handle handle,
346 package = buffer.pointer; 346 package = buffer.pointer;
347 347
348 if ((buffer.length == 0) || !package) { 348 if ((buffer.length == 0) || !package) {
349 printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n",
350 (unsigned)buffer.length, package);
351 status = AE_BAD_DATA; 349 status = AE_BAD_DATA;
352 acpi_util_eval_error(handle, pathname, status); 350 acpi_util_eval_error(handle, pathname, status);
353 goto end; 351 goto end;
354 } 352 }
355 if (package->type != ACPI_TYPE_PACKAGE) { 353 if (package->type != ACPI_TYPE_PACKAGE) {
356 printk(KERN_ERR PREFIX "Expecting a [Package], found type %X\n",
357 package->type);
358 status = AE_BAD_DATA; 354 status = AE_BAD_DATA;
359 acpi_util_eval_error(handle, pathname, status); 355 acpi_util_eval_error(handle, pathname, status);
360 goto end; 356 goto end;
361 } 357 }
362 if (!package->package.count) { 358 if (!package->package.count) {
363 printk(KERN_ERR PREFIX "[Package] has zero elements (%p)\n",
364 package);
365 status = AE_BAD_DATA; 359 status = AE_BAD_DATA;
366 acpi_util_eval_error(handle, pathname, status); 360 acpi_util_eval_error(handle, pathname, status);
367 goto end; 361 goto end;
@@ -380,17 +374,13 @@ acpi_evaluate_reference(acpi_handle handle,
380 374
381 if (element->type != ACPI_TYPE_LOCAL_REFERENCE) { 375 if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
382 status = AE_BAD_DATA; 376 status = AE_BAD_DATA;
383 printk(KERN_ERR PREFIX
384 "Expecting a [Reference] package element, found type %X\n",
385 element->type);
386 acpi_util_eval_error(handle, pathname, status); 377 acpi_util_eval_error(handle, pathname, status);
387 break; 378 break;
388 } 379 }
389 380
390 if (!element->reference.handle) { 381 if (!element->reference.handle) {
391 printk(KERN_WARNING PREFIX "Invalid reference in"
392 " package %s\n", pathname);
393 status = AE_NULL_ENTRY; 382 status = AE_NULL_ENTRY;
383 acpi_util_eval_error(handle, pathname, status);
394 break; 384 break;
395 } 385 }
396 /* Get the acpi_handle. */ 386 /* Get the acpi_handle. */
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 185a57d13723..1eaadff2e198 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -155,6 +155,7 @@ struct acpi_video_bus {
155 u8 dos_setting; 155 u8 dos_setting;
156 struct acpi_video_enumerated_device *attached_array; 156 struct acpi_video_enumerated_device *attached_array;
157 u8 attached_count; 157 u8 attached_count;
158 u8 child_count;
158 struct acpi_video_bus_cap cap; 159 struct acpi_video_bus_cap cap;
159 struct acpi_video_bus_flags flags; 160 struct acpi_video_bus_flags flags;
160 struct list_head video_device_list; 161 struct list_head video_device_list;
@@ -1159,8 +1160,12 @@ static bool acpi_video_device_in_dod(struct acpi_video_device *device)
1159 struct acpi_video_bus *video = device->video; 1160 struct acpi_video_bus *video = device->video;
1160 int i; 1161 int i;
1161 1162
1162 /* If we have a broken _DOD, no need to test */ 1163 /*
1163 if (!video->attached_count) 1164 * If we have a broken _DOD or we have more than 8 output devices
1165 * under the graphics controller node that we can't proper deal with
1166 * in the operation region code currently, no need to test.
1167 */
1168 if (!video->attached_count || video->child_count > 8)
1164 return true; 1169 return true;
1165 1170
1166 for (i = 0; i < video->attached_count; i++) { 1171 for (i = 0; i < video->attached_count; i++) {
@@ -1413,6 +1418,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
1413 dev_err(&dev->dev, "Can't attach device\n"); 1418 dev_err(&dev->dev, "Can't attach device\n");
1414 break; 1419 break;
1415 } 1420 }
1421 video->child_count++;
1416 } 1422 }
1417 return status; 1423 return status;
1418} 1424}
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index cd4cccbfd2ab..a3a13605a9c4 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -61,7 +61,7 @@ config ATA_ACPI
61 61
62config SATA_ZPODD 62config SATA_ZPODD
63 bool "SATA Zero Power Optical Disc Drive (ZPODD) support" 63 bool "SATA Zero Power Optical Disc Drive (ZPODD) support"
64 depends on ATA_ACPI && PM_RUNTIME 64 depends on ATA_ACPI && PM
65 default n 65 default n
66 help 66 help
67 This option adds support for SATA Zero Power Optical Disc 67 This option adds support for SATA Zero Power Optical Disc
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 2d195f3a1998..d24dd614a0bd 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -84,7 +84,11 @@ struct dev_pm_opp {
84 * 84 *
85 * This is an internal data structure maintaining the link to opps attached to 85 * This is an internal data structure maintaining the link to opps attached to
86 * a device. This structure is not meant to be shared to users as it is 86 * a device. This structure is not meant to be shared to users as it is
87 * meant for book keeping and private to OPP library 87 * meant for book keeping and private to OPP library.
88 *
89 * Because the opp structures can be used from both rcu and srcu readers, we
90 * need to wait for the grace period of both of them before freeing any
91 * resources. And so we have used kfree_rcu() from within call_srcu() handlers.
88 */ 92 */
89struct device_opp { 93struct device_opp {
90 struct list_head node; 94 struct list_head node;
@@ -382,12 +386,34 @@ struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
382} 386}
383EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor); 387EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor);
384 388
389static struct device_opp *add_device_opp(struct device *dev)
390{
391 struct device_opp *dev_opp;
392
393 /*
394 * Allocate a new device OPP table. In the infrequent case where a new
395 * device is needed to be added, we pay this penalty.
396 */
397 dev_opp = kzalloc(sizeof(*dev_opp), GFP_KERNEL);
398 if (!dev_opp)
399 return NULL;
400
401 dev_opp->dev = dev;
402 srcu_init_notifier_head(&dev_opp->srcu_head);
403 INIT_LIST_HEAD(&dev_opp->opp_list);
404
405 /* Secure the device list modification */
406 list_add_rcu(&dev_opp->node, &dev_opp_list);
407 return dev_opp;
408}
409
385static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq, 410static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq,
386 unsigned long u_volt, bool dynamic) 411 unsigned long u_volt, bool dynamic)
387{ 412{
388 struct device_opp *dev_opp = NULL; 413 struct device_opp *dev_opp = NULL;
389 struct dev_pm_opp *opp, *new_opp; 414 struct dev_pm_opp *opp, *new_opp;
390 struct list_head *head; 415 struct list_head *head;
416 int ret;
391 417
392 /* allocate new OPP node */ 418 /* allocate new OPP node */
393 new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL); 419 new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL);
@@ -400,7 +426,6 @@ static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq,
400 mutex_lock(&dev_opp_list_lock); 426 mutex_lock(&dev_opp_list_lock);
401 427
402 /* populate the opp table */ 428 /* populate the opp table */
403 new_opp->dev_opp = dev_opp;
404 new_opp->rate = freq; 429 new_opp->rate = freq;
405 new_opp->u_volt = u_volt; 430 new_opp->u_volt = u_volt;
406 new_opp->available = true; 431 new_opp->available = true;
@@ -409,27 +434,12 @@ static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq,
409 /* Check for existing list for 'dev' */ 434 /* Check for existing list for 'dev' */
410 dev_opp = find_device_opp(dev); 435 dev_opp = find_device_opp(dev);
411 if (IS_ERR(dev_opp)) { 436 if (IS_ERR(dev_opp)) {
412 /* 437 dev_opp = add_device_opp(dev);
413 * Allocate a new device OPP table. In the infrequent case
414 * where a new device is needed to be added, we pay this
415 * penalty.
416 */
417 dev_opp = kzalloc(sizeof(struct device_opp), GFP_KERNEL);
418 if (!dev_opp) { 438 if (!dev_opp) {
419 mutex_unlock(&dev_opp_list_lock); 439 ret = -ENOMEM;
420 kfree(new_opp); 440 goto free_opp;
421 dev_warn(dev,
422 "%s: Unable to create device OPP structure\n",
423 __func__);
424 return -ENOMEM;
425 } 441 }
426 442
427 dev_opp->dev = dev;
428 srcu_init_notifier_head(&dev_opp->srcu_head);
429 INIT_LIST_HEAD(&dev_opp->opp_list);
430
431 /* Secure the device list modification */
432 list_add_rcu(&dev_opp->node, &dev_opp_list);
433 head = &dev_opp->opp_list; 443 head = &dev_opp->opp_list;
434 goto list_add; 444 goto list_add;
435 } 445 }
@@ -448,18 +458,17 @@ static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq,
448 458
449 /* Duplicate OPPs ? */ 459 /* Duplicate OPPs ? */
450 if (new_opp->rate == opp->rate) { 460 if (new_opp->rate == opp->rate) {
451 int ret = opp->available && new_opp->u_volt == opp->u_volt ? 461 ret = opp->available && new_opp->u_volt == opp->u_volt ?
452 0 : -EEXIST; 462 0 : -EEXIST;
453 463
454 dev_warn(dev, "%s: duplicate OPPs detected. Existing: freq: %lu, volt: %lu, enabled: %d. New: freq: %lu, volt: %lu, enabled: %d\n", 464 dev_warn(dev, "%s: duplicate OPPs detected. Existing: freq: %lu, volt: %lu, enabled: %d. New: freq: %lu, volt: %lu, enabled: %d\n",
455 __func__, opp->rate, opp->u_volt, opp->available, 465 __func__, opp->rate, opp->u_volt, opp->available,
456 new_opp->rate, new_opp->u_volt, new_opp->available); 466 new_opp->rate, new_opp->u_volt, new_opp->available);
457 mutex_unlock(&dev_opp_list_lock); 467 goto free_opp;
458 kfree(new_opp);
459 return ret;
460 } 468 }
461 469
462list_add: 470list_add:
471 new_opp->dev_opp = dev_opp;
463 list_add_rcu(&new_opp->node, head); 472 list_add_rcu(&new_opp->node, head);
464 mutex_unlock(&dev_opp_list_lock); 473 mutex_unlock(&dev_opp_list_lock);
465 474
@@ -469,6 +478,11 @@ list_add:
469 */ 478 */
470 srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ADD, new_opp); 479 srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ADD, new_opp);
471 return 0; 480 return 0;
481
482free_opp:
483 mutex_unlock(&dev_opp_list_lock);
484 kfree(new_opp);
485 return ret;
472} 486}
473 487
474/** 488/**
@@ -511,10 +525,11 @@ static void kfree_device_rcu(struct rcu_head *head)
511{ 525{
512 struct device_opp *device_opp = container_of(head, struct device_opp, rcu_head); 526 struct device_opp *device_opp = container_of(head, struct device_opp, rcu_head);
513 527
514 kfree(device_opp); 528 kfree_rcu(device_opp, rcu_head);
515} 529}
516 530
517void __dev_pm_opp_remove(struct device_opp *dev_opp, struct dev_pm_opp *opp) 531static void __dev_pm_opp_remove(struct device_opp *dev_opp,
532 struct dev_pm_opp *opp)
518{ 533{
519 /* 534 /*
520 * Notify the changes in the availability of the operable 535 * Notify the changes in the availability of the operable
@@ -592,7 +607,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_remove);
592static int opp_set_availability(struct device *dev, unsigned long freq, 607static int opp_set_availability(struct device *dev, unsigned long freq,
593 bool availability_req) 608 bool availability_req)
594{ 609{
595 struct device_opp *tmp_dev_opp, *dev_opp = ERR_PTR(-ENODEV); 610 struct device_opp *dev_opp;
596 struct dev_pm_opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV); 611 struct dev_pm_opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV);
597 int r = 0; 612 int r = 0;
598 613
@@ -606,12 +621,7 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
606 mutex_lock(&dev_opp_list_lock); 621 mutex_lock(&dev_opp_list_lock);
607 622
608 /* Find the device_opp */ 623 /* Find the device_opp */
609 list_for_each_entry(tmp_dev_opp, &dev_opp_list, node) { 624 dev_opp = find_device_opp(dev);
610 if (dev == tmp_dev_opp->dev) {
611 dev_opp = tmp_dev_opp;
612 break;
613 }
614 }
615 if (IS_ERR(dev_opp)) { 625 if (IS_ERR(dev_opp)) {
616 r = PTR_ERR(dev_opp); 626 r = PTR_ERR(dev_opp);
617 dev_warn(dev, "%s: Device OPP not found (%d)\n", __func__, r); 627 dev_warn(dev, "%s: Device OPP not found (%d)\n", __func__, r);
@@ -768,7 +778,7 @@ EXPORT_SYMBOL_GPL(of_init_opp_table);
768 */ 778 */
769void of_free_opp_table(struct device *dev) 779void of_free_opp_table(struct device *dev)
770{ 780{
771 struct device_opp *dev_opp = find_device_opp(dev); 781 struct device_opp *dev_opp;
772 struct dev_pm_opp *opp, *tmp; 782 struct dev_pm_opp *opp, *tmp;
773 783
774 /* Check for existing list for 'dev' */ 784 /* Check for existing list for 'dev' */
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 1405b393c93d..742eefba12c2 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -199,7 +199,14 @@ static signed int pid_calc(struct _pid *pid, int32_t busy)
199 199
200 pid->integral += fp_error; 200 pid->integral += fp_error;
201 201
202 /* limit the integral term */ 202 /*
203 * We limit the integral here so that it will never
204 * get higher than 30. This prevents it from becoming
205 * too large an input over long periods of time and allows
206 * it to get factored out sooner.
207 *
208 * The value of 30 was chosen through experimentation.
209 */
203 integral_limit = int_tofp(30); 210 integral_limit = int_tofp(30);
204 if (pid->integral > integral_limit) 211 if (pid->integral > integral_limit)
205 pid->integral = integral_limit; 212 pid->integral = integral_limit;
@@ -616,6 +623,11 @@ static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max)
616 if (limits.no_turbo || limits.turbo_disabled) 623 if (limits.no_turbo || limits.turbo_disabled)
617 max_perf = cpu->pstate.max_pstate; 624 max_perf = cpu->pstate.max_pstate;
618 625
626 /*
627 * performance can be limited by user through sysfs, by cpufreq
628 * policy, or by cpu specific default values determined through
629 * experimentation.
630 */
619 max_perf_adj = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf)); 631 max_perf_adj = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf));
620 *max = clamp_t(int, max_perf_adj, 632 *max = clamp_t(int, max_perf_adj,
621 cpu->pstate.min_pstate, cpu->pstate.turbo_pstate); 633 cpu->pstate.min_pstate, cpu->pstate.turbo_pstate);
@@ -717,11 +729,29 @@ static inline int32_t intel_pstate_get_scaled_busy(struct cpudata *cpu)
717 u32 duration_us; 729 u32 duration_us;
718 u32 sample_time; 730 u32 sample_time;
719 731
732 /*
733 * core_busy is the ratio of actual performance to max
734 * max_pstate is the max non turbo pstate available
735 * current_pstate was the pstate that was requested during
736 * the last sample period.
737 *
738 * We normalize core_busy, which was our actual percent
739 * performance to what we requested during the last sample
740 * period. The result will be a percentage of busy at a
741 * specified pstate.
742 */
720 core_busy = cpu->sample.core_pct_busy; 743 core_busy = cpu->sample.core_pct_busy;
721 max_pstate = int_tofp(cpu->pstate.max_pstate); 744 max_pstate = int_tofp(cpu->pstate.max_pstate);
722 current_pstate = int_tofp(cpu->pstate.current_pstate); 745 current_pstate = int_tofp(cpu->pstate.current_pstate);
723 core_busy = mul_fp(core_busy, div_fp(max_pstate, current_pstate)); 746 core_busy = mul_fp(core_busy, div_fp(max_pstate, current_pstate));
724 747
748 /*
749 * Since we have a deferred timer, it will not fire unless
750 * we are in C0. So, determine if the actual elapsed time
751 * is significantly greater (3x) than our sample interval. If it
752 * is, then we were idle for a long enough period of time
753 * to adjust our busyness.
754 */
725 sample_time = pid_params.sample_rate_ms * USEC_PER_MSEC; 755 sample_time = pid_params.sample_rate_ms * USEC_PER_MSEC;
726 duration_us = (u32) ktime_us_delta(cpu->sample.time, 756 duration_us = (u32) ktime_us_delta(cpu->sample.time,
727 cpu->last_sample_time); 757 cpu->last_sample_time);
@@ -948,6 +978,7 @@ static struct cpufreq_driver intel_pstate_driver = {
948 978
949static int __initdata no_load; 979static int __initdata no_load;
950static int __initdata no_hwp; 980static int __initdata no_hwp;
981static unsigned int force_load;
951 982
952static int intel_pstate_msrs_not_valid(void) 983static int intel_pstate_msrs_not_valid(void)
953{ 984{
@@ -1094,7 +1125,8 @@ static bool intel_pstate_platform_pwr_mgmt_exists(void)
1094 case PSS: 1125 case PSS:
1095 return intel_pstate_no_acpi_pss(); 1126 return intel_pstate_no_acpi_pss();
1096 case PPC: 1127 case PPC:
1097 return intel_pstate_has_acpi_ppc(); 1128 return intel_pstate_has_acpi_ppc() &&
1129 (!force_load);
1098 } 1130 }
1099 } 1131 }
1100 1132
@@ -1175,6 +1207,8 @@ static int __init intel_pstate_setup(char *str)
1175 no_load = 1; 1207 no_load = 1;
1176 if (!strcmp(str, "no_hwp")) 1208 if (!strcmp(str, "no_hwp"))
1177 no_hwp = 1; 1209 no_hwp = 1;
1210 if (!strcmp(str, "force"))
1211 force_load = 1;
1178 return 0; 1212 return 0;
1179} 1213}
1180early_param("intel_pstate", intel_pstate_setup); 1214early_param("intel_pstate", intel_pstate_setup);
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 8a8ba11c5c14..7ea1ea42c2d2 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -203,7 +203,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
203 fwnode_property_read_string(child, "linux,default-trigger", 203 fwnode_property_read_string(child, "linux,default-trigger",
204 &led.default_trigger); 204 &led.default_trigger);
205 205
206 if (!fwnode_property_read_string(child, "linux,default_state", 206 if (!fwnode_property_read_string(child, "default-state",
207 &state)) { 207 &state)) {
208 if (!strcmp(state, "keep")) 208 if (!strcmp(state, "keep"))
209 led.default_state = LEDS_GPIO_DEFSTATE_KEEP; 209 led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index dba29b80184b..765bffb49a72 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -104,7 +104,7 @@ config VIDEO_OMAP3_DEBUG
104config VIDEO_S3C_CAMIF 104config VIDEO_S3C_CAMIF
105 tristate "Samsung S3C24XX/S3C64XX SoC Camera Interface driver" 105 tristate "Samsung S3C24XX/S3C64XX SoC Camera Interface driver"
106 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API 106 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
107 depends on PM_RUNTIME 107 depends on PM
108 depends on ARCH_S3C64XX || PLAT_S3C24XX || COMPILE_TEST 108 depends on ARCH_S3C64XX || PLAT_S3C24XX || COMPILE_TEST
109 depends on HAS_DMA 109 depends on HAS_DMA
110 select VIDEOBUF2_DMA_CONTIG 110 select VIDEOBUF2_DMA_CONTIG
diff --git a/drivers/media/platform/s5p-tv/Kconfig b/drivers/media/platform/s5p-tv/Kconfig
index beb180e71ba0..5a1835dd65e8 100644
--- a/drivers/media/platform/s5p-tv/Kconfig
+++ b/drivers/media/platform/s5p-tv/Kconfig
@@ -8,7 +8,7 @@
8 8
9config VIDEO_SAMSUNG_S5P_TV 9config VIDEO_SAMSUNG_S5P_TV
10 bool "Samsung TV driver for S5P platform" 10 bool "Samsung TV driver for S5P platform"
11 depends on PM_RUNTIME 11 depends on PM
12 depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST 12 depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST
13 default n 13 default n
14 ---help--- 14 ---help---
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 62aba9af19f4..03d7c7521d97 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2561,7 +2561,7 @@ static int atmci_runtime_resume(struct device *dev)
2561static const struct dev_pm_ops atmci_dev_pm_ops = { 2561static const struct dev_pm_ops atmci_dev_pm_ops = {
2562 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 2562 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
2563 pm_runtime_force_resume) 2563 pm_runtime_force_resume)
2564 SET_PM_RUNTIME_PM_OPS(atmci_runtime_suspend, atmci_runtime_resume, NULL) 2564 SET_RUNTIME_PM_OPS(atmci_runtime_suspend, atmci_runtime_resume, NULL)
2565}; 2565};
2566 2566
2567static struct platform_driver atmci_driver = { 2567static struct platform_driver atmci_driver = {
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index d2ccd2890647..aa6a333b2ead 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2154,7 +2154,7 @@ static int trf7970a_resume(struct device *dev)
2154} 2154}
2155#endif 2155#endif
2156 2156
2157#ifdef CONFIG_PM_RUNTIME 2157#ifdef CONFIG_PM
2158static int trf7970a_pm_runtime_suspend(struct device *dev) 2158static int trf7970a_pm_runtime_suspend(struct device *dev)
2159{ 2159{
2160 struct spi_device *spi = container_of(dev, struct spi_device, dev); 2160 struct spi_device *spi = container_of(dev, struct spi_device, dev);
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
index 4e489a8850e5..6f4aef3db248 100644
--- a/drivers/phy/phy-omap-usb2.c
+++ b/drivers/phy/phy-omap-usb2.c
@@ -318,7 +318,7 @@ static int omap_usb2_remove(struct platform_device *pdev)
318 return 0; 318 return 0;
319} 319}
320 320
321#ifdef CONFIG_PM_RUNTIME 321#ifdef CONFIG_PM
322 322
323static int omap_usb2_runtime_suspend(struct device *dev) 323static int omap_usb2_runtime_suspend(struct device *dev)
324{ 324{
diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c
index c297b7a10d30..1387b4d4afe3 100644
--- a/drivers/phy/phy-ti-pipe3.c
+++ b/drivers/phy/phy-ti-pipe3.c
@@ -423,7 +423,7 @@ static int ti_pipe3_remove(struct platform_device *pdev)
423 return 0; 423 return 0;
424} 424}
425 425
426#ifdef CONFIG_PM_RUNTIME 426#ifdef CONFIG_PM
427 427
428static int ti_pipe3_runtime_suspend(struct device *dev) 428static int ti_pipe3_runtime_suspend(struct device *dev)
429{ 429{
diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c
index 62c15af58c9a..777324992c59 100644
--- a/drivers/power/pm2301_charger.c
+++ b/drivers/power/pm2301_charger.c
@@ -951,8 +951,6 @@ static int pm2xxx_wall_charger_suspend(struct device *dev)
951 951
952#endif 952#endif
953 953
954#ifdef CONFIG_PM_RUNTIME
955
956static int pm2xxx_runtime_suspend(struct device *dev) 954static int pm2xxx_runtime_suspend(struct device *dev)
957{ 955{
958 struct i2c_client *pm2xxx_i2c_client = to_i2c_client(dev); 956 struct i2c_client *pm2xxx_i2c_client = to_i2c_client(dev);
@@ -977,8 +975,6 @@ static int pm2xxx_runtime_resume(struct device *dev)
977 return 0; 975 return 0;
978} 976}
979 977
980#endif
981
982static const struct dev_pm_ops pm2xxx_pm_ops = { 978static const struct dev_pm_ops pm2xxx_pm_ops = {
983 SET_SYSTEM_SLEEP_PM_OPS(pm2xxx_wall_charger_suspend, 979 SET_SYSTEM_SLEEP_PM_OPS(pm2xxx_wall_charger_suspend,
984 pm2xxx_wall_charger_resume) 980 pm2xxx_wall_charger_resume)
diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
index 7454498c4091..9e43ae1d2163 100644
--- a/drivers/scsi/scsi_pm.c
+++ b/drivers/scsi/scsi_pm.c
@@ -213,8 +213,6 @@ static int scsi_bus_restore(struct device *dev)
213 213
214#endif /* CONFIG_PM_SLEEP */ 214#endif /* CONFIG_PM_SLEEP */
215 215
216#ifdef CONFIG_PM_RUNTIME
217
218static int sdev_runtime_suspend(struct device *dev) 216static int sdev_runtime_suspend(struct device *dev)
219{ 217{
220 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 218 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
@@ -332,14 +330,6 @@ void scsi_autopm_put_host(struct Scsi_Host *shost)
332 pm_runtime_put_sync(&shost->shost_gendev); 330 pm_runtime_put_sync(&shost->shost_gendev);
333} 331}
334 332
335#else
336
337#define scsi_runtime_suspend NULL
338#define scsi_runtime_resume NULL
339#define scsi_runtime_idle NULL
340
341#endif /* CONFIG_PM_RUNTIME */
342
343const struct dev_pm_ops scsi_bus_pm_ops = { 333const struct dev_pm_ops scsi_bus_pm_ops = {
344 .prepare = scsi_bus_prepare, 334 .prepare = scsi_bus_prepare,
345 .suspend = scsi_bus_suspend, 335 .suspend = scsi_bus_suspend,
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index 2dc4a83fb84c..e3902fc66278 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -155,8 +155,7 @@ static inline void scsi_netlink_exit(void) {}
155/* scsi_pm.c */ 155/* scsi_pm.c */
156#ifdef CONFIG_PM 156#ifdef CONFIG_PM
157extern const struct dev_pm_ops scsi_bus_pm_ops; 157extern const struct dev_pm_ops scsi_bus_pm_ops;
158#endif 158
159#ifdef CONFIG_PM_RUNTIME
160extern void scsi_autopm_get_target(struct scsi_target *); 159extern void scsi_autopm_get_target(struct scsi_target *);
161extern void scsi_autopm_put_target(struct scsi_target *); 160extern void scsi_autopm_put_target(struct scsi_target *);
162extern int scsi_autopm_get_host(struct Scsi_Host *); 161extern int scsi_autopm_get_host(struct Scsi_Host *);
@@ -166,7 +165,7 @@ static inline void scsi_autopm_get_target(struct scsi_target *t) {}
166static inline void scsi_autopm_put_target(struct scsi_target *t) {} 165static inline void scsi_autopm_put_target(struct scsi_target *t) {}
167static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; } 166static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; }
168static inline void scsi_autopm_put_host(struct Scsi_Host *h) {} 167static inline void scsi_autopm_put_host(struct Scsi_Host *h) {}
169#endif /* CONFIG_PM_RUNTIME */ 168#endif /* CONFIG_PM */
170 169
171extern struct async_domain scsi_sd_pm_domain; 170extern struct async_domain scsi_sd_pm_domain;
172extern struct async_domain scsi_sd_probe_domain; 171extern struct async_domain scsi_sd_probe_domain;
diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c
index 955ed5587011..d15eaa466c59 100644
--- a/drivers/scsi/ufs/ufshcd-pci.c
+++ b/drivers/scsi/ufs/ufshcd-pci.c
@@ -62,12 +62,7 @@ static int ufshcd_pci_resume(struct device *dev)
62{ 62{
63 return ufshcd_system_resume(dev_get_drvdata(dev)); 63 return ufshcd_system_resume(dev_get_drvdata(dev));
64} 64}
65#else
66#define ufshcd_pci_suspend NULL
67#define ufshcd_pci_resume NULL
68#endif /* CONFIG_PM */
69 65
70#ifdef CONFIG_PM_RUNTIME
71static int ufshcd_pci_runtime_suspend(struct device *dev) 66static int ufshcd_pci_runtime_suspend(struct device *dev)
72{ 67{
73 return ufshcd_runtime_suspend(dev_get_drvdata(dev)); 68 return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -80,11 +75,13 @@ static int ufshcd_pci_runtime_idle(struct device *dev)
80{ 75{
81 return ufshcd_runtime_idle(dev_get_drvdata(dev)); 76 return ufshcd_runtime_idle(dev_get_drvdata(dev));
82} 77}
83#else /* !CONFIG_PM_RUNTIME */ 78#else /* !CONFIG_PM */
79#define ufshcd_pci_suspend NULL
80#define ufshcd_pci_resume NULL
84#define ufshcd_pci_runtime_suspend NULL 81#define ufshcd_pci_runtime_suspend NULL
85#define ufshcd_pci_runtime_resume NULL 82#define ufshcd_pci_runtime_resume NULL
86#define ufshcd_pci_runtime_idle NULL 83#define ufshcd_pci_runtime_idle NULL
87#endif /* CONFIG_PM_RUNTIME */ 84#endif /* CONFIG_PM */
88 85
89/** 86/**
90 * ufshcd_pci_shutdown - main function to put the controller in reset state 87 * ufshcd_pci_shutdown - main function to put the controller in reset state
diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 0c030ad8a960..7db9564f507d 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -261,12 +261,7 @@ static int ufshcd_pltfrm_resume(struct device *dev)
261{ 261{
262 return ufshcd_system_resume(dev_get_drvdata(dev)); 262 return ufshcd_system_resume(dev_get_drvdata(dev));
263} 263}
264#else
265#define ufshcd_pltfrm_suspend NULL
266#define ufshcd_pltfrm_resume NULL
267#endif
268 264
269#ifdef CONFIG_PM_RUNTIME
270static int ufshcd_pltfrm_runtime_suspend(struct device *dev) 265static int ufshcd_pltfrm_runtime_suspend(struct device *dev)
271{ 266{
272 return ufshcd_runtime_suspend(dev_get_drvdata(dev)); 267 return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -279,11 +274,13 @@ static int ufshcd_pltfrm_runtime_idle(struct device *dev)
279{ 274{
280 return ufshcd_runtime_idle(dev_get_drvdata(dev)); 275 return ufshcd_runtime_idle(dev_get_drvdata(dev));
281} 276}
282#else /* !CONFIG_PM_RUNTIME */ 277#else /* !CONFIG_PM */
278#define ufshcd_pltfrm_suspend NULL
279#define ufshcd_pltfrm_resume NULL
283#define ufshcd_pltfrm_runtime_suspend NULL 280#define ufshcd_pltfrm_runtime_suspend NULL
284#define ufshcd_pltfrm_runtime_resume NULL 281#define ufshcd_pltfrm_runtime_resume NULL
285#define ufshcd_pltfrm_runtime_idle NULL 282#define ufshcd_pltfrm_runtime_idle NULL
286#endif /* CONFIG_PM_RUNTIME */ 283#endif /* CONFIG_PM */
287 284
288static void ufshcd_pltfrm_shutdown(struct platform_device *pdev) 285static void ufshcd_pltfrm_shutdown(struct platform_device *pdev)
289{ 286{
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index e2fa628e55e7..41b5dc4445f6 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -491,7 +491,7 @@ static int mcfqspi_resume(struct device *dev)
491} 491}
492#endif 492#endif
493 493
494#ifdef CONFIG_PM_RUNTIME 494#ifdef CONFIG_PM
495static int mcfqspi_runtime_suspend(struct device *dev) 495static int mcfqspi_runtime_suspend(struct device *dev)
496{ 496{
497 struct spi_master *master = dev_get_drvdata(dev); 497 struct spi_master *master = dev_get_drvdata(dev);
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 932da4825e74..3dec9e0b99b8 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -523,7 +523,7 @@ static int orion_spi_remove(struct platform_device *pdev)
523 523
524MODULE_ALIAS("platform:" DRIVER_NAME); 524MODULE_ALIAS("platform:" DRIVER_NAME);
525 525
526#ifdef CONFIG_PM_RUNTIME 526#ifdef CONFIG_PM
527static int orion_spi_runtime_suspend(struct device *dev) 527static int orion_spi_runtime_suspend(struct device *dev)
528{ 528{
529 struct spi_master *master = dev_get_drvdata(dev); 529 struct spi_master *master = dev_get_drvdata(dev);
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 2a41b2d6fa16..05c623cfb078 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1531,7 +1531,7 @@ static int pxa2xx_spi_resume(struct device *dev)
1531} 1531}
1532#endif 1532#endif
1533 1533
1534#ifdef CONFIG_PM_RUNTIME 1534#ifdef CONFIG_PM
1535static int pxa2xx_spi_runtime_suspend(struct device *dev) 1535static int pxa2xx_spi_runtime_suspend(struct device *dev)
1536{ 1536{
1537 struct driver_data *drv_data = dev_get_drvdata(dev); 1537 struct driver_data *drv_data = dev_get_drvdata(dev);
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 390ed712eeed..e7fb5a0d2e8d 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -646,7 +646,7 @@ error:
646 return ret; 646 return ret;
647} 647}
648 648
649#ifdef CONFIG_PM_RUNTIME 649#ifdef CONFIG_PM
650static int spi_qup_pm_suspend_runtime(struct device *device) 650static int spi_qup_pm_suspend_runtime(struct device *device)
651{ 651{
652 struct spi_master *master = dev_get_drvdata(device); 652 struct spi_master *master = dev_get_drvdata(device);
@@ -672,7 +672,7 @@ static int spi_qup_pm_resume_runtime(struct device *device)
672 writel_relaxed(config, controller->base + QUP_CONFIG); 672 writel_relaxed(config, controller->base + QUP_CONFIG);
673 return 0; 673 return 0;
674} 674}
675#endif /* CONFIG_PM_RUNTIME */ 675#endif /* CONFIG_PM */
676 676
677#ifdef CONFIG_PM_SLEEP 677#ifdef CONFIG_PM_SLEEP
678static int spi_qup_suspend(struct device *device) 678static int spi_qup_suspend(struct device *device)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 44c122558901..daabbabd26b0 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -799,7 +799,7 @@ static int rockchip_spi_resume(struct device *dev)
799} 799}
800#endif /* CONFIG_PM_SLEEP */ 800#endif /* CONFIG_PM_SLEEP */
801 801
802#ifdef CONFIG_PM_RUNTIME 802#ifdef CONFIG_PM
803static int rockchip_spi_runtime_suspend(struct device *dev) 803static int rockchip_spi_runtime_suspend(struct device *dev)
804{ 804{
805 struct spi_master *master = dev_get_drvdata(dev); 805 struct spi_master *master = dev_get_drvdata(dev);
@@ -827,7 +827,7 @@ static int rockchip_spi_runtime_resume(struct device *dev)
827 827
828 return ret; 828 return ret;
829} 829}
830#endif /* CONFIG_PM_RUNTIME */ 830#endif /* CONFIG_PM */
831 831
832static const struct dev_pm_ops rockchip_spi_pm = { 832static const struct dev_pm_ops rockchip_spi_pm = {
833 SET_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume) 833 SET_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 197bcf093174..37b19836f5cb 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1267,7 +1267,7 @@ static int s3c64xx_spi_resume(struct device *dev)
1267} 1267}
1268#endif /* CONFIG_PM_SLEEP */ 1268#endif /* CONFIG_PM_SLEEP */
1269 1269
1270#ifdef CONFIG_PM_RUNTIME 1270#ifdef CONFIG_PM
1271static int s3c64xx_spi_runtime_suspend(struct device *dev) 1271static int s3c64xx_spi_runtime_suspend(struct device *dev)
1272{ 1272{
1273 struct spi_master *master = dev_get_drvdata(dev); 1273 struct spi_master *master = dev_get_drvdata(dev);
@@ -1297,7 +1297,7 @@ static int s3c64xx_spi_runtime_resume(struct device *dev)
1297 1297
1298 return 0; 1298 return 0;
1299} 1299}
1300#endif /* CONFIG_PM_RUNTIME */ 1300#endif /* CONFIG_PM */
1301 1301
1302static const struct dev_pm_ops s3c64xx_spi_pm = { 1302static const struct dev_pm_ops s3c64xx_spi_pm = {
1303 SET_SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume) 1303 SET_SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume)
diff --git a/drivers/staging/gdm72xx/Kconfig b/drivers/staging/gdm72xx/Kconfig
index 5836503caa7b..bf11a7fbfc51 100644
--- a/drivers/staging/gdm72xx/Kconfig
+++ b/drivers/staging/gdm72xx/Kconfig
@@ -53,7 +53,7 @@ if WIMAX_GDM72XX_USB
53 53
54config WIMAX_GDM72XX_USB_PM 54config WIMAX_GDM72XX_USB_PM
55 bool "Enable power management support" 55 bool "Enable power management support"
56 depends on PM_RUNTIME 56 depends on PM
57 help 57 help
58 Enable USB power management in order to reduce power consumption 58 Enable USB power management in order to reduce power consumption
59 while the interface is not in use. 59 while the interface is not in use.
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index b4b58ae24c61..555de07db593 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -530,7 +530,7 @@ static int dw8250_resume(struct device *dev)
530} 530}
531#endif /* CONFIG_PM_SLEEP */ 531#endif /* CONFIG_PM_SLEEP */
532 532
533#ifdef CONFIG_PM_RUNTIME 533#ifdef CONFIG_PM
534static int dw8250_runtime_suspend(struct device *dev) 534static int dw8250_runtime_suspend(struct device *dev)
535{ 535{
536 struct dw8250_data *data = dev_get_drvdata(dev); 536 struct dw8250_data *data = dev_get_drvdata(dev);
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index 6f93123a428a..7a11fac775c4 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -244,7 +244,7 @@ static int mtk8250_resume(struct device *dev)
244} 244}
245#endif /* CONFIG_PM_SLEEP */ 245#endif /* CONFIG_PM_SLEEP */
246 246
247#ifdef CONFIG_PM_RUNTIME 247#ifdef CONFIG_PM
248static int mtk8250_runtime_suspend(struct device *dev) 248static int mtk8250_runtime_suspend(struct device *dev)
249{ 249{
250 struct mtk8250_data *data = dev_get_drvdata(dev); 250 struct mtk8250_data *data = dev_get_drvdata(dev);
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index e1f4fdad02c9..8fe4501d7565 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -1252,12 +1252,7 @@ static int serial_hsu_resume(struct pci_dev *pdev)
1252 } 1252 }
1253 return 0; 1253 return 0;
1254} 1254}
1255#else
1256#define serial_hsu_suspend NULL
1257#define serial_hsu_resume NULL
1258#endif
1259 1255
1260#ifdef CONFIG_PM_RUNTIME
1261static int serial_hsu_runtime_idle(struct device *dev) 1256static int serial_hsu_runtime_idle(struct device *dev)
1262{ 1257{
1263 pm_schedule_suspend(dev, 500); 1258 pm_schedule_suspend(dev, 500);
@@ -1274,6 +1269,8 @@ static int serial_hsu_runtime_resume(struct device *dev)
1274 return 0; 1269 return 0;
1275} 1270}
1276#else 1271#else
1272#define serial_hsu_suspend NULL
1273#define serial_hsu_resume NULL
1277#define serial_hsu_runtime_idle NULL 1274#define serial_hsu_runtime_idle NULL
1278#define serial_hsu_runtime_suspend NULL 1275#define serial_hsu_runtime_suspend NULL
1279#define serial_hsu_runtime_resume NULL 1276#define serial_hsu_runtime_resume NULL
diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c
index 8abe8ea65658..62da8534ba75 100644
--- a/drivers/tty/serial/msm_serial_hs.c
+++ b/drivers/tty/serial/msm_serial_hs.c
@@ -1792,7 +1792,7 @@ static void __exit msm_serial_hs_exit(void)
1792} 1792}
1793module_exit(msm_serial_hs_exit); 1793module_exit(msm_serial_hs_exit);
1794 1794
1795#ifdef CONFIG_PM_RUNTIME 1795#ifdef CONFIG_PM
1796static int msm_hs_runtime_idle(struct device *dev) 1796static int msm_hs_runtime_idle(struct device *dev)
1797{ 1797{
1798 /* 1798 /*
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 435478a245d3..2e1073da6719 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1776,7 +1776,7 @@ static void serial_omap_mdr1_errataset(struct uart_omap_port *up, u8 mdr1)
1776 } 1776 }
1777} 1777}
1778 1778
1779#ifdef CONFIG_PM_RUNTIME 1779#ifdef CONFIG_PM
1780static void serial_omap_restore_context(struct uart_omap_port *up) 1780static void serial_omap_restore_context(struct uart_omap_port *up)
1781{ 1781{
1782 if (up->errata & UART_ERRATA_i202_MDR1_ACCESS) 1782 if (up->errata & UART_ERRATA_i202_MDR1_ACCESS)
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 9cfda6a72194..cc0ced08bae2 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -43,7 +43,7 @@ config USB_DYNAMIC_MINORS
43 43
44config USB_OTG 44config USB_OTG
45 bool "OTG support" 45 bool "OTG support"
46 depends on PM_RUNTIME 46 depends on PM
47 default n 47 default n
48 help 48 help
49 The most notable feature of USB OTG is support for a 49 The most notable feature of USB OTG is support for a
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 0cd1f44f0ee8..c6d0c8e745b9 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -20,7 +20,7 @@ config AB8500_USB
20 20
21config FSL_USB2_OTG 21config FSL_USB2_OTG
22 bool "Freescale USB OTG Transceiver Driver" 22 bool "Freescale USB OTG Transceiver Driver"
23 depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM && PM_RUNTIME 23 depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM && PM
24 select USB_OTG 24 select USB_OTG
25 select USB_PHY 25 select USB_PHY
26 help 26 help
@@ -153,7 +153,7 @@ config USB_MSM_OTG
153 153
154config USB_MV_OTG 154config USB_MV_OTG
155 tristate "Marvell USB OTG support" 155 tristate "Marvell USB OTG support"
156 depends on USB_EHCI_MV && USB_MV_UDC && PM_RUNTIME 156 depends on USB_EHCI_MV && USB_MV_UDC && PM
157 select USB_OTG 157 select USB_OTG
158 select USB_PHY 158 select USB_PHY
159 help 159 help
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 715f299af6ea..ec84758f0e23 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -41,7 +41,7 @@ config USB_STORAGE_REALTEK
41 41
42config REALTEK_AUTOPM 42config REALTEK_AUTOPM
43 bool "Realtek Card Reader autosuspend support" 43 bool "Realtek Card Reader autosuspend support"
44 depends on USB_STORAGE_REALTEK && PM_RUNTIME 44 depends on USB_STORAGE_REALTEK && PM
45 default y 45 default y
46 46
47config USB_STORAGE_DATAFAB 47config USB_STORAGE_DATAFAB
diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
index a623a4d0c94f..7e3a05fc47aa 100644
--- a/drivers/video/fbdev/s3c-fb.c
+++ b/drivers/video/fbdev/s3c-fb.c
@@ -1630,7 +1630,7 @@ static int s3c_fb_resume(struct device *dev)
1630} 1630}
1631#endif 1631#endif
1632 1632
1633#ifdef CONFIG_PM_RUNTIME 1633#ifdef CONFIG_PM
1634static int s3c_fb_runtime_suspend(struct device *dev) 1634static int s3c_fb_runtime_suspend(struct device *dev)
1635{ 1635{
1636 struct s3c_fb *sfb = dev_get_drvdata(dev); 1636 struct s3c_fb *sfb = dev_get_drvdata(dev);
diff --git a/drivers/video/fbdev/sh_mobile_meram.c b/drivers/video/fbdev/sh_mobile_meram.c
index 1d56108dee9c..baadfb207b2e 100644
--- a/drivers/video/fbdev/sh_mobile_meram.c
+++ b/drivers/video/fbdev/sh_mobile_meram.c
@@ -569,7 +569,7 @@ EXPORT_SYMBOL_GPL(sh_mobile_meram_cache_update);
569 * Power management 569 * Power management
570 */ 570 */
571 571
572#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) 572#ifdef CONFIG_PM
573static int sh_mobile_meram_suspend(struct device *dev) 573static int sh_mobile_meram_suspend(struct device *dev)
574{ 574{
575 struct platform_device *pdev = to_platform_device(dev); 575 struct platform_device *pdev = to_platform_device(dev);
@@ -612,7 +612,7 @@ static int sh_mobile_meram_resume(struct device *dev)
612 meram_write_reg(priv->base, common_regs[i], priv->regs[i]); 612 meram_write_reg(priv->base, common_regs[i], priv->regs[i]);
613 return 0; 613 return 0;
614} 614}
615#endif /* CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME */ 615#endif /* CONFIG_PM */
616 616
617static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops, 617static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops,
618 sh_mobile_meram_suspend, 618 sh_mobile_meram_suspend,
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 7581518e3eff..61e32ec1fc4d 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -313,6 +313,7 @@ struct acpi_device_wakeup_flags {
313 u8 valid:1; /* Can successfully enable wakeup? */ 313 u8 valid:1; /* Can successfully enable wakeup? */
314 u8 run_wake:1; /* Run-Wake GPE devices */ 314 u8 run_wake:1; /* Run-Wake GPE devices */
315 u8 notifier_present:1; /* Wake-up notify handler has been installed */ 315 u8 notifier_present:1; /* Wake-up notify handler has been installed */
316 u8 enabled:1; /* Enabled for wakeup */
316}; 317};
317 318
318struct acpi_device_wakeup_context { 319struct acpi_device_wakeup_context {
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 66a656eb335b..8b5976364619 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -351,8 +351,6 @@ struct dev_pm_ops {
351#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) 351#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
352#endif 352#endif
353 353
354#define SET_PM_RUNTIME_PM_OPS SET_RUNTIME_PM_OPS
355
356/* 354/*
357 * Use this if you want to use the same suspend and resume callbacks for suspend 355 * Use this if you want to use the same suspend and resume callbacks for suspend
358 * to RAM and hibernation. 356 * to RAM and hibernation.
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 6364e23454dd..3a4edd1f7dbb 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -441,13 +441,13 @@ static inline int scsi_execute_req(struct scsi_device *sdev,
441extern void sdev_disable_disk_events(struct scsi_device *sdev); 441extern void sdev_disable_disk_events(struct scsi_device *sdev);
442extern void sdev_enable_disk_events(struct scsi_device *sdev); 442extern void sdev_enable_disk_events(struct scsi_device *sdev);
443 443
444#ifdef CONFIG_PM_RUNTIME 444#ifdef CONFIG_PM
445extern int scsi_autopm_get_device(struct scsi_device *); 445extern int scsi_autopm_get_device(struct scsi_device *);
446extern void scsi_autopm_put_device(struct scsi_device *); 446extern void scsi_autopm_put_device(struct scsi_device *);
447#else 447#else
448static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; } 448static inline int scsi_autopm_get_device(struct scsi_device *d) { return 0; }
449static inline void scsi_autopm_put_device(struct scsi_device *d) {} 449static inline void scsi_autopm_put_device(struct scsi_device *d) {}
450#endif /* CONFIG_PM_RUNTIME */ 450#endif /* CONFIG_PM */
451 451
452static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev) 452static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev)
453{ 453{
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 67d6369ddf83..979ccde26720 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -55,7 +55,7 @@ obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
55obj-$(CONFIG_EVENT_TRACING) += trace_events_trigger.o 55obj-$(CONFIG_EVENT_TRACING) += trace_events_trigger.o
56obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o 56obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
57obj-$(CONFIG_TRACEPOINTS) += power-traces.o 57obj-$(CONFIG_TRACEPOINTS) += power-traces.o
58ifeq ($(CONFIG_PM_RUNTIME),y) 58ifeq ($(CONFIG_PM),y)
59obj-$(CONFIG_TRACEPOINTS) += rpm-traces.o 59obj-$(CONFIG_TRACEPOINTS) += rpm-traces.o
60endif 60endif
61ifeq ($(CONFIG_TRACING),y) 61ifeq ($(CONFIG_TRACING),y)
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index 8337645aa7a5..8276a743e22e 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -1676,7 +1676,7 @@ irqreturn_t azx_interrupt(int irq, void *dev_id)
1676 u8 sd_status; 1676 u8 sd_status;
1677 int i; 1677 int i;
1678 1678
1679#ifdef CONFIG_PM_RUNTIME 1679#ifdef CONFIG_PM
1680 if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME) 1680 if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
1681 if (!pm_runtime_active(chip->card->dev)) 1681 if (!pm_runtime_active(chip->card->dev))
1682 return IRQ_NONE; 1682 return IRQ_NONE;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5ac0d39d59bc..2bf0b568e3de 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -872,7 +872,7 @@ static int azx_resume(struct device *dev)
872} 872}
873#endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */ 873#endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */
874 874
875#ifdef CONFIG_PM_RUNTIME 875#ifdef CONFIG_PM
876static int azx_runtime_suspend(struct device *dev) 876static int azx_runtime_suspend(struct device *dev)
877{ 877{
878 struct snd_card *card = dev_get_drvdata(dev); 878 struct snd_card *card = dev_get_drvdata(dev);
@@ -970,9 +970,6 @@ static int azx_runtime_idle(struct device *dev)
970 return 0; 970 return 0;
971} 971}
972 972
973#endif /* CONFIG_PM_RUNTIME */
974
975#ifdef CONFIG_PM
976static const struct dev_pm_ops azx_pm = { 973static const struct dev_pm_ops azx_pm = {
977 SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume) 974 SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume)
978 SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle) 975 SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle)
diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c
index c125925da92e..ec55c590afd0 100644
--- a/sound/soc/codecs/cs35l32.c
+++ b/sound/soc/codecs/cs35l32.c
@@ -550,7 +550,7 @@ static int cs35l32_i2c_remove(struct i2c_client *i2c_client)
550 return 0; 550 return 0;
551} 551}
552 552
553#ifdef CONFIG_PM_RUNTIME 553#ifdef CONFIG_PM
554static int cs35l32_runtime_suspend(struct device *dev) 554static int cs35l32_runtime_suspend(struct device *dev)
555{ 555{
556 struct cs35l32_private *cs35l32 = dev_get_drvdata(dev); 556 struct cs35l32_private *cs35l32 = dev_get_drvdata(dev);
diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c
index 02b1520ae0bc..670ebfe12903 100644
--- a/sound/soc/codecs/cs42xx8.c
+++ b/sound/soc/codecs/cs42xx8.c
@@ -537,7 +537,7 @@ err_enable:
537} 537}
538EXPORT_SYMBOL_GPL(cs42xx8_probe); 538EXPORT_SYMBOL_GPL(cs42xx8_probe);
539 539
540#ifdef CONFIG_PM_RUNTIME 540#ifdef CONFIG_PM
541static int cs42xx8_runtime_resume(struct device *dev) 541static int cs42xx8_runtime_resume(struct device *dev)
542{ 542{
543 struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev); 543 struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev);
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 151f718241ea..b112b1c2c394 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2611,7 +2611,7 @@ static int max98090_i2c_remove(struct i2c_client *client)
2611 return 0; 2611 return 0;
2612} 2612}
2613 2613
2614#ifdef CONFIG_PM_RUNTIME 2614#ifdef CONFIG_PM
2615static int max98090_runtime_resume(struct device *dev) 2615static int max98090_runtime_resume(struct device *dev)
2616{ 2616{
2617 struct max98090_priv *max98090 = dev_get_drvdata(dev); 2617 struct max98090_priv *max98090 = dev_get_drvdata(dev);
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 0c8aefab404c..e5f2fb884bf3 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -517,7 +517,7 @@ void pcm512x_remove(struct device *dev)
517} 517}
518EXPORT_SYMBOL_GPL(pcm512x_remove); 518EXPORT_SYMBOL_GPL(pcm512x_remove);
519 519
520#ifdef CONFIG_PM_RUNTIME 520#ifdef CONFIG_PM
521static int pcm512x_suspend(struct device *dev) 521static int pcm512x_suspend(struct device *dev)
522{ 522{
523 struct pcm512x_priv *pcm512x = dev_get_drvdata(dev); 523 struct pcm512x_priv *pcm512x = dev_get_drvdata(dev);
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index b505212019e2..ae23acdd2708 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -115,7 +115,7 @@ static const struct snd_soc_dapm_route tas2552_audio_map[] = {
115 {"ClassD", NULL, "PLL"}, 115 {"ClassD", NULL, "PLL"},
116}; 116};
117 117
118#ifdef CONFIG_PM_RUNTIME 118#ifdef CONFIG_PM
119static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) 119static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown)
120{ 120{
121 u8 cfg1_reg; 121 u8 cfg1_reg;
@@ -264,7 +264,7 @@ static int tas2552_mute(struct snd_soc_dai *dai, int mute)
264 return 0; 264 return 0;
265} 265}
266 266
267#ifdef CONFIG_PM_RUNTIME 267#ifdef CONFIG_PM
268static int tas2552_runtime_suspend(struct device *dev) 268static int tas2552_runtime_suspend(struct device *dev)
269{ 269{
270 struct tas2552_data *tas2552 = dev_get_drvdata(dev); 270 struct tas2552_data *tas2552 = dev_get_drvdata(dev);
diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c
index cdea9d9c1631..15599845a660 100644
--- a/sound/soc/codecs/wm2200.c
+++ b/sound/soc/codecs/wm2200.c
@@ -2440,7 +2440,7 @@ static int wm2200_i2c_remove(struct i2c_client *i2c)
2440 return 0; 2440 return 0;
2441} 2441}
2442 2442
2443#ifdef CONFIG_PM_RUNTIME 2443#ifdef CONFIG_PM
2444static int wm2200_runtime_suspend(struct device *dev) 2444static int wm2200_runtime_suspend(struct device *dev)
2445{ 2445{
2446 struct wm2200_priv *wm2200 = dev_get_drvdata(dev); 2446 struct wm2200_priv *wm2200 = dev_get_drvdata(dev);
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index a01ad629ed61..b80970dc2d2f 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -2664,7 +2664,7 @@ static int wm5100_i2c_remove(struct i2c_client *i2c)
2664 return 0; 2664 return 0;
2665} 2665}
2666 2666
2667#ifdef CONFIG_PM_RUNTIME 2667#ifdef CONFIG_PM
2668static int wm5100_runtime_suspend(struct device *dev) 2668static int wm5100_runtime_suspend(struct device *dev)
2669{ 2669{
2670 struct wm5100_priv *wm5100 = dev_get_drvdata(dev); 2670 struct wm5100_priv *wm5100 = dev_get_drvdata(dev);
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 1534d88a66e9..d32d554f5b34 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3785,7 +3785,7 @@ static int wm8962_i2c_remove(struct i2c_client *client)
3785 return 0; 3785 return 0;
3786} 3786}
3787 3787
3788#ifdef CONFIG_PM_RUNTIME 3788#ifdef CONFIG_PM
3789static int wm8962_runtime_resume(struct device *dev) 3789static int wm8962_runtime_resume(struct device *dev)
3790{ 3790{
3791 struct wm8962_priv *wm8962 = dev_get_drvdata(dev); 3791 struct wm8962_priv *wm8962 = dev_get_drvdata(dev);
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 9deabdd2b1a2..026a80117540 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -928,7 +928,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
928 return 0; 928 return 0;
929} 929}
930 930
931#ifdef CONFIG_PM_RUNTIME 931#ifdef CONFIG_PM
932static int fsl_asrc_runtime_resume(struct device *dev) 932static int fsl_asrc_runtime_resume(struct device *dev)
933{ 933{
934 struct fsl_asrc *asrc_priv = dev_get_drvdata(dev); 934 struct fsl_asrc *asrc_priv = dev_get_drvdata(dev);
@@ -954,7 +954,7 @@ static int fsl_asrc_runtime_suspend(struct device *dev)
954 954
955 return 0; 955 return 0;
956} 956}
957#endif /* CONFIG_PM_RUNTIME */ 957#endif /* CONFIG_PM */
958 958
959#ifdef CONFIG_PM_SLEEP 959#ifdef CONFIG_PM_SLEEP
960static int fsl_asrc_suspend(struct device *dev) 960static int fsl_asrc_suspend(struct device *dev)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 95340ba415c7..b1a7c5bce4a1 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1135,7 +1135,7 @@ static inline const struct samsung_i2s_dai_data *samsung_i2s_get_driver_data(
1135 platform_get_device_id(pdev)->driver_data; 1135 platform_get_device_id(pdev)->driver_data;
1136} 1136}
1137 1137
1138#ifdef CONFIG_PM_RUNTIME 1138#ifdef CONFIG_PM
1139static int i2s_runtime_suspend(struct device *dev) 1139static int i2s_runtime_suspend(struct device *dev)
1140{ 1140{
1141 struct i2s_dai *i2s = dev_get_drvdata(dev); 1141 struct i2s_dai *i2s = dev_get_drvdata(dev);
@@ -1153,7 +1153,7 @@ static int i2s_runtime_resume(struct device *dev)
1153 1153
1154 return 0; 1154 return 0;
1155} 1155}
1156#endif /* CONFIG_PM_RUNTIME */ 1156#endif /* CONFIG_PM */
1157 1157
1158static int samsung_i2s_probe(struct platform_device *pdev) 1158static int samsung_i2s_probe(struct platform_device *pdev)
1159{ 1159{
diff --git a/tools/power/cpupower/utils/cpuidle-info.c b/tools/power/cpupower/utils/cpuidle-info.c
index 458d69b444ad..75e66de7e7a7 100644
--- a/tools/power/cpupower/utils/cpuidle-info.c
+++ b/tools/power/cpupower/utils/cpuidle-info.c
@@ -22,13 +22,13 @@
22 22
23static void cpuidle_cpu_output(unsigned int cpu, int verbose) 23static void cpuidle_cpu_output(unsigned int cpu, int verbose)
24{ 24{
25 int idlestates, idlestate; 25 unsigned int idlestates, idlestate;
26 char *tmp; 26 char *tmp;
27 27
28 printf(_ ("Analyzing CPU %d:\n"), cpu); 28 printf(_ ("Analyzing CPU %d:\n"), cpu);
29 29
30 idlestates = sysfs_get_idlestate_count(cpu); 30 idlestates = sysfs_get_idlestate_count(cpu);
31 if (idlestates < 1) { 31 if (idlestates == 0) {
32 printf(_("CPU %u: No idle states\n"), cpu); 32 printf(_("CPU %u: No idle states\n"), cpu);
33 return; 33 return;
34 } 34 }
@@ -100,10 +100,10 @@ static void cpuidle_general_output(void)
100static void proc_cpuidle_cpu_output(unsigned int cpu) 100static void proc_cpuidle_cpu_output(unsigned int cpu)
101{ 101{
102 long max_allowed_cstate = 2000000000; 102 long max_allowed_cstate = 2000000000;
103 int cstate, cstates; 103 unsigned int cstate, cstates;
104 104
105 cstates = sysfs_get_idlestate_count(cpu); 105 cstates = sysfs_get_idlestate_count(cpu);
106 if (cstates < 1) { 106 if (cstates == 0) {
107 printf(_("CPU %u: No C-states info\n"), cpu); 107 printf(_("CPU %u: No C-states info\n"), cpu);
108 return; 108 return;
109 } 109 }