mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	paulus@samba.org, axboe@kernel.dk
Subject: [PATCH v2 5/6] Sysace: Move IRQ handler registration to occur after FSM is initialized
Date: Sun, 30 Sep 2007 16:57:33 -0600	[thread overview]
Message-ID: <20070930225726.2476.44211.stgit@trillian.cg.shawcable.net> (raw)
In-Reply-To: <20070930225112.2476.49914.stgit@trillian.cg.shawcable.net>

From: Grant Likely <grant.likely@secretlab.ca>

The FSM needs to be initialized before it is safe to call the ISR

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 drivers/block/xsysace.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 10bb4e5..296d567 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -949,15 +949,6 @@ static int __devinit ace_setup(struct ace_device *ace)
 	if (!ace->baseaddr)
 		goto err_ioremap;
 
-	if (ace->irq != NO_IRQ) {
-		rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace);
-		if (rc) {
-			/* Failure - fall back to polled mode */
-			dev_err(ace->dev, "request_irq failed\n");
-			ace->irq = NO_IRQ;
-		}
-	}
-
 	/*
 	 * Initialize the state machine tasklet and stall timer
 	 */
@@ -1015,6 +1006,16 @@ static int __devinit ace_setup(struct ace_device *ace)
 	val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ;
 	ace_out(ace, ACE_CTRL, val);
 
+	/* Now we can hook up the irq handler */
+	if (ace->irq != NO_IRQ) {
+		rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace);
+		if (rc) {
+			/* Failure - fall back to polled mode */
+			dev_err(ace->dev, "request_irq failed\n");
+			ace->irq = NO_IRQ;
+		}
+	}
+
 	/* Print the identification */
 	dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
 		 (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);
@@ -1035,8 +1036,6 @@ static int __devinit ace_setup(struct ace_device *ace)
 	blk_cleanup_queue(ace->queue);
       err_blk_initq:
 	iounmap(ace->baseaddr);
-	if (ace->irq != NO_IRQ)
-		free_irq(ace->irq, ace);
       err_ioremap:
 	dev_info(ace->dev, "xsysace: error initializing device at 0x%lx\n",
 	       ace->physaddr);


  parent reply	other threads:[~2007-09-30 22:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-30 22:56 [PATCH v2 0/6] SystemACE: rework and of_platform bus binding patches Grant Likely
2007-09-30 22:57 ` [PATCH v2 1/6] Add Xilinx SystemACE entry to maintainers Grant Likely
2007-09-30 22:57 ` [PATCH v2 2/6] Sysace: Use the established platform bus api Grant Likely
2007-09-30 23:05   ` Christoph Hellwig
2007-09-30 23:33     ` Grant Likely
2007-10-01 11:59       ` Jens Axboe
2007-10-01 13:17         ` Grant Likely
2007-10-02  5:58         ` Benjamin Herrenschmidt
2007-10-02  6:35           ` Jens Axboe
2007-10-02 13:52             ` Grant Likely
2007-09-30 22:57 ` [PATCH v2 3/6] Sysace: Move structure allocation from bus binding into common code Grant Likely
2007-09-30 22:57 ` [PATCH v2 4/6] Sysace: minor rework and cleanup changes Grant Likely
2007-09-30 22:57 ` Grant Likely [this message]
2007-10-02  5:55   ` [PATCH v2 5/6] Sysace: Move IRQ handler registration to occur after FSM is initialized Benjamin Herrenschmidt
2007-10-02 13:57     ` Grant Likely
2007-09-30 22:57 ` [PATCH v2 6/6] Sysace: Add of_platform_bus binding Grant Likely

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=20070930225726.2476.44211.stgit@trillian.cg.shawcable.net \
    --to=grant.likely@secretlab.ca \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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

Powered by JetHome