diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2015-05-28 15:07:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-12 17:26:57 -0700 |
commit | 75c66b6db7baacf592268d5d5c4c9ecb6e2bcae7 (patch) | |
tree | 606737c9d9d09807a662589649abf62b2edac885 /drivers/vme/bridges/vme_ca91cx42.c | |
parent | b2383c90a9d691201b9aee557776694cde86a935 (diff) | |
download | op-kernel-dev-75c66b6db7baacf592268d5d5c4c9ecb6e2bcae7.zip op-kernel-dev-75c66b6db7baacf592268d5d5c4c9ecb6e2bcae7.tar.gz |
vme: stop DMA transfer on interruption
Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Cc: Igor Alekseev <igor.alekseev@itep.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vme/bridges/vme_ca91cx42.c')
-rw-r--r-- | drivers/vme/bridges/vme_ca91cx42.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c index 18078ec..e9bd657 100644 --- a/drivers/vme/bridges/vme_ca91cx42.c +++ b/drivers/vme/bridges/vme_ca91cx42.c @@ -1192,7 +1192,7 @@ static int ca91cx42_dma_list_exec(struct vme_dma_list *list) { struct vme_dma_resource *ctrlr; struct ca91cx42_dma_entry *entry; - int retval = 0; + int retval; dma_addr_t bus_addr; u32 val; struct device *dev; @@ -1245,8 +1245,18 @@ static int ca91cx42_dma_list_exec(struct vme_dma_list *list) iowrite32(val, bridge->base + DGCS); - wait_event_interruptible(bridge->dma_queue, - ca91cx42_dma_busy(ctrlr->parent)); + retval = wait_event_interruptible(bridge->dma_queue, + ca91cx42_dma_busy(ctrlr->parent)); + + if (retval) { + val = ioread32(bridge->base + DGCS); + iowrite32(val | CA91CX42_DGCS_STOP_REQ, bridge->base + DGCS); + /* Wait for the operation to abort */ + wait_event(bridge->dma_queue, + ca91cx42_dma_busy(ctrlr->parent)); + retval = -EINTR; + goto exit; + } /* * Read status register, this register is valid until we kick off a @@ -1261,6 +1271,7 @@ static int ca91cx42_dma_list_exec(struct vme_dma_list *list) val = ioread32(bridge->base + DCTL); } +exit: /* Remove list from running list */ mutex_lock(&ctrlr->mtx); list_del(&list->list); |