linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: adharmap@codeaurora.org (Abhijeet Dharmapurikar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] GIC: Assign correct flow handler type in set_type callback
Date: Wed, 29 Dec 2010 21:29:20 -0800	[thread overview]
Message-ID: <1293686960-12581-1-git-send-email-adharmap@codeaurora.org> (raw)

There are some interrupts that are true edge triggered in nature. If not
marked IRQ_PENDING, when disabled, they will be lost.

Use the set_type callback to assign the correct flow type handler for
shared peripheral interrupts.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
---
This came to light when a edge triggered interrupt was supposed to wakeup the
sytem. The flow handler was set to the default handle_level_irq. On the resume
path the flow handler was invoked right after the I bit was cleared but before
each individual interrupts were enabled. This made the handle_level_irq ignore
the interrupt (mask_ack it) and it was lost. handle_edge_irq does the right
thing by marking the interrupt as IRQ_PENDING and when the resume code gets to
enabling each interrupt this interrupt is resent again.

 arch/arm/common/gic.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index e6388dc..a83594a 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -136,6 +136,9 @@ static int gic_set_type(unsigned int irq, unsigned int type)
 
 	spin_unlock(&irq_controller_lock);
 
+	if ((type & IRQ_TYPE_EDGE_RISING) && gicirq > 31)
+		__set_irq_handler_unlocked(irq, handle_edge_irq);
+
 	return 0;
 }
 
-- 
1.7.1
Sent by an employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation
Center, Inc. is a member of Code Aurora Forum.

             reply	other threads:[~2010-12-30  5:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-30  5:29 Abhijeet Dharmapurikar [this message]
2010-12-30  6:27 ` [PATCH] GIC: Assign correct flow handler type in set_type callback Rabin Vincent
2010-12-31 10:39   ` Abhijeet Dharmapurikar
2011-01-02  6:26     ` Abhijeet Dharmapurikar

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=1293686960-12581-1-git-send-email-adharmap@codeaurora.org \
    --to=adharmap@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).