Skip to content

Commit

Permalink
genirq/PM: Restore system wake up from chained interrupts
Browse files Browse the repository at this point in the history
Commit e509bd7 ("genirq: Allow migration of chained interrupts
by installing default action") breaks PCS wake up IRQ behaviour on
TI OMAP based platforms (dra7-evm).

TI OMAP IRQ wake up configuration:
GIC-irqchip->PCM_IRQ
  |- omap_prcm_register_chain_handler
     |- PRCM-irqchip -> PRCM_IO_IRQ
        |- pcs_irq_chain_handler
           |- pinctrl-irqchip -> PCS_uart1_wakeup_irq

This happens because IRQ PM code (irq/pm.c) is expected to ignore
chained interrupts by default:
  static bool suspend_device_irq(struct irq_desc *desc)
  {
	if (!desc->action || desc->no_suspend_depth)
		return false;
 - it's expected !desc->action = true for chained interrupts;

but, after above change, all chained interrupt descriptors will
have default action handler installed - chained_action.
As result, chained interrupts will be silently disabled during system
suspend.

Hence, fix it by introducing helper function irq_desc_is_chained() and
use it in suspend_device_irq() for chained interrupts identification
and skip them, once detected.

Fixes: e509bd7 ("genirq: Allow migration of chained interrupts..")
Signed-off-by: Grygorii Strashko <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: Tony Lindgren <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
grygoriyS authored and KAGA-KOKO committed Nov 10, 2015
1 parent 66ef349 commit 4717f13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions kernel/irq/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

static inline int irq_desc_is_chained(struct irq_desc *desc)
{
return (desc->action && desc->action == &chained_action);
}

#ifdef CONFIG_PM_SLEEP
bool irq_pm_check_wakeup(struct irq_desc *desc);
void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action);
Expand Down
3 changes: 2 additions & 1 deletion kernel/irq/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
if (!desc->action || desc->no_suspend_depth)
if (!desc->action || irq_desc_is_chained(desc) ||
desc->no_suspend_depth)
return false;

if (irqd_is_wakeup_set(&desc->irq_data)) {
Expand Down
2 changes: 1 addition & 1 deletion kernel/irq/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ int show_interrupts(struct seq_file *p, void *v)
for_each_online_cpu(j)
any_count |= kstat_irqs_cpu(i, j);
action = desc->action;
if ((!action || action == &chained_action) && !any_count)
if ((!action || irq_desc_is_chained(desc)) && !any_count)
goto out;

seq_printf(p, "%*d: ", prec, i);
Expand Down

0 comments on commit 4717f13

Please sign in to comment.