diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/base.h | 1 | ||||
-rw-r--r-- | drivers/base/dma-coherent.c | 1 | ||||
-rw-r--r-- | drivers/base/dma-mapping.c | 1 | ||||
-rw-r--r-- | drivers/base/hypervisor.c | 1 | ||||
-rw-r--r-- | drivers/base/power/common.c | 2 | ||||
-rw-r--r-- | drivers/base/power/generic_ops.c | 1 | ||||
-rw-r--r-- | drivers/base/power/main.c | 1 | ||||
-rw-r--r-- | drivers/base/power/qos.c | 1 | ||||
-rw-r--r-- | drivers/base/power/runtime.c | 24 | ||||
-rw-r--r-- | drivers/base/power/sysfs.c | 1 | ||||
-rw-r--r-- | drivers/base/power/trace.c | 1 | ||||
-rw-r--r-- | drivers/base/power/wakeup.c | 1 | ||||
-rw-r--r-- | drivers/base/regmap/regcache.c | 1 | ||||
-rw-r--r-- | drivers/base/transport_class.c | 1 |
14 files changed, 31 insertions, 7 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index a34dca0ad041..21c1b96c34c6 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -1,3 +1,4 @@ +#include <linux/notifier.h> /** * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure. diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c index f369e2795985..bb0025c510b3 100644 --- a/drivers/base/dma-coherent.c +++ b/drivers/base/dma-coherent.c @@ -4,6 +4,7 @@ */ #include <linux/slab.h> #include <linux/kernel.h> +#include <linux/module.h> #include <linux/dma-mapping.h> struct dma_coherent_mem { diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c index 763d59c1eb65..6f3676f1559f 100644 --- a/drivers/base/dma-mapping.c +++ b/drivers/base/dma-mapping.c @@ -8,6 +8,7 @@ */ #include <linux/dma-mapping.h> +#include <linux/export.h> #include <linux/gfp.h> /* diff --git a/drivers/base/hypervisor.c b/drivers/base/hypervisor.c index 6428cba3aadd..4f8b741f4615 100644 --- a/drivers/base/hypervisor.c +++ b/drivers/base/hypervisor.c @@ -10,6 +10,7 @@ #include <linux/kobject.h> #include <linux/device.h> +#include <linux/export.h> #include "base.h" struct kobject *hypervisor_kobj; diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index 29820c396182..4af7c1cbf909 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -8,7 +8,7 @@ #include <linux/init.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> #include <linux/pm_clock.h> diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c index 9508df71274b..265a0ee3b49e 100644 --- a/drivers/base/power/generic_ops.c +++ b/drivers/base/power/generic_ops.c @@ -8,6 +8,7 @@ #include <linux/pm.h> #include <linux/pm_runtime.h> +#include <linux/export.h> #ifdef CONFIG_PM_RUNTIME /** diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 59f8ab235486..7fa098464dae 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -19,6 +19,7 @@ #include <linux/device.h> #include <linux/kallsyms.h> +#include <linux/export.h> #include <linux/mutex.h> #include <linux/pm.h> #include <linux/pm_runtime.h> diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 91e061417382..30a94eadc200 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -39,6 +39,7 @@ #include <linux/slab.h> #include <linux/device.h> #include <linux/mutex.h> +#include <linux/export.h> static DEFINE_MUTEX(dev_pm_qos_mtx); diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 6bb3aafa85ed..8c78443bca8f 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -8,6 +8,7 @@ */ #include <linux/sched.h> +#include <linux/export.h> #include <linux/pm_runtime.h> #include <trace/events/rpm.h> #include "power.h" @@ -29,13 +30,10 @@ static int rpm_suspend(struct device *dev, int rpmflags); void update_pm_runtime_accounting(struct device *dev) { unsigned long now = jiffies; - int delta; + unsigned long delta; delta = now - dev->power.accounting_timestamp; - if (delta < 0) - delta = 0; - dev->power.accounting_timestamp = now; if (dev->power.disable_depth > 0) @@ -296,6 +294,9 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev) * the callback was running then carry it out, otherwise send an idle * notification for its parent (if the suspend succeeded and both * ignore_children of parent->power and irq_safe of dev->power are not set). + * If ->runtime_suspend failed with -EAGAIN or -EBUSY, and if the RPM_AUTO + * flag is set and the next autosuspend-delay expiration time is in the + * future, schedule another autosuspend attempt. * * This function must be called under dev->power.lock with interrupts disabled. */ @@ -416,10 +417,21 @@ static int rpm_suspend(struct device *dev, int rpmflags) if (retval) { __update_runtime_status(dev, RPM_ACTIVE); dev->power.deferred_resume = false; - if (retval == -EAGAIN || retval == -EBUSY) + if (retval == -EAGAIN || retval == -EBUSY) { dev->power.runtime_error = 0; - else + + /* + * If the callback routine failed an autosuspend, and + * if the last_busy time has been updated so that there + * is a new autosuspend expiration time, automatically + * reschedule another autosuspend. + */ + if ((rpmflags & RPM_AUTO) && + pm_runtime_autosuspend_expiration(dev) != 0) + goto repeat; + } else { pm_runtime_cancel_pending(dev); + } wake_up_all(&dev->power.wait_queue); goto out; } diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index 17b7934f31cb..adf41be0ea66 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c @@ -4,6 +4,7 @@ #include <linux/device.h> #include <linux/string.h> +#include <linux/export.h> #include <linux/pm_runtime.h> #include <linux/atomic.h> #include <linux/jiffies.h> diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c index af10abecb99b..d94a1f5121cf 100644 --- a/drivers/base/power/trace.c +++ b/drivers/base/power/trace.c @@ -8,6 +8,7 @@ */ #include <linux/resume-trace.h> +#include <linux/export.h> #include <linux/rtc.h> #include <asm/rtc.h> diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 14ee07e9cc43..caf995fb774b 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -10,6 +10,7 @@ #include <linux/slab.h> #include <linux/sched.h> #include <linux/capability.h> +#include <linux/export.h> #include <linux/suspend.h> #include <linux/seq_file.h> #include <linux/debugfs.h> diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index afcfef838263..666f6f5011dc 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -11,6 +11,7 @@ */ #include <linux/slab.h> +#include <linux/export.h> #include <trace/events/regmap.h> #include <linux/bsearch.h> #include <linux/sort.h> diff --git a/drivers/base/transport_class.c b/drivers/base/transport_class.c index 84997efdb23d..f6c453c3816e 100644 --- a/drivers/base/transport_class.c +++ b/drivers/base/transport_class.c @@ -27,6 +27,7 @@ * transport class is framed entirely in terms of generic devices to * allow it to be used by any physical HBA in the system. */ +#include <linux/export.h> #include <linux/attribute_container.h> #include <linux/transport_class.h> |