Commit 511601bd authored by Linus Torvalds's avatar Linus Torvalds

Merge branches 'irq-urgent-for-linus' and 'timers-urgent-for-linus' of...

Merge branches 'irq-urgent-for-linus' and 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq and timer fixes from Thomas Gleixner:

 - An irq regression fix to restore the wakeup behaviour of chained
   interrupts.

 - A timer fix for a long standing race versus timers scheduled on a
   target cpu which got exposed by recent changes in the workqueue
   implementation.

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq/PM: Restore system wake up from chained interrupts

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  timers: Use proper base migration in add_timer_on()
...@@ -199,6 +199,11 @@ static inline int irq_desc_get_node(struct irq_desc *desc) ...@@ -199,6 +199,11 @@ static inline int irq_desc_get_node(struct irq_desc *desc)
return irq_common_data_get_node(&desc->irq_common_data); return irq_common_data_get_node(&desc->irq_common_data);
} }
static inline int irq_desc_is_chained(struct irq_desc *desc)
{
return (desc->action && desc->action == &chained_action);
}
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
bool irq_pm_check_wakeup(struct irq_desc *desc); bool irq_pm_check_wakeup(struct irq_desc *desc);
void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action); void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action);
......
...@@ -70,7 +70,8 @@ void irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action) ...@@ -70,7 +70,8 @@ void irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action)
static bool suspend_device_irq(struct irq_desc *desc) static bool suspend_device_irq(struct irq_desc *desc)
{ {
if (!desc->action || desc->no_suspend_depth) if (!desc->action || irq_desc_is_chained(desc) ||
desc->no_suspend_depth)
return false; return false;
if (irqd_is_wakeup_set(&desc->irq_data)) { if (irqd_is_wakeup_set(&desc->irq_data)) {
......
...@@ -475,7 +475,7 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -475,7 +475,7 @@ int show_interrupts(struct seq_file *p, void *v)
for_each_online_cpu(j) for_each_online_cpu(j)
any_count |= kstat_irqs_cpu(i, j); any_count |= kstat_irqs_cpu(i, j);
action = desc->action; action = desc->action;
if ((!action || action == &chained_action) && !any_count) if ((!action || irq_desc_is_chained(desc)) && !any_count)
goto out; goto out;
seq_printf(p, "%*d: ", prec, i); seq_printf(p, "%*d: ", prec, i);
......
...@@ -977,13 +977,29 @@ EXPORT_SYMBOL(add_timer); ...@@ -977,13 +977,29 @@ EXPORT_SYMBOL(add_timer);
*/ */
void add_timer_on(struct timer_list *timer, int cpu) void add_timer_on(struct timer_list *timer, int cpu)
{ {
struct tvec_base *base = per_cpu_ptr(&tvec_bases, cpu); struct tvec_base *new_base = per_cpu_ptr(&tvec_bases, cpu);
struct tvec_base *base;
unsigned long flags; unsigned long flags;
timer_stats_timer_set_start_info(timer); timer_stats_timer_set_start_info(timer);
BUG_ON(timer_pending(timer) || !timer->function); BUG_ON(timer_pending(timer) || !timer->function);
spin_lock_irqsave(&base->lock, flags);
timer->flags = (timer->flags & ~TIMER_BASEMASK) | cpu; /*
* If @timer was on a different CPU, it should be migrated with the
* old base locked to prevent other operations proceeding with the
* wrong base locked. See lock_timer_base().
*/
base = lock_timer_base(timer, &flags);
if (base != new_base) {
timer->flags |= TIMER_MIGRATING;
spin_unlock(&base->lock);
base = new_base;
spin_lock(&base->lock);
WRITE_ONCE(timer->flags,
(timer->flags & ~TIMER_BASEMASK) | cpu);
}
debug_activate(timer, timer->expires); debug_activate(timer, timer->expires);
internal_add_timer(base, timer); internal_add_timer(base, timer);
spin_unlock_irqrestore(&base->lock, flags); spin_unlock_irqrestore(&base->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment