Merge 5504ce0317 ("Merge tag 'pm-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline
Steps on the way to v7.2-rc1 Change-Id: Ic13e31db0176105e2b36af2d855d44bcb05fc948 Signed-off-by: Carlos Llamas <cmllamas@google.com>
This commit is contained in:
commit
f8e1521d85
36 files changed
+494
-462
No files matched your search
@@ -28,6 +28,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/debug.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/async.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <trace/events/power.h>
|
||||
@@ -117,7 +118,7 @@ void device_pm_sleep_init(struct device *dev)
|
||||
dev->power.is_noirq_suspended = false;
|
||||
dev->power.is_late_suspended = false;
|
||||
init_completion(&dev->power.completion);
|
||||
complete_all(&dev->power.completion);
|
||||
complete(&dev->power.completion);
|
||||
dev->power.wakeup = NULL;
|
||||
INIT_LIST_HEAD(&dev->power.entry);
|
||||
}
|
||||
@@ -254,6 +255,10 @@ static void dpm_wait(struct device *dev, bool async)
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
/* Devices with no PM support don't use the completion. */
|
||||
if (dev->power.no_pm)
|
||||
return;
|
||||
|
||||
if (async || (pm_async_enabled && dev->power.async_suspend))
|
||||
wait_for_completion(&dev->power.completion);
|
||||
}
|
||||
@@ -529,6 +534,58 @@ module_param(dpm_watchdog_all_cpu_backtrace, bool, 0644);
|
||||
MODULE_PARM_DESC(dpm_watchdog_all_cpu_backtrace,
|
||||
"Backtrace all CPUs on DPM watchdog timeout");
|
||||
|
||||
static unsigned int __read_mostly dpm_watchdog_timeout = CONFIG_DPM_WATCHDOG_TIMEOUT;
|
||||
static unsigned int __read_mostly dpm_watchdog_warning_timeout =
|
||||
CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;
|
||||
static const unsigned int dpm_watchdog_timeout_max = CONFIG_DPM_WATCHDOG_TIMEOUT;
|
||||
|
||||
static int proc_dodpm_watchdog_timeout_secs(const struct ctl_table *table,
|
||||
int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
struct ctl_table ctl = *table;
|
||||
unsigned int val = dpm_watchdog_timeout;
|
||||
int ret;
|
||||
|
||||
ctl.data = &val;
|
||||
ret = proc_douintvec_minmax(&ctl, write, buffer, lenp, ppos);
|
||||
if (ret || !write)
|
||||
return ret;
|
||||
|
||||
if (val < dpm_watchdog_warning_timeout)
|
||||
dpm_watchdog_warning_timeout = val;
|
||||
dpm_watchdog_timeout = val;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct ctl_table dpm_watchdog_sysctls[] = {
|
||||
{
|
||||
.procname = "dpm_watchdog_timeout_secs",
|
||||
.maxlen = sizeof(unsigned int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dodpm_watchdog_timeout_secs,
|
||||
.extra1 = SYSCTL_ONE,
|
||||
.extra2 = (void *)&dpm_watchdog_timeout_max,
|
||||
},
|
||||
{
|
||||
.procname = "dpm_watchdog_warning_timeout_secs",
|
||||
.data = &dpm_watchdog_warning_timeout,
|
||||
.maxlen = sizeof(unsigned int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_douintvec_minmax,
|
||||
.extra1 = SYSCTL_ONE,
|
||||
.extra2 = (void *)&dpm_watchdog_timeout,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init dpm_watchdog_sysctl_init(void)
|
||||
{
|
||||
register_sysctl_init("kernel", dpm_watchdog_sysctls);
|
||||
return 0;
|
||||
}
|
||||
subsys_initcall(dpm_watchdog_sysctl_init);
|
||||
|
||||
/**
|
||||
* dpm_watchdog_handler - Driver suspend / resume watchdog handler.
|
||||
* @t: The timer that PM watchdog depends on.
|
||||
@@ -554,9 +611,9 @@ static void dpm_watchdog_handler(struct timer_list *t)
|
||||
dev_driver_string(wd->dev), dev_name(wd->dev));
|
||||
}
|
||||
|
||||
time_left = CONFIG_DPM_WATCHDOG_TIMEOUT - CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;
|
||||
time_left = dpm_watchdog_timeout - dpm_watchdog_warning_timeout;
|
||||
dev_warn(wd->dev, "**** DPM device timeout after %u seconds; %u seconds until panic ****\n",
|
||||
CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT, time_left);
|
||||
dpm_watchdog_warning_timeout, time_left);
|
||||
show_stack(wd->tsk, NULL, KERN_WARNING);
|
||||
|
||||
wd->fatal = true;
|
||||
@@ -574,11 +631,11 @@ static void dpm_watchdog_set(struct dpm_watchdog *wd, struct device *dev)
|
||||
|
||||
wd->dev = dev;
|
||||
wd->tsk = current;
|
||||
wd->fatal = CONFIG_DPM_WATCHDOG_TIMEOUT == CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;
|
||||
wd->fatal = dpm_watchdog_timeout == dpm_watchdog_warning_timeout;
|
||||
|
||||
timer_setup_on_stack(timer, dpm_watchdog_handler, 0);
|
||||
/* use same timeout value for both suspend and resume */
|
||||
timer->expires = jiffies + HZ * CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;
|
||||
timer->expires = jiffies + HZ * dpm_watchdog_warning_timeout;
|
||||
add_timer(timer);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user