All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Brian Norris <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jason@lakedaemon.net, tglx@linutronix.de, cernekee@chromium.org,
	gregory.0xf0@gmail.com, f.fainelli@gmail.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org, computersforpeace@gmail.com,
	mingo@kernel.org
Subject: [tip:irq/core] irqchip/bcm7120-l2: Perform suspend/ resume even without installed child IRQs
Date: Sun, 26 Jul 2015 23:15:16 -0700	[thread overview]
Message-ID: <tip-fd537766715e9b6bf7ff07abb22f4817201433db@git.kernel.org> (raw)
In-Reply-To: <1437607300-40858-2-git-send-email-computersforpeace@gmail.com>

Commit-ID:  fd537766715e9b6bf7ff07abb22f4817201433db
Gitweb:     http://git.kernel.org/tip/fd537766715e9b6bf7ff07abb22f4817201433db
Author:     Brian Norris <computersforpeace@gmail.com>
AuthorDate: Wed, 22 Jul 2015 16:21:40 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 27 Jul 2015 08:09:38 +0200

irqchip/bcm7120-l2: Perform suspend/resume even without installed child IRQs

Make use of the new irq_chip_generic suspend/resume callbacks.

This is required because if there are no installed child IRQs for this
chip, the irq_chip::irq_{suspend,resume} functions will not be called.
However, we still need to save/restore the forwarding mask, to enable
the top-level GIC interrupt; otherwise, we lose UART output after S3
resume.

In addition to refactoring the callbacks, we have to self-initialize the
mask cache, since the genirq core also doesn't initialize this until the
first child IRQ is installed.

The original problem report is described in extra detail here:
http://lkml.kernel.org/g/20150619224123.GL4917@ld-irv-0074

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Gregory Fong <gregory.0xf0@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-mips@linux-mips.org
Cc: Kevin Cernekee <cernekee@chromium.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1437607300-40858-2-git-send-email-computersforpeace@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/irqchip/irq-bcm7120-l2.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
index 88c9719..c885a5c 100644
--- a/drivers/irqchip/irq-bcm7120-l2.c
+++ b/drivers/irqchip/irq-bcm7120-l2.c
@@ -80,11 +80,10 @@ static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc)
 	chained_irq_exit(chip, desc);
 }
 
-static void bcm7120_l2_intc_suspend(struct irq_data *d)
+static void bcm7120_l2_intc_suspend(struct irq_chip_generic *gc)
 {
-	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
-	struct irq_chip_type *ct = irq_data_get_chip_type(d);
 	struct bcm7120_l2_intc_data *b = gc->private;
+	struct irq_chip_type *ct = gc->chip_types;
 
 	irq_gc_lock(gc);
 	if (b->can_wake)
@@ -93,10 +92,9 @@ static void bcm7120_l2_intc_suspend(struct irq_data *d)
 	irq_gc_unlock(gc);
 }
 
