Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2bbf3da authored by Grant Likely's avatar Grant Likely Committed by Jens Axboe
Browse files

Sysace: Don't enable IRQ until after interrupt handler is registered



The previous patch to move the interrupt handler registration moved it
below enabling interrupts which could be a problem if the device is on
a shared interrupt line.  This patch fixes the order.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent b5515d86
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1005,11 +1005,6 @@ static int __devinit ace_setup(struct ace_device *ace)
	ace_out(ace, ACE_CTRL, ACE_CTRL_FORCECFGMODE |
	ace_out(ace, ACE_CTRL, ACE_CTRL_FORCECFGMODE |
		ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ);
		ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ);


	/* Enable interrupts */
	val = ace_in(ace, ACE_CTRL);
	val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ;
	ace_out(ace, ACE_CTRL, val);

	/* Now we can hook up the irq handler */
	/* Now we can hook up the irq handler */
	if (ace->irq != NO_IRQ) {
	if (ace->irq != NO_IRQ) {
		rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace);
		rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace);
@@ -1020,6 +1015,11 @@ static int __devinit ace_setup(struct ace_device *ace)
		}
		}
	}
	}


	/* Enable interrupts */
	val = ace_in(ace, ACE_CTRL);
	val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ;
	ace_out(ace, ACE_CTRL, val);

	/* Print the identification */
	/* Print the identification */
	dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
	dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
		 (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);
		 (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);