aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-28 07:01:40 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-28 07:01:40 -0400
commite52cff8bdd4a30c40a7f65c7ea8f1f425f8a15eb (patch)
tree1729332ebab51bb560ca64effe46cdab38ab537f /drivers
parent405a1086bdd091d2d55db0ac905cd6332b35cec1 (diff)
parentf5ce1572109049b90484e2bb44927cb6034c5eb1 (diff)
Merge branch 'pm-assorted'
* pm-assorted: PM / QoS: Add pm_qos and dev_pm_qos to events-power.txt PM / QoS: Add dev_pm_qos_request tracepoints PM / QoS: Add pm_qos_request tracepoints PM / QoS: Add pm_qos_update_target/flags tracepoints PM / QoS: Update Documentation/power/pm_qos_interface.txt PM / Sleep: Print last wakeup source on failed wakeup_count write PM / QoS: correct the valid range of pm_qos_class PM / wakeup: Adjust messaging for wake events during suspend PM / Runtime: Update .runtime_idle() callback documentation PM / Runtime: Rework the "runtime idle" helper routine PM / Hibernate: print physical addresses consistently with other parts of kernel
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/device_pm.c1
-rw-r--r--drivers/amba/bus.c2
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/base/platform.c1
-rw-r--r--drivers/base/power/domain.c1
-rw-r--r--drivers/base/power/generic_ops.c23
-rw-r--r--drivers/base/power/qos.c6
-rw-r--r--drivers/base/power/runtime.c12
-rw-r--r--drivers/base/power/wakeup.c9
-rw-r--r--drivers/dma/intel_mid_dma.c2
-rw-r--r--drivers/gpio/gpio-langwell.c6
-rw-r--r--drivers/i2c/i2c-core.c2
-rw-r--r--drivers/mfd/ab8500-gpadc.c8
-rw-r--r--drivers/mmc/core/bus.c2
-rw-r--r--drivers/mmc/core/sdio_bus.c2
-rw-r--r--drivers/pci/pci-driver.c14
-rw-r--r--drivers/scsi/scsi_pm.c11
-rw-r--r--drivers/sh/pm_runtime.c2
-rw-r--r--drivers/spi/spi.c2
-rw-r--r--drivers/tty/serial/mfd.c9
-rw-r--r--drivers/usb/core/driver.c3
-rw-r--r--drivers/usb/core/port.c1
22 files changed, 39 insertions, 82 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 5f3597b87f27..67624d4d5aef 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -933,7 +933,6 @@ static struct dev_pm_domain acpi_general_pm_domain = {
933#ifdef CONFIG_PM_RUNTIME 933#ifdef CONFIG_PM_RUNTIME
934 .runtime_suspend = acpi_subsys_runtime_suspend, 934 .runtime_suspend = acpi_subsys_runtime_suspend,
935 .runtime_resume = acpi_subsys_runtime_resume, 935 .runtime_resume = acpi_subsys_runtime_resume,
936 .runtime_idle = pm_generic_runtime_idle,
937#endif 936#endif
938#ifdef CONFIG_PM_SLEEP 937#ifdef CONFIG_PM_SLEEP
939 .prepare = acpi_subsys_prepare, 938 .prepare = acpi_subsys_prepare,
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index cdbad3a454a0..c6707278a6bb 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -284,7 +284,7 @@ static const struct dev_pm_ops amba_pm = {
284 SET_RUNTIME_PM_OPS( 284 SET_RUNTIME_PM_OPS(
285 amba_pm_runtime_suspend, 285 amba_pm_runtime_suspend,
286 amba_pm_runtime_resume, 286 amba_pm_runtime_resume,
287 pm_generic_runtime_idle 287 NULL
288 ) 288 )
289}; 289};
290 290
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index adf002a3c584..6e458a40a93b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5436,7 +5436,7 @@ static int ata_port_runtime_idle(struct device *dev)
5436 return -EBUSY; 5436 return -EBUSY;
5437 } 5437 }
5438 5438
5439 return pm_runtime_suspend(dev); 5439 return 0;
5440} 5440}
5441 5441
5442static int ata_port_runtime_suspend(struct device *dev) 5442static int ata_port_runtime_suspend(struct device *dev)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 9eda84246ffd..96a930387ebc 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -888,7 +888,6 @@ int platform_pm_restore(struct device *dev)
888static const struct dev_pm_ops platform_dev_pm_ops = { 888static const struct dev_pm_ops platform_dev_pm_ops = {
889 .runtime_suspend = pm_generic_runtime_suspend, 889 .runtime_suspend = pm_generic_runtime_suspend,
890 .runtime_resume = pm_generic_runtime_resume, 890 .runtime_resume = pm_generic_runtime_resume,
891 .runtime_idle = pm_generic_runtime_idle,
892 USE_PLATFORM_PM_SLEEP_OPS 891 USE_PLATFORM_PM_SLEEP_OPS
893}; 892};
894 893
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 7072404c8b6d..bfb8955c406c 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2143,7 +2143,6 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
2143 genpd->max_off_time_changed = true; 2143 genpd->max_off_time_changed = true;
2144 genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend; 2144 genpd->domain.ops.runtime_suspend = pm_genpd_runtime_suspend;
2145 genpd->domain.ops.runtime_resume = pm_genpd_runtime_resume; 2145 genpd->domain.ops.runtime_resume = pm_genpd_runtime_resume;
2146 genpd->domain.ops.runtime_idle = pm_generic_runtime_idle;
2147 genpd->domain.ops.prepare = pm_genpd_prepare; 2146 genpd->domain.ops.prepare = pm_genpd_prepare;
2148 genpd->domain.ops.suspend = pm_genpd_suspend; 2147 genpd->domain.ops.suspend = pm_genpd_suspend;
2149 genpd->domain.ops.suspend_late = pm_genpd_suspend_late; 2148 genpd->domain.ops.suspend_late = pm_genpd_suspend_late;
diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
index bfd898b8988e..5ee030a864f9 100644
--- a/drivers/base/power/generic_ops.c
+++ b/drivers/base/power/generic_ops.c
@@ -12,29 +12,6 @@
12 12
13#ifdef CONFIG_PM_RUNTIME 13#ifdef CONFIG_PM_RUNTIME
14/** 14/**
15 * pm_generic_runtime_idle - Generic runtime idle callback for subsystems.
16 * @dev: Device to handle.
17 *
18 * If PM operations are defined for the @dev's driver and they include
19 * ->runtime_idle(), execute it and return its error code, if nonzero.
20 * Otherwise, execute pm_runtime_suspend() for the device and return 0.
21 */
22int pm_generic_runtime_idle(struct device *dev)
23{
24 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
25
26 if (pm && pm->runtime_idle) {
27 int ret = pm->runtime_idle(dev);
28 if (ret)
29 return ret;
30 }
31
32 pm_runtime_suspend(dev);
33 return 0;
34}
35EXPORT_SYMBOL_GPL(pm_generic_runtime_idle);
36
37/**
38 * pm_generic_runtime_suspend - Generic runtime suspend callback for subsystems. 15 * pm_generic_runtime_suspend - Generic runtime suspend callback for subsystems.
39 * @dev: Device to suspend. 16 * @dev: Device to suspend.
40 * 17 *
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index 71671c42ef45..5c1361a9e5dd 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -42,6 +42,7 @@
42#include <linux/export.h> 42#include <linux/export.h>
43#include <linux/pm_runtime.h> 43#include <linux/pm_runtime.h>
44#include <linux/err.h> 44#include <linux/err.h>
45#include <trace/events/power.h>
45 46
46#include "power.h" 47#include "power.h"
47 48
@@ -305,6 +306,7 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
305 else if (!dev->power.qos) 306 else if (!dev->power.qos)
306 ret = dev_pm_qos_constraints_allocate(dev); 307 ret = dev_pm_qos_constraints_allocate(dev);
307 308
309 trace_dev_pm_qos_add_request(dev_name(dev), type, value);
308 if (!ret) { 310 if (!ret) {
309 req->dev = dev; 311 req->dev = dev;
310 req->type = type; 312 req->type = type;
@@ -349,6 +351,8 @@ static int __dev_pm_qos_update_request(struct dev_pm_qos_request *req,
349 return -EINVAL; 351 return -EINVAL;
350 } 352 }
351 353
354 trace_dev_pm_qos_update_request(dev_name(req->dev), req->type,
355 new_value);
352 if (curr_value != new_value) 356 if (curr_value != new_value)
353 ret = apply_constraint(req, PM_QOS_UPDATE_REQ, new_value); 357 ret = apply_constraint(req, PM_QOS_UPDATE_REQ, new_value);
354 358
@@ -398,6 +402,8 @@ static int __dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
398 if (IS_ERR_OR_NULL(req->dev->power.qos)) 402 if (IS_ERR_OR_NULL(req->dev->power.qos))
399 return -ENODEV; 403 return -ENODEV;
400 404
405 trace_dev_pm_qos_remove_request(dev_name(req->dev), req->type,
406 PM_QOS_DEFAULT_VALUE);
401 ret = apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); 407 ret = apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
402 memset(req, 0, sizeof(*req)); 408 memset(req, 0, sizeof(*req));
403 return ret; 409 return ret;
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index ef13ad08afb2..268a35097578 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -293,11 +293,8 @@ static int rpm_idle(struct device *dev, int rpmflags)
293 /* Pending requests need to be canceled. */ 293 /* Pending requests need to be canceled. */
294 dev->power.request = RPM_REQ_NONE; 294 dev->power.request = RPM_REQ_NONE;
295 295
296 if (dev->power.no_callbacks) { 296 if (dev->power.no_callbacks)
297 /* Assume ->runtime_idle() callback would have suspended. */
298 retval = rpm_suspend(dev, rpmflags);
299 goto out; 297 goto out;
300 }
301 298
302 /* Carry out an asynchronous or a synchronous idle notification. */ 299 /* Carry out an asynchronous or a synchronous idle notification. */
303 if (rpmflags & RPM_ASYNC) { 300 if (rpmflags & RPM_ASYNC) {
@@ -306,7 +303,8 @@ static int rpm_idle(struct device *dev, int rpmflags)
306 dev->power.request_pending = true; 303 dev->power.request_pending = true;
307 queue_work(pm_wq, &dev->power.work); 304 queue_work(pm_wq, &dev->power.work);
308 } 305 }
309 goto out; 306 trace_rpm_return_int(dev, _THIS_IP_, 0);
307 return 0;
310 } 308 }
311 309
312 dev->power.idle_notification = true; 310 dev->power.idle_notification = true;
@@ -326,14 +324,14 @@ static int rpm_idle(struct device *dev, int rpmflags)
326 callback = dev->driver->pm->runtime_idle; 324 callback = dev->driver->pm->runtime_idle;
327 325
328 if (callback) 326 if (callback)
329 __rpm_callback(callback, dev); 327 retval = __rpm_callback(callback, dev);
330 328
331 dev->power.idle_notification = false; 329 dev->power.idle_notification = false;
332 wake_up_all(&dev->power.wait_queue); 330 wake_up_all(&dev->power.wait_queue);
333 331
334 out: 332 out:
335 trace_rpm_return_int(dev, _THIS_IP_, retval); 333 trace_rpm_return_int(dev, _THIS_IP_, retval);
336 return retval; 334 return retval ? retval : rpm_suspend(dev, rpmflags);
337} 335}
338 336
339/** 337/**
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 79715e7fa43e..2d56f4113ae7 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -659,7 +659,7 @@ void pm_wakeup_event(struct device *dev, unsigned int msec)
659} 659}
660EXPORT_SYMBOL_GPL(pm_wakeup_event); 660EXPORT_SYMBOL_GPL(pm_wakeup_event);
661 661
662static void print_active_wakeup_sources(void) 662void pm_print_active_wakeup_sources(void)
663{ 663{
664 struct wakeup_source *ws; 664 struct wakeup_source *ws;
665 int active = 0; 665 int active = 0;
@@ -683,6 +683,7 @@ static void print_active_wakeup_sources(void)
683 last_activity_ws->name); 683 last_activity_ws->name);
684 rcu_read_unlock(); 684 rcu_read_unlock();
685} 685}
686EXPORT_SYMBOL_GPL(pm_print_active_wakeup_sources);
686 687
687/** 688/**
688 * pm_wakeup_pending - Check if power transition in progress should be aborted. 689 * pm_wakeup_pending - Check if power transition in progress should be aborted.
@@ -707,8 +708,10 @@ bool pm_wakeup_pending(void)
707 } 708 }
708 spin_unlock_irqrestore(&events_lock, flags); 709 spin_unlock_irqrestore(&events_lock, flags);
709 710
710 if (ret) 711 if (ret) {
711 print_active_wakeup_sources(); 712 pr_info("PM: Wakeup pending, aborting suspend\n");
713 pm_print_active_wakeup_sources();
714 }
712 715
713 return ret; 716 return ret;
714} 717}
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index a0de82e21a7c..a975ebebea8a 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -1405,7 +1405,7 @@ static int dma_runtime_idle(struct device *dev)
1405 return -EAGAIN; 1405 return -EAGAIN;
1406 } 1406 }
1407 1407
1408 return pm_schedule_suspend(dev, 0); 1408 return 0;
1409} 1409}
1410 1410
1411/****************************************************************************** 1411/******************************************************************************
diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
index 62ef10a641c4..89d0d2a3b1bb 100644
--- a/drivers/gpio/gpio-langwell.c
+++ b/drivers/gpio/gpio-langwell.c
@@ -305,11 +305,7 @@ static const struct irq_domain_ops lnw_gpio_irq_ops = {
305 305
306static int lnw_gpio_runtime_idle(struct device *dev) 306static int lnw_gpio_runtime_idle(struct device *dev)
307{ 307{
308 int err = pm_schedule_suspend(dev, 500); 308 pm_schedule_suspend(dev, 500);
309
310 if (!err)
311 return 0;
312
313 return -EBUSY; 309 return -EBUSY;
314} 310}
315 311
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 48e31ed69dbf..f32ca293ae0e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -435,7 +435,7 @@ static const struct dev_pm_ops i2c_device_pm_ops = {
435 SET_RUNTIME_PM_OPS( 435 SET_RUNTIME_PM_OPS(
436 pm_generic_runtime_suspend, 436 pm_generic_runtime_suspend,
437 pm_generic_runtime_resume, 437 pm_generic_runtime_resume,
438 pm_generic_runtime_idle 438 NULL
439 ) 439 )
440}; 440};
441 441
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index 13f7866de46e..3598b0ecf8c7 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -886,12 +886,6 @@ static int ab8500_gpadc_runtime_resume(struct device *dev)
886 return ret; 886 return ret;
887} 887}
888 888
889static int ab8500_gpadc_runtime_idle(struct device *dev)
890{
891 pm_runtime_suspend(dev);
892 return 0;
893}
894
895static int ab8500_gpadc_suspend(struct device *dev) 889static int ab8500_gpadc_suspend(struct device *dev)
896{ 890{
897 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); 891 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
@@ -1039,7 +1033,7 @@ static int ab8500_gpadc_remove(struct platform_device *pdev)
1039static const struct dev_pm_ops ab8500_gpadc_pm_ops = { 1033static const struct dev_pm_ops ab8500_gpadc_pm_ops = {
1040 SET_RUNTIME_PM_OPS(ab8500_gpadc_runtime_suspend, 1034 SET_RUNTIME_PM_OPS(ab8500_gpadc_runtime_suspend,
1041 ab8500_gpadc_runtime_resume, 1035 ab8500_gpadc_runtime_resume,
1042 ab8500_gpadc_runtime_idle) 1036 NULL)
1043 SET_SYSTEM_SLEEP_PM_OPS(ab8500_gpadc_suspend, 1037 SET_SYSTEM_SLEEP_PM_OPS(ab8500_gpadc_suspend,
1044 ab8500_gpadc_resume) 1038 ab8500_gpadc_resume)
1045 1039
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index e219c97a02a4..9d5c71125576 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -164,7 +164,7 @@ static int mmc_runtime_resume(struct device *dev)
164 164
165static int mmc_runtime_idle(struct device *dev) 165static int mmc_runtime_idle(struct device *dev)
166{ 166{
167 return pm_runtime_suspend(dev); 167 return 0;
168} 168}
169 169
170#endif /* !CONFIG_PM_RUNTIME */ 170#endif /* !CONFIG_PM_RUNTIME */
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 546c67c2bbbf..6d67492a9247 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -211,7 +211,7 @@ static const struct dev_pm_ops sdio_bus_pm_ops = {
211 SET_RUNTIME_PM_OPS( 211 SET_RUNTIME_PM_OPS(
212 pm_generic_runtime_suspend, 212 pm_generic_runtime_suspend,
213 pm_generic_runtime_resume, 213 pm_generic_runtime_resume,
214 pm_generic_runtime_idle 214 NULL
215 ) 215 )
216}; 216};
217 217
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 79277fb36c6b..e6515e21afa3 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1050,26 +1050,22 @@ static int pci_pm_runtime_idle(struct device *dev)
1050{ 1050{
1051 struct pci_dev *pci_dev = to_pci_dev(dev); 1051 struct pci_dev *pci_dev = to_pci_dev(dev);
1052 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 1052 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
1053 int ret = 0;
1053 1054
1054 /* 1055 /*
1055 * If pci_dev->driver is not set (unbound), the device should 1056 * If pci_dev->driver is not set (unbound), the device should
1056 * always remain in D0 regardless of the runtime PM status 1057 * always remain in D0 regardless of the runtime PM status
1057 */ 1058 */
1058 if (!pci_dev->driver) 1059 if (!pci_dev->driver)
1059 goto out; 1060 return 0;
1060 1061
1061 if (!pm) 1062 if (!pm)
1062 return -ENOSYS; 1063 return -ENOSYS;
1063 1064
1064 if (pm->runtime_idle) { 1065 if (pm->runtime_idle)
1065 int ret = pm->runtime_idle(dev); 1066 ret = pm->runtime_idle(dev);
1066 if (ret)
1067 return ret;
1068 }
1069 1067
1070out: 1068 return ret;
1071 pm_runtime_suspend(dev);
1072 return 0;
1073} 1069}
1074 1070
1075#else /* !CONFIG_PM_RUNTIME */ 1071#else /* !CONFIG_PM_RUNTIME */
diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
index 42539ee2cb11..4c5aabe21755 100644
--- a/drivers/scsi/scsi_pm.c
+++ b/drivers/scsi/scsi_pm.c
@@ -229,8 +229,6 @@ static int scsi_runtime_resume(struct device *dev)
229 229
230static int scsi_runtime_idle(struct device *dev) 230static int scsi_runtime_idle(struct device *dev)
231{ 231{
232 int err;
233
234 dev_dbg(dev, "scsi_runtime_idle\n"); 232 dev_dbg(dev, "scsi_runtime_idle\n");
235 233
236 /* Insert hooks here for targets, hosts, and transport classes */ 234 /* Insert hooks here for targets, hosts, and transport classes */
@@ -240,14 +238,11 @@ static int scsi_runtime_idle(struct device *dev)
240 238
241 if (sdev->request_queue->dev) { 239 if (sdev->request_queue->dev) {
242 pm_runtime_mark_last_busy(dev); 240 pm_runtime_mark_last_busy(dev);
243 err = pm_runtime_autosuspend(dev); 241 pm_runtime_autosuspend(dev);
244 } else { 242 return -EBUSY;
245 err = pm_runtime_suspend(dev);
246 } 243 }
247 } else {
248 err = pm_runtime_suspend(dev);
249 } 244 }
250 return err; 245 return 0;
251} 246}
252 247
253int scsi_autopm_get_device(struct scsi_device *sdev) 248int scsi_autopm_get_device(struct scsi_device *sdev)
diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index afe9282629b9..8afa5a4589f2 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -25,7 +25,7 @@
25static int default_platform_runtime_idle(struct device *dev) 25static int default_platform_runtime_idle(struct device *dev)
26{ 26{
27 /* suspend synchronously to disable clocks immediately */ 27 /* suspend synchronously to disable clocks immediately */
28 return pm_runtime_suspend(dev); 28 return 0;
29} 29}
30 30
31static struct dev_pm_domain default_pm_domain = { 31static struct dev_pm_domain default_pm_domain = {
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 32b7bb111eb6..095cfaded1c0 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -223,7 +223,7 @@ static const struct dev_pm_ops spi_pm = {
223 SET_RUNTIME_PM_OPS( 223 SET_RUNTIME_PM_OPS(
224 pm_generic_runtime_suspend, 224 pm_generic_runtime_suspend,
225 pm_generic_runtime_resume, 225 pm_generic_runtime_resume,
226 pm_generic_runtime_idle 226 NULL
227 ) 227 )
228}; 228};
229 229
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index 5f4765a7a5c5..5dfcf3bae23a 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -1248,13 +1248,8 @@ static int serial_hsu_resume(struct pci_dev *pdev)
1248#ifdef CONFIG_PM_RUNTIME 1248#ifdef CONFIG_PM_RUNTIME
1249static int serial_hsu_runtime_idle(struct device *dev) 1249static int serial_hsu_runtime_idle(struct device *dev)
1250{ 1250{
1251 int err; 1251 pm_schedule_suspend(dev, 500);
1252 1252 return -EBUSY;
1253 err = pm_schedule_suspend(dev, 500);
1254 if (err)
1255 return -EBUSY;
1256
1257 return 0;
1258} 1253}
1259 1254
1260static int serial_hsu_runtime_suspend(struct device *dev) 1255static int serial_hsu_runtime_suspend(struct device *dev)
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 6eab440e1542..7609ac4aed1c 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1765,7 +1765,8 @@ int usb_runtime_idle(struct device *dev)
1765 */ 1765 */
1766 if (autosuspend_check(udev) == 0) 1766 if (autosuspend_check(udev) == 0)
1767 pm_runtime_autosuspend(dev); 1767 pm_runtime_autosuspend(dev);
1768 return 0; 1768 /* Tell the core not to suspend it, though. */
1769 return -EBUSY;
1769} 1770}
1770 1771
1771int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable) 1772int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable)
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
index b8bad294eeb8..8c1b2c509467 100644
--- a/drivers/usb/core/port.c
+++ b/drivers/usb/core/port.c
@@ -141,7 +141,6 @@ static const struct dev_pm_ops usb_port_pm_ops = {
141#ifdef CONFIG_PM_RUNTIME 141#ifdef CONFIG_PM_RUNTIME
142 .runtime_suspend = usb_port_runtime_suspend, 142 .runtime_suspend = usb_port_runtime_suspend,
143 .runtime_resume = usb_port_runtime_resume, 143 .runtime_resume = usb_port_runtime_resume,
144 .runtime_idle = pm_generic_runtime_idle,
145#endif 144#endif
146}; 145};
147 146