-static void bcm7120_l2_intc_resume(struct irq_data *d)
+static void bcm7120_l2_intc_resume(struct irq_chip_generic *gc)
 {
-	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
-	struct irq_chip_type *ct = irq_data_get_chip_type(d);
+	struct irq_chip_type *ct = gc->chip_types;
 
 	/* Restore the saved mask */
 	irq_gc_lock(gc);
@@ -279,8 +277,15 @@ int __init bcm7120_l2_intc_probe(struct device_node *dn,
 		ct->chip.irq_mask = irq_gc_mask_clr_bit;
 		ct->chip.irq_unmask = irq_gc_mask_set_bit;
 		ct->chip.irq_ack = irq_gc_noop;
-		ct->chip.irq_suspend = bcm7120_l2_intc_suspend;
-		ct->chip.irq_resume = bcm7120_l2_intc_resume;
+		gc->suspend = bcm7120_l2_intc_suspend;
+		gc->resume = bcm7120_l2_intc_resume;
+
+		/*
+		 * Initialize mask-cache, in case we need it for
+		 * saving/restoring fwd mask even w/o any child interrupts
+		 * installed
+		 */
+		gc->mask_cache = irq_reg_readl(gc, ct->regs.mask);
 
 		if (data->can_wake) {
 			/* This IRQ chip can wake the system, set all

  reply	other threads:[~2015-07-27  6:15 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  0:11 [PATCH 0/7] soc: brcmstb: add system suspend support for STB SoCs Brian Norris
2015-06-19  0:11 ` Brian Norris
2015-06-19  0:11 ` Brian Norris
2015-06-19  0:11 ` [PATCH 1/7] Documentation: dt: brcmstb: add system PM bindings Brian Norris
2015-06-19  0:11   ` Brian Norris
2015-09-12 19:58   ` Florian Fainelli
2015-09-12 19:58     ` Florian Fainelli
2015-09-12 19:58     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 2/7] Documentation: dt: brcmstb: add waketimer documentation Brian Norris
2015-06-19  0:11   ` Brian Norris
2015-06-19  2:09   ` Gregory Fong
2015-06-19  2:09     ` Gregory Fong
2015-06-19  2:09     ` Gregory Fong
2015-09-12 19:58   ` Florian Fainelli
2015-09-12 19:58     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 3/7] soc: add stubs for brcmstb SoC's Brian Norris
2015-06-19  0:11   ` Brian Norris
2015-09-12 20:16   ` Florian Fainelli
2015-09-12 20:16     ` Florian Fainelli
2015-09-12 20:16     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 4/7] soc: brcmstb: add PM suspend/resume support (S2/S3/S5) Brian Norris
2015-06-19  0:11   ` Brian Norris
2015-09-12 20:23   ` Florian Fainelli
2015-09-12 20:23     ` Florian Fainelli
2015-09-12 20:23     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 5/7] soc: brcmstb: add wake-timer driver Brian Norris
2015-06-19  0:11   ` Brian Norris
2015-06-19  2:20   ` Gregory Fong
2015-06-19  2:20     ` Gregory Fong
2015-06-19  2:20     ` Gregory Fong
2015-06-19 17:36     ` Brian Norris
2015-06-19 17:36       ` Brian Norris
2015-06-19 17:36       ` Brian Norris
2015-09-12 20:00   ` Florian Fainelli
2015-09-12 20:00     ` Florian Fainelli
2015-09-12 20:00     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 6/7] ARM: brcmstb: mask GIC IRQs on suspend Brian Norris
2015-06-19  0:11   ` Brian Norris
2015-06-19  1:48   ` Gregory Fong
2015-06-19  1:48     ` Gregory Fong
2015-09-12 19:53   ` Florian Fainelli
2015-09-12 19:53     ` Florian Fainelli
2015-09-12 19:53     ` Florian Fainelli
2015-09-14 17:29     ` Brian Norris
2015-09-14 17:29       ` Brian Norris
2015-09-14 17:29       ` Brian Norris
2015-09-14 17:42     ` Brian Norris
2015-09-14 17:42       ` Brian Norris
2015-09-14 17:42       ` Brian Norris
2015-09-14 17:43       ` Florian Fainelli
2015-09-14 17:43         ` Florian Fainelli
2015-09-14 17:43         ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 7/7] ARM: dts: brcmstb: add BCM7445 system PM DT nodes Brian Norris
2015-06-19  0:11   ` Brian Norris
2015-09-12 19:58   ` Florian Fainelli
2015-09-12 19:58     ` Florian Fainelli
2015-09-12 19:58     ` Florian Fainelli
2015-06-19  3:20 ` [PATCH 0/7] soc: brcmstb: add system suspend support for STB SoCs Gregory Fong
2015-06-19  3:20   ` Gregory Fong
2015-06-19  3:20   ` Gregory Fong
2015-06-19 22:41   ` Brian Norris
2015-06-19 22:41     ` Brian Norris
2015-06-19 22:41     ` Brian Norris
2015-06-19 22:55     ` Brian Norris
2015-06-19 22:55       ` Brian Norris
2015-06-19 22:55       ` Brian Norris
2015-06-19 23:26     ` [PATCH 1/2] genirq: add chip_{suspend,resume} PM support to irq_chip Brian Norris
2015-06-19 23:26       ` Brian Norris
2015-06-19 23:26       ` Brian Norris
2015-06-19 23:26       ` [PATCH 2/2] IRQCHIP: bcm7120-l2: perform suspend/resume even without installed child IRQs Brian Norris
2015-06-19 23:26         ` Brian Norris
2015-06-19 23:26         ` Brian Norris
2015-06-19 23:39         ` Florian Fainelli
2015-06-19 23:39           ` Florian Fainelli
2015-06-19 23:38       ` [PATCH 1/2] genirq: add chip_{suspend,resume} PM support to irq_chip Florian Fainelli
2015-06-19 23:38         ` Florian Fainelli
2015-06-20 14:11       ` Thomas Gleixner
2015-06-20 14:11         ` Thomas Gleixner
2015-07-21 18:24         ` Florian Fainelli
2015-07-21 21:23           ` Thomas Gleixner
2015-07-21 21:26             ` Florian Fainelli
2015-07-21 21:26               ` Florian Fainelli
2015-07-21 21:58               ` Thomas Gleixner
2015-07-22 23:28                 ` Brian Norris
2015-07-21 21:36           ` Brian Norris
2015-07-22 23:21       ` [PATCH v2 " Brian Norris
2015-07-22 23:21         ` [PATCH v2 2/2] IRQCHIP: bcm7120-l2: perform suspend/resume even without installed child IRQs Brian Norris
2015-07-27  6:15           ` tip-bot for Brian Norris [this message]
2015-07-27  6:14         ` [tip:irq/core] genirq: Add chip_[suspend|resume] PM support to irq_chip tip-bot for Brian Norris
2015-06-22 19:47 ` [PATCH 0/7] soc: brcmstb: add system suspend support for STB SoCs Brian Norris
2015-06-22 19:47   ` Brian Norris
2015-06-22 19:47   ` Brian Norris
2015-06-24  4:47   ` Florian Fainelli
2015-06-24  4:47     ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-fd537766715e9b6bf7ff07abb22f4817201433db@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=cernekee@chromium.org \
    --cc=computersforpeace@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.0xf0@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.