All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, Thomas Gleixner <tglx@linutronix.de>
Subject: MIPS: EMMA2RH: Use handle_edge_irq() handler for GPIO interrupts
Date: Sat, 14 Mar 2009 00:31:33 +0900	[thread overview]
Message-ID: <49BA7C55.5020600@ruby.dti.ne.jp> (raw)
In-Reply-To: <20090311112806.GA24541@linux-mips.org>

EMMA's GPIO interrupts are latched by GPIO interrupt status register.
In this case, we're encouraged to use handle_edge_irq() handler.

The following changes are made along with replacing set_irq_chip() with
set_irq_chip_and_handler_name(,,handle_edge_irq,"edge"):

* Fix emma2rh_gpio_irq_ack not to disable interrupts

  With handle_edge_irq(), we're not expected to disable interrupts
  when chip->ack is served, so fix it accordingly.  We also add a
  new emma2rh_gpio_irq_mask_ack() for chip->mask_ack operation.

* Remove emma2rh_gpio_irq_end() as chip->end is no longer served.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
---

Ralf Baechle wrote:
> __do_IRQ() is deprecated since a long time and there are plans to remove
> it for 2.6.30.  The MIPS platforms seem to fall into three classes:
[snip]
>  o Platforms that still seem to rely on __do_IRQ():
>      o All Sibyte platforms:
> 	bigsur_defconfig and sb1250-swarm_defconfig
> 
>      o All Alchemy platforms:
> 	db1000_defconfig, db1100_defconfig, db1200_defconfig, db1500_defconfig,
> 	db1550_defconfig, mtx1_defconfig, pb1100_defconfig, pb1500_defconfig
> 	and pb1550_defconfig
> 
>      o malta_defconfig.  The platform code itself is ok but irq-gic.c,
> 	irq-msc01.c, irq-msc01.c and irq_cpu.c are still using set_irq_chip
> 	and need fixing.
> 
>      o And the rest:
> 	decstation_defconfig, emma2rh_defconfig, ip32_defconfig,
> 	yosemite_defconfig, mipssim_defconfig and rm200_defconfig.

Here's a patch for EMMA2RH not to call __do_IRQ(). Please review.

Thanks,

  Shinya

 arch/mips/emma/markeins/irq.c |   28 ++++++++++------------------
 1 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/arch/mips/emma/markeins/irq.c b/arch/mips/emma/markeins/irq.c
index ce8f5f2..d15556c 100644
--- a/arch/mips/emma/markeins/irq.c
+++ b/arch/mips/emma/markeins/irq.c
@@ -149,37 +149,28 @@ static void emma2rh_gpio_irq_disable(unsigned int irq)
 
 static void emma2rh_gpio_irq_ack(unsigned int irq)
 {
-	u32 reg;
-
 	irq -= EMMA2RH_GPIO_IRQ_BASE;
 	emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));
-
-	reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
-	reg &= ~(1 << irq);
-	emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
 }
 
-static void emma2rh_gpio_irq_end(unsigned int irq)
+static void emma2rh_gpio_irq_mask_ack(unsigned int irq)
 {
 	u32 reg;
 
-	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
-
-		irq -= EMMA2RH_GPIO_IRQ_BASE;
+	irq -= EMMA2RH_GPIO_IRQ_BASE;
+	emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));
 
-		reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
-		reg |= 1 << irq;
-		emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
-	}
+	reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
+	reg &= ~(1 << irq);
+	emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
 }
 
 struct irq_chip emma2rh_gpio_irq_controller = {
 	.name = "emma2rh_gpio_irq",
 	.ack = emma2rh_gpio_irq_ack,
 	.mask = emma2rh_gpio_irq_disable,
-	.mask_ack = emma2rh_gpio_irq_ack,
+	.mask_ack = emma2rh_gpio_irq_mask_ack,
 	.unmask = emma2rh_gpio_irq_enable,
-	.end = emma2rh_gpio_irq_end,
 };
 
 void emma2rh_gpio_irq_init(void)
@@ -187,8 +178,9 @@ void emma2rh_gpio_irq_init(void)
 	u32 i;
 
 	for (i = 0; i < NUM_EMMA2RH_IRQ_GPIO; i++)
-		set_irq_chip(EMMA2RH_GPIO_IRQ_BASE + i,
-			     &emma2rh_gpio_irq_controller);
+		set_irq_chip_and_handler_name(EMMA2RH_GPIO_IRQ_BASE + i,
+					      &emma2rh_gpio_irq_controller,
+					      handle_edge_irq, "edge");
 }
 
 static struct irqaction irq_cascade = {

      parent reply	other threads:[~2009-03-13 15:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 11:28 __do_IRQ() going away Ralf Baechle
2009-03-11 23:23 ` Markus Gothe
2009-03-12  7:26 ` Manuel Lauss
2009-03-12  9:28   ` Ralf Baechle
2009-03-12  9:46     ` Manuel Lauss
2009-03-12 11:20       ` Ralf Baechle
2009-03-13 15:31 ` Shinya Kuribayashi [this message]

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=49BA7C55.5020600@ruby.dti.ne.jp \
    --to=skuribay@ruby.dti.ne.jp \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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.