From: "Heiko Stübner" <heiko@sntech.de>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: S3C24XX: fix irq parent check
Date: Tue, 26 Feb 2013 23:58:29 +0100 [thread overview]
Message-ID: <201302262358.29291.heiko@sntech.de> (raw)
In-Reply-To: <201302262357.24544.heiko@sntech.de>
The current parent_irq check checks for a value != 0. This does of course
not work when the parent irq sits in the bit 0 of the parent register.
This only affects the eint0 interrupt of the s3c2412.
To fix this behaviour, check for the presence of a parent_intc in the
structure. In an s3c24xx interrupt controller either all interrupts have
parent interrupts or none have, so if a parent controller is available
the parent_irq value always points to a parent_irq.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/arm/mach-s3c24xx/irq.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-s3c24xx/irq.c b/arch/arm/mach-s3c24xx/irq.c
index 5257c9f..a6a7554 100644
--- a/arch/arm/mach-s3c24xx/irq.c
+++ b/arch/arm/mach-s3c24xx/irq.c
@@ -81,7 +81,7 @@ static void s3c_irq_mask(struct irq_data *data)
mask |= (1UL << data->hwirq);
__raw_writel(mask, intc->reg_mask);
- if (parent_intc && irq_data->parent_irq) {
+ if (parent_intc) {
parent_data = &parent_intc->irqs[irq_data->parent_irq];
/* check to see if we need to mask the parent IRQ */
@@ -105,7 +105,7 @@ static void s3c_irq_unmask(struct irq_data *data)
mask &= ~(1UL << data->hwirq);
__raw_writel(mask, intc->reg_mask);
- if (parent_intc && irq_data->parent_irq) {
+ if (parent_intc) {
irqno = irq_find_mapping(parent_intc->domain,
irq_data->parent_irq);
s3c_irq_unmask(irq_get_irq_data(irqno));
@@ -327,6 +327,8 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
/* attach controller pointer to irq_data */
irq_data->intc = intc;
+ parent_intc = intc->parent;
+
/* set handler and flags */
switch (irq_data->type) {
case S3C_IRQTYPE_NONE:
@@ -335,7 +337,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
/* On the S3C2412, the EINT0to3 have a parent irq
* but need the s3c_irq_eint0t4 chip
*/
- if (irq_data->parent_irq && (!soc_is_s3c2412() || hw >= 4))
+ if (parent_intc && (!soc_is_s3c2412() || hw >= 4))
irq_set_chip_and_handler(virq, &s3c_irqext_chip,
handle_edge_irq);
else
@@ -343,8 +345,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
handle_edge_irq);
break;
case S3C_IRQTYPE_EDGE:
- if (irq_data->parent_irq ||
- intc->reg_pending == S3C2416_SRCPND2)
+ if (parent_intc || intc->reg_pending == S3C2416_SRCPND2)
irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
handle_edge_irq);
else
@@ -352,7 +353,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
handle_edge_irq);
break;
case S3C_IRQTYPE_LEVEL:
- if (irq_data->parent_irq)
+ if (parent_intc)
irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
handle_level_irq);
else
@@ -365,14 +366,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
}
set_irq_flags(virq, IRQF_VALID);
- if (irq_data->parent_irq) {
- parent_intc = intc->parent;
- if (!parent_intc) {
- pr_err("irq-s3c24xx: no parent controller found for hwirq %lu\n",
- hw);
- goto err;
- }
-
+ if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) {
if (irq_data->parent_irq > 31) {
pr_err("irq-s3c24xx: parent irq %lu is out of range\n",
irq_data->parent_irq);
--
1.7.2.3
WARNING: multiple messages have this Message-ID (diff)
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: S3C24XX: fix irq parent check
Date: Tue, 26 Feb 2013 23:58:29 +0100 [thread overview]
Message-ID: <201302262358.29291.heiko@sntech.de> (raw)
In-Reply-To: <201302262357.24544.heiko@sntech.de>
The current parent_irq check checks for a value != 0. This does of course
not work when the parent irq sits in the bit 0 of the parent register.
This only affects the eint0 interrupt of the s3c2412.
To fix this behaviour, check for the presence of a parent_intc in the
structure. In an s3c24xx interrupt controller either all interrupts have
parent interrupts or none have, so if a parent controller is available
the parent_irq value always points to a parent_irq.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/arm/mach-s3c24xx/irq.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-s3c24xx/irq.c b/arch/arm/mach-s3c24xx/irq.c
index 5257c9f..a6a7554 100644
--- a/arch/arm/mach-s3c24xx/irq.c
+++ b/arch/arm/mach-s3c24xx/irq.c
@@ -81,7 +81,7 @@ static void s3c_irq_mask(struct irq_data *data)
mask |= (1UL << data->hwirq);
__raw_writel(mask, intc->reg_mask);
- if (parent_intc && irq_data->parent_irq) {
+ if (parent_intc) {
parent_data = &parent_intc->irqs[irq_data->parent_irq];
/* check to see if we need to mask the parent IRQ */
@@ -105,7 +105,7 @@ static void s3c_irq_unmask(struct irq_data *data)
mask &= ~(1UL << data->hwirq);
__raw_writel(mask, intc->reg_mask);
- if (parent_intc && irq_data->parent_irq) {
+ if (parent_intc) {
irqno = irq_find_mapping(parent_intc->domain,
irq_data->parent_irq);
s3c_irq_unmask(irq_get_irq_data(irqno));
@@ -327,6 +327,8 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
/* attach controller pointer to irq_data */
irq_data->intc = intc;
+ parent_intc = intc->parent;
+
/* set handler and flags */
switch (irq_data->type) {
case S3C_IRQTYPE_NONE:
@@ -335,7 +337,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
/* On the S3C2412, the EINT0to3 have a parent irq
* but need the s3c_irq_eint0t4 chip
*/
- if (irq_data->parent_irq && (!soc_is_s3c2412() || hw >= 4))
+ if (parent_intc && (!soc_is_s3c2412() || hw >= 4))
irq_set_chip_and_handler(virq, &s3c_irqext_chip,
handle_edge_irq);
else
@@ -343,8 +345,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
handle_edge_irq);
break;
case S3C_IRQTYPE_EDGE:
- if (irq_data->parent_irq ||
- intc->reg_pending == S3C2416_SRCPND2)
+ if (parent_intc || intc->reg_pending == S3C2416_SRCPND2)
irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
handle_edge_irq);
else
@@ -352,7 +353,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
handle_edge_irq);
break;
case S3C_IRQTYPE_LEVEL:
- if (irq_data->parent_irq)
+ if (parent_intc)
irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
handle_level_irq);
else
@@ -365,14 +366,7 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
}
set_irq_flags(virq, IRQF_VALID);
- if (irq_data->parent_irq) {
- parent_intc = intc->parent;
- if (!parent_intc) {
- pr_err("irq-s3c24xx: no parent controller found for hwirq %lu\n",
- hw);
- goto err;
- }
-
+ if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) {
if (irq_data->parent_irq > 31) {
pr_err("irq-s3c24xx: parent irq %lu is out of range\n",
irq_data->parent_irq);
--
1.7.2.3
next prev parent reply other threads:[~2013-02-26 22:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-26 22:57 [PATCH 0/5] ARM: S3C24XX: more fixes and enhancements for the s3c24xx irqs Heiko Stübner
2013-02-26 22:57 ` Heiko Stübner
2013-02-26 22:57 ` [PATCH 1/5] ARM: S3C24XX: fix redundant checks in the irq mapping function Heiko Stübner
2013-02-26 22:57 ` Heiko Stübner
2013-02-26 22:58 ` Heiko Stübner [this message]
2013-02-26 22:58 ` [PATCH 2/5] ARM: S3C24XX: fix irq parent check Heiko Stübner
2013-02-26 22:58 ` [PATCH 3/5] ARM: S3C24XX: move s3c24xx_init_irq to s3c2410_init_irq Heiko Stübner
2013-02-26 22:58 ` Heiko Stübner
2013-02-26 22:59 ` [PATCH 4/5] ARM: S3C24XX: make s3c24xx_init_intc static Heiko Stübner
2013-02-26 22:59 ` Heiko Stübner
2013-02-26 23:00 ` [PATCH 5/5] ARM: S3C24XX: add handle_irq function Heiko Stübner
2013-02-26 23:00 ` Heiko Stübner
2013-03-09 9:14 ` [PATCH 0/5] ARM: S3C24XX: more fixes and enhancements for the s3c24xx irqs Kukjin Kim
2013-03-09 9:14 ` Kukjin Kim
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=201302262358.29291.heiko@sntech.de \
--to=heiko@sntech.de \
--cc=julia.lawall@lip6.fr \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.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 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.