From: Ed Blake <ed.blake@sondrel.com>
To: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com
Cc: linux-kernel@vger.kernel.org, Ed Blake <ed.blake@sondrel.com>
Subject: [PATCH 4/4] irqchip: imgpdc: Pass on peripheral mask/unmasks to the parent
Date: Mon, 2 Oct 2017 10:55:59 +0100 [thread overview]
Message-ID: <1506938159-466-5-git-send-email-ed.blake@sondrel.com> (raw)
In-Reply-To: <1506938159-466-1-git-send-email-ed.blake@sondrel.com>
Pass on peripheral (RTC/IR/WD) irq masks and unmasks to the parent
interrupt controller, as well as setting / clearing the relevant bits
in the IRQ_ROUTE register.
Clearing bits in the IRQ_ROUTE register will prevent future interrupts
from being passed on to the parent, but won't mask an existing
interrupt which has already made it to the parent. This is currently
causing peipheral interrupts to fire continuously when the system wakes
from a suspended state when one of the peripherals is used to wake the
system (e.g. RTC, IR). The interrupt occurs early in the wake process
(still in the noirq phase) and because the peripheral interrupt is
disabled at that point, the core marks it as pending and masks it out.
This mask must be passed to the parent controller to be effective.
Signed-off-by: Ed Blake <ed.blake@sondrel.com>
---
drivers/irqchip/irq-imgpdc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/irqchip/irq-imgpdc.c b/drivers/irqchip/irq-imgpdc.c
index d1bcfef..05c48dd 100644
--- a/drivers/irqchip/irq-imgpdc.c
+++ b/drivers/irqchip/irq-imgpdc.c
@@ -141,21 +141,31 @@ static struct pdc_intc_priv *irqd_to_priv(struct irq_data *data)
static void perip_irq_mask(struct irq_data *data)
{
struct pdc_intc_priv *priv = irqd_to_priv(data);
+ unsigned int parent_irq = priv->perip_irqs[data->hwirq];
+ struct irq_data *parent_irq_data = irq_get_irq_data(parent_irq);
raw_spin_lock(&priv->lock);
priv->irq_route &= ~data->mask;
pdc_write(priv, PDC_IRQ_ROUTE, priv->irq_route);
raw_spin_unlock(&priv->lock);
+
+ /* Pass on the mask to the parent */
+ parent_irq_data->chip->irq_mask(parent_irq_data);
}
static void perip_irq_unmask(struct irq_data *data)
{
struct pdc_intc_priv *priv = irqd_to_priv(data);
+ unsigned int parent_irq = priv->perip_irqs[data->hwirq];
+ struct irq_data *parent_irq_data = irq_get_irq_data(parent_irq);
raw_spin_lock(&priv->lock);
priv->irq_route |= data->mask;
pdc_write(priv, PDC_IRQ_ROUTE, priv->irq_route);
raw_spin_unlock(&priv->lock);
+
+ /* Pass on the unmask to the parent */
+ parent_irq_data->chip->irq_unmask(parent_irq_data);
}
static int syswake_irq_set_type(struct irq_data *data, unsigned int flow_type)
--
1.9.1
next prev parent reply other threads:[~2017-10-02 9:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 9:55 [PATCH 0/4] irqchip: imgpdc: Fix various issues Ed Blake
2017-10-02 9:55 ` [PATCH 1/4] irqchip: imgpdc: Avoid unbalanced irq wake disable Ed Blake
2017-10-02 9:55 ` [PATCH 2/4] irqchip: imgpdc: Avoid immediate wake event during set_wake Ed Blake
2017-10-02 9:55 ` [PATCH 3/4] irqchip: imgpdc: Set sys wake polarities to active high Ed Blake
2017-10-04 13:14 ` James Hogan
2017-10-05 14:37 ` Ed Blake
2017-10-02 9:55 ` Ed Blake [this message]
2017-10-04 14:03 ` [PATCH 4/4] irqchip: imgpdc: Pass on peripheral mask/unmasks to the parent James Hogan
2017-10-05 14:48 ` Ed Blake
2017-10-05 15:26 ` James Hogan
2017-10-05 15:43 ` Ed Blake
2017-10-05 16:42 ` Ed Blake
2017-10-03 20:32 ` [PATCH 0/4] irqchip: imgpdc: Fix various issues Thomas Gleixner
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=1506938159-466-5-git-send-email-ed.blake@sondrel.com \
--to=ed.blake@sondrel.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox