summaryrefslogtreecommitdiffstats
path: root/drivers/dma/cppi41.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-07-20 23:59:16 -0700
committerBrian Norris <computersforpeace@gmail.com>2014-07-21 00:01:16 -0700
commitd0d5864676dbccfb1337864a0ae6ce97e6342678 (patch)
tree7caa674ec05a1797054cd4304f0a047b6dacddd6 /drivers/dma/cppi41.c
parent6534e6809e6c9d48114b537afe03bee3fd33bf01 (diff)
parent9a3c4145af32125c5ee39c0272662b47307a8323 (diff)
downloadop-kernel-dev-d0d5864676dbccfb1337864a0ae6ce97e6342678.zip
op-kernel-dev-d0d5864676dbccfb1337864a0ae6ce97e6342678.tar.gz
Merge tag 'v3.16-rc6' into MTD development branch
Linux 3.16-rc6
Diffstat (limited to 'drivers/dma/cppi41.c')
-rw-r--r--drivers/dma/cppi41.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index d028f36..8f8b0b6 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -86,6 +86,9 @@
#define USBSS_IRQ_PD_COMP (1 << 2)
+/* Packet Descriptor */
+#define PD2_ZERO_LENGTH (1 << 19)
+
struct cppi41_channel {
struct dma_chan chan;
struct dma_async_tx_descriptor txd;
@@ -307,7 +310,7 @@ static irqreturn_t cppi41_irq(int irq, void *data)
__iormb();
while (val) {
- u32 desc;
+ u32 desc, len;
q_num = __fls(val);
val &= ~(1 << q_num);
@@ -319,9 +322,13 @@ static irqreturn_t cppi41_irq(int irq, void *data)
q_num, desc);
continue;
}
- c->residue = pd_trans_len(c->desc->pd6) -
- pd_trans_len(c->desc->pd0);
+ if (c->desc->pd2 & PD2_ZERO_LENGTH)
+ len = 0;
+ else
+ len = pd_trans_len(c->desc->pd0);
+
+ c->residue = pd_trans_len(c->desc->pd6) - len;
dma_cookie_complete(&c->txd);
c->txd.callback(c->txd.callback_param);
}
OpenPOWER on IntegriCloud