aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/vme
diff options
context:
space:
mode:
authorVincent Bossier <vincent.bossier@gmail.com>2011-06-09 08:59:43 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-28 14:08:34 -0700
commit54b4a779c9565c475a17cc1254a38f293a5ba3ef (patch)
tree83b9e5f0d9cd8624df0361f38321b548dbcb99e3 /drivers/staging/vme
parent05614fbfc1f3dedc337ac67e83b6ad130ba9fc9f (diff)
Staging: VME: Fix ca91cx42 VME interrupt generation.
The wait_event_interruptible call requires a condition as second argument that needs to be true sometimes, which is obviously not the case with '0'. The new logic is inspired from the tsi148 driver and takes into account Universe II chip specifics. Signed-off-by: Vincent Bossier <vincent.bossier@gmail.com> Acked-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vme')
-rw-r--r--drivers/staging/vme/bridges/vme_ca91cx42.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 6aad34b8b3f..5122c13a956 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -256,6 +256,18 @@ static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
free_irq(pdev->irq, pdev);
}
+static int ca91cx42_iack_received(struct ca91cx42_driver *bridge, int level)
+{
+ u32 tmp;
+
+ tmp = ioread32(bridge->base + LINT_STAT);
+
+ if (tmp & (1 << level))
+ return 0;
+ else
+ return 1;
+}
+
/*
* Set up an VME interrupt
*/
@@ -311,7 +323,8 @@ static int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
iowrite32(tmp, bridge->base + VINT_EN);
/* Wait for IACK */
- wait_event_interruptible(bridge->iack_queue, 0);
+ wait_event_interruptible(bridge->iack_queue,
+ ca91cx42_iack_received(bridge, level));
/* Return interrupt to low state */
tmp = ioread32(bridge->base + VINT_EN);