dmaengine: qcom_hidma: break completion processing on error
authorSinan Kaya <okaya@codeaurora.org>
Fri, 7 Oct 2016 05:25:14 +0000 (01:25 -0400)
committerVinod Koul <vinod.koul@intel.com>
Wed, 19 Oct 2016 13:33:06 +0000 (19:03 +0530)
We try to consume as much successful transfers as possible. Now that we
support MSI interrupts, an error interrupt might be observed by another
processor while we are finishing the successful ones.

Try to abort successful processing if this is the case.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/qcom/hidma_ll.c

index 132d29eb9a63094633db62d5d6d8c788e77ef3e1..e605c9096545c9c070209caa109d1bdf6ca553c0 100644 (file)
@@ -291,6 +291,13 @@ static int hidma_handle_tre_completion(struct hidma_lldev *lldev)
                evre_write_off =
                    readl_relaxed(lldev->evca + HIDMA_EVCA_WRITE_PTR_REG);
                num_completed++;
+
+               /*
+                * An error interrupt might have arrived while we are processing
+                * the completed interrupt.
+                */
+               if (!hidma_ll_isenabled(lldev))
+                       break;
        }
 
        if (num_completed) {