Merge tag 'v4.12-rc6' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
+2
-2
@@ -1658,13 +1658,13 @@ static ssize_t write_cpuhp_target(struct device *dev,
|
||||
ret = !sp->name || sp->cant_stop ? -EINVAL : 0;
|
||||
mutex_unlock(&cpuhp_state_mutex);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
if (st->state < target)
|
||||
ret = do_cpu_up(dev->id, target);
|
||||
else
|
||||
ret = do_cpu_down(dev->id, target);
|
||||
|
||||
out:
|
||||
unlock_device_hotplug();
|
||||
return ret ? ret : count;
|
||||
}
|
||||
|
||||
+3
-1
@@ -1312,8 +1312,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
|
||||
ret = __irq_set_trigger(desc,
|
||||
new->flags & IRQF_TRIGGER_MASK);
|
||||
|
||||
if (ret)
|
||||
if (ret) {
|
||||
irq_release_resources(desc);
|
||||
goto out_mask;
|
||||
}
|
||||
}
|
||||
|
||||
desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \
|
||||
|
||||
@@ -132,7 +132,7 @@ int freeze_processes(void)
|
||||
if (!pm_freezing)
|
||||
atomic_inc(&system_freezing_cnt);
|
||||
|
||||
pm_wakeup_clear(true);
|
||||
pm_wakeup_clear();
|
||||
pr_info("Freezing user space processes ... ");
|
||||
pm_freezing = true;
|
||||
error = try_to_freeze_tasks(true);
|
||||
|
||||
+4
-25
@@ -72,8 +72,6 @@ static void freeze_begin(void)
|
||||
|
||||
static void freeze_enter(void)
|
||||
{
|
||||
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_FREEZE, true);
|
||||
|
||||
spin_lock_irq(&suspend_freeze_lock);
|
||||
if (pm_wakeup_pending())
|
||||
goto out;
|
||||
@@ -100,27 +98,6 @@ static void freeze_enter(void)
|
||||
out:
|
||||
suspend_freeze_state = FREEZE_STATE_NONE;
|
||||
spin_unlock_irq(&suspend_freeze_lock);
|
||||
|
||||
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_FREEZE, false);
|
||||
}
|
||||
|
||||
static void s2idle_loop(void)
|
||||
{
|
||||
do {
|
||||
freeze_enter();
|
||||
|
||||
if (freeze_ops && freeze_ops->wake)
|
||||
freeze_ops->wake();
|
||||
|
||||
dpm_resume_noirq(PMSG_RESUME);
|
||||
if (freeze_ops && freeze_ops->sync)
|
||||
freeze_ops->sync();
|
||||
|
||||
if (pm_wakeup_pending())
|
||||
break;
|
||||
|
||||
pm_wakeup_clear(false);
|
||||
} while (!dpm_suspend_noirq(PMSG_SUSPEND));
|
||||
}
|
||||
|
||||
void freeze_wake(void)
|
||||
@@ -394,8 +371,10 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
|
||||
* all the devices are suspended.
|
||||
*/
|
||||
if (state == PM_SUSPEND_FREEZE) {
|
||||
s2idle_loop();
|
||||
goto Platform_early_resume;
|
||||
trace_suspend_resume(TPS("machine_suspend"), state, true);
|
||||
freeze_enter();
|
||||
trace_suspend_resume(TPS("machine_suspend"), state, false);
|
||||
goto Platform_wake;
|
||||
}
|
||||
|
||||
error = disable_nonboot_cpus();
|
||||
|
||||
+10
-36
@@ -269,7 +269,6 @@ static struct console *exclusive_console;
|
||||
#define MAX_CMDLINECONSOLES 8
|
||||
|
||||
static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
|
||||
static int console_cmdline_cnt;
|
||||
|
||||
static int preferred_console = -1;
|
||||
int console_set_on_cmdline;
|
||||
@@ -1906,25 +1905,12 @@ static int __add_preferred_console(char *name, int idx, char *options,
|
||||
* See if this tty is not yet registered, and
|
||||
* if we have a slot free.
|
||||
*/
|
||||
for (i = 0, c = console_cmdline; i < console_cmdline_cnt; i++, c++) {
|
||||
for (i = 0, c = console_cmdline;
|
||||
i < MAX_CMDLINECONSOLES && c->name[0];
|
||||
i++, c++) {
|
||||
if (strcmp(c->name, name) == 0 && c->index == idx) {
|
||||
if (brl_options)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Maintain an invariant that will help to find if
|
||||
* the matching console is preferred, see
|
||||
* register_console():
|
||||
*
|
||||
* The last non-braille console is always
|
||||
* the preferred one.
|
||||
*/
|
||||
if (i != console_cmdline_cnt - 1)
|
||||
swap(console_cmdline[i],
|
||||
console_cmdline[console_cmdline_cnt - 1]);
|
||||
|
||||
preferred_console = console_cmdline_cnt - 1;
|
||||
|
||||
if (!brl_options)
|
||||
preferred_console = i;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1937,7 +1923,6 @@ static int __add_preferred_console(char *name, int idx, char *options,
|
||||
braille_set_options(c, brl_options);
|
||||
|
||||
c->index = idx;
|
||||
console_cmdline_cnt++;
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
@@ -2477,23 +2462,12 @@ void register_console(struct console *newcon)
|
||||
}
|
||||
|
||||
/*
|
||||
* See if this console matches one we selected on the command line.
|
||||
*
|
||||
* There may be several entries in the console_cmdline array matching
|
||||
* with the same console, one with newcon->match(), another by
|
||||
* name/index:
|
||||
*
|
||||
* pl011,mmio,0x87e024000000,115200 -- added from SPCR
|
||||
* ttyAMA0 -- added from command line
|
||||
*
|
||||
* Traverse the console_cmdline array in reverse order to be
|
||||
* sure that if this console is preferred then it will be the first
|
||||
* matching entry. We use the invariant that is maintained in
|
||||
* __add_preferred_console().
|
||||
* See if this console matches one we selected on
|
||||
* the command line.
|
||||
*/
|
||||
for (i = console_cmdline_cnt - 1; i >= 0; i--) {
|
||||
c = console_cmdline + i;
|
||||
|
||||
for (i = 0, c = console_cmdline;
|
||||
i < MAX_CMDLINECONSOLES && c->name[0];
|
||||
i++, c++) {
|
||||
if (!newcon->match ||
|
||||
newcon->match(newcon, c->name, c->index, c->options) != 0) {
|
||||
/* default matching */
|
||||
|
||||
+2
-3
@@ -263,7 +263,7 @@ EXPORT_SYMBOL_GPL(cleanup_srcu_struct);
|
||||
|
||||
/*
|
||||
* Counts the new reader in the appropriate per-CPU element of the
|
||||
* srcu_struct. Must be called from process context.
|
||||
* srcu_struct.
|
||||
* Returns an index that must be passed to the matching srcu_read_unlock().
|
||||
*/
|
||||
int __srcu_read_lock(struct srcu_struct *sp)
|
||||
@@ -271,7 +271,7 @@ int __srcu_read_lock(struct srcu_struct *sp)
|
||||
int idx;
|
||||
|
||||
idx = READ_ONCE(sp->completed) & 0x1;
|
||||
__this_cpu_inc(sp->per_cpu_ref->lock_count[idx]);
|
||||
this_cpu_inc(sp->per_cpu_ref->lock_count[idx]);
|
||||
smp_mb(); /* B */ /* Avoid leaking the critical section. */
|
||||
return idx;
|
||||
}
|
||||
@@ -281,7 +281,6 @@ EXPORT_SYMBOL_GPL(__srcu_read_lock);
|
||||
* Removes the count for the old reader from the appropriate per-CPU
|
||||
* element of the srcu_struct. Note that this may well be a different
|
||||
* CPU than that which was incremented by the corresponding srcu_read_lock().
|
||||
* Must be called from process context.
|
||||
*/
|
||||
void __srcu_read_unlock(struct srcu_struct *sp, int idx)
|
||||
{
|
||||
|
||||
@@ -97,8 +97,9 @@ EXPORT_SYMBOL_GPL(cleanup_srcu_struct);
|
||||
|
||||
/*
|
||||
* Counts the new reader in the appropriate per-CPU element of the
|
||||
* srcu_struct. Must be called from process context.
|
||||
* Returns an index that must be passed to the matching srcu_read_unlock().
|
||||
* srcu_struct. Can be invoked from irq/bh handlers, but the matching
|
||||
* __srcu_read_unlock() must be in the same handler instance. Returns an
|
||||
* index that must be passed to the matching srcu_read_unlock().
|
||||
*/
|
||||
int __srcu_read_lock(struct srcu_struct *sp)
|
||||
{
|
||||
@@ -112,7 +113,7 @@ EXPORT_SYMBOL_GPL(__srcu_read_lock);
|
||||
|
||||
/*
|
||||
* Removes the count for the old reader from the appropriate element of
|
||||
* the srcu_struct. Must be called from process context.
|
||||
* the srcu_struct.
|
||||
*/
|
||||
void __srcu_read_unlock(struct srcu_struct *sp, int idx)
|
||||
{
|
||||
|
||||
@@ -357,7 +357,7 @@ EXPORT_SYMBOL_GPL(cleanup_srcu_struct);
|
||||
|
||||
/*
|
||||
* Counts the new reader in the appropriate per-CPU element of the
|
||||
* srcu_struct. Must be called from process context.
|
||||
* srcu_struct.
|
||||
* Returns an index that must be passed to the matching srcu_read_unlock().
|
||||
*/
|
||||
int __srcu_read_lock(struct srcu_struct *sp)
|
||||
@@ -365,7 +365,7 @@ int __srcu_read_lock(struct srcu_struct *sp)
|
||||
int idx;
|
||||
|
||||
idx = READ_ONCE(sp->srcu_idx) & 0x1;
|
||||
__this_cpu_inc(sp->sda->srcu_lock_count[idx]);
|
||||
this_cpu_inc(sp->sda->srcu_lock_count[idx]);
|
||||
smp_mb(); /* B */ /* Avoid leaking the critical section. */
|
||||
return idx;
|
||||
}
|
||||
@@ -375,7 +375,6 @@ EXPORT_SYMBOL_GPL(__srcu_read_lock);
|
||||
* Removes the count for the old reader from the appropriate per-CPU
|
||||
* element of the srcu_struct. Note that this may well be a different
|
||||
* CPU than that which was incremented by the corresponding srcu_read_lock().
|
||||
* Must be called from process context.
|
||||
*/
|
||||
void __srcu_read_unlock(struct srcu_struct *sp, int idx)
|
||||
{
|
||||
|
||||
+1
-1
@@ -5605,7 +5605,7 @@ void idle_task_exit(void)
|
||||
BUG_ON(cpu_online(smp_processor_id()));
|
||||
|
||||
if (mm != &init_mm) {
|
||||
switch_mm_irqs_off(mm, &init_mm, current);
|
||||
switch_mm(mm, &init_mm, current);
|
||||
finish_arch_post_lock_switch();
|
||||
}
|
||||
mmdrop(mm);
|
||||
|
||||
@@ -101,9 +101,6 @@ static void sugov_update_commit(struct sugov_policy *sg_policy, u64 time,
|
||||
if (sg_policy->next_freq == next_freq)
|
||||
return;
|
||||
|
||||
if (sg_policy->next_freq > next_freq)
|
||||
next_freq = (sg_policy->next_freq + next_freq) >> 1;
|
||||
|
||||
sg_policy->next_freq = next_freq;
|
||||
sg_policy->last_freq_update_time = time;
|
||||
|
||||
|
||||
+1
-1
@@ -3563,7 +3563,7 @@ static inline void check_schedstat_required(void)
|
||||
trace_sched_stat_runtime_enabled()) {
|
||||
printk_deferred_once("Scheduler tracepoints stat_sleep, stat_iowait, "
|
||||
"stat_blocked and stat_runtime require the "
|
||||
"kernel parameter schedstats=enabled or "
|
||||
"kernel parameter schedstats=enable or "
|
||||
"kernel.sched_schedstats=1\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -387,7 +387,7 @@ void alarm_start_relative(struct alarm *alarm, ktime_t start)
|
||||
{
|
||||
struct alarm_base *base = &alarm_bases[alarm->type];
|
||||
|
||||
start = ktime_add(start, base->gettime());
|
||||
start = ktime_add_safe(start, base->gettime());
|
||||
alarm_start(alarm, start);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(alarm_start_relative);
|
||||
@@ -475,7 +475,7 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval)
|
||||
overrun++;
|
||||
}
|
||||
|
||||
alarm->node.expires = ktime_add(alarm->node.expires, interval);
|
||||
alarm->node.expires = ktime_add_safe(alarm->node.expires, interval);
|
||||
return overrun;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(alarm_forward);
|
||||
@@ -660,13 +660,21 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
|
||||
|
||||
/* start the timer */
|
||||
timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval);
|
||||
|
||||
/*
|
||||
* Rate limit to the tick as a hot fix to prevent DOS. Will be
|
||||
* mopped up later.
|
||||
*/
|
||||
if (timr->it.alarm.interval < TICK_NSEC)
|
||||
timr->it.alarm.interval = TICK_NSEC;
|
||||
|
||||
exp = timespec64_to_ktime(new_setting->it_value);
|
||||
/* Convert (if necessary) to absolute time */
|
||||
if (flags != TIMER_ABSTIME) {
|
||||
ktime_t now;
|
||||
|
||||
now = alarm_bases[timr->it.alarm.alarmtimer.type].gettime();
|
||||
exp = ktime_add(now, exp);
|
||||
exp = ktime_add_safe(now, exp);
|
||||
}
|
||||
|
||||
alarm_start(&timr->it.alarm.alarmtimer, exp);
|
||||
|
||||
@@ -37,9 +37,11 @@ static int tick_broadcast_forced;
|
||||
static __cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK(tick_broadcast_lock);
|
||||
|
||||
#ifdef CONFIG_TICK_ONESHOT
|
||||
static void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
|
||||
static void tick_broadcast_clear_oneshot(int cpu);
|
||||
static void tick_resume_broadcast_oneshot(struct clock_event_device *bc);
|
||||
#else
|
||||
static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { BUG(); }
|
||||
static inline void tick_broadcast_clear_oneshot(int cpu) { }
|
||||
static inline void tick_resume_broadcast_oneshot(struct clock_event_device *bc) { }
|
||||
#endif
|
||||
@@ -867,7 +869,7 @@ static void tick_broadcast_init_next_event(struct cpumask *mask,
|
||||
/**
|
||||
* tick_broadcast_setup_oneshot - setup the broadcast device
|
||||
*/
|
||||
void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
|
||||
static void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
|
||||
{
|
||||
int cpu = smp_processor_id();
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
|
||||
|
||||
/* Functions related to oneshot broadcasting */
|
||||
#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT)
|
||||
extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
|
||||
extern void tick_broadcast_switch_to_oneshot(void);
|
||||
extern void tick_shutdown_broadcast_oneshot(unsigned int cpu);
|
||||
extern int tick_broadcast_oneshot_active(void);
|
||||
@@ -134,7 +133,6 @@ extern void tick_check_oneshot_broadcast_this_cpu(void);
|
||||
bool tick_broadcast_oneshot_available(void);
|
||||
extern struct cpumask *tick_get_broadcast_oneshot_mask(void);
|
||||
#else /* !(BROADCAST && ONESHOT): */
|
||||
static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { BUG(); }
|
||||
static inline void tick_broadcast_switch_to_oneshot(void) { }
|
||||
static inline void tick_shutdown_broadcast_oneshot(unsigned int cpu) { }
|
||||
static inline int tick_broadcast_oneshot_active(void) { return 0; }
|
||||
|
||||
Reference in New Issue
Block a